Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Sort order for Validate

Quote Reply
Sort order for Validate
Hi,

Is it possible for the validate sort order to work on two fields, as opposed to just Add_Date?

I have a custom field 'isPaid' for paid reviews. It defaults to 'No' for standard submissions, but I'd like any that are paid to appear at the head of the validate list, i.e.; sort -> isPaid (DESC), Add_Date (DESC)

Alternatively, is there a way I could PUSH the paid review submissions to the head of the validate list and put them in front of the regular submissions?

All the best
Shaun
Quote Reply
Re: [qango] Sort order for Validate In reply to
Do you mean the link validating list on the admin page?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [qango] Sort order for Validate In reply to
Checkout sub validate_links in admin/Links/Tools.pm....

Code:
# Get a list of links awaiting validation.
my $sth = $db->query_sth ( {
isValidated => 'No',
mh => $mh,
nh => $nh,
sb => 'Add_Date',
so => 'DESC'
});
Quote Reply
Re: [Paul] Sort order for Validate In reply to
Paul,

Thanks, that's exactly the bit of code I was thinking of modifying but I wanted to know if I could put two field in there?

Do you know if it would it still do the sort properly?

Thanks
Shaun
Quote Reply
Re: [qango] Sort order for Validate In reply to
query_sth just builds whatever you pass in...

$self->select_options ("ORDER BY $in->{sb} $in->{so}") if ($in->{sb});

So yeah, you can pass in multiple columns and it should sort them properly. eg...

sb => 'isPaid, Add_Date',
Quote Reply
Re: [Paul] Sort order for Validate In reply to
Paul,

Thanks, I've got it working.

I had to blank the so (sort order) field because it applied the same order to both fields, but I expermented and found I could put the sort order directly after the field name, i.e.; 'isPaid DESC,Add_Date'

Cheers
Shaun