Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Top rated and cool questions

Quote Reply
Top rated and cool questions
Two question:

1. How do change the "top rated" page so that it will show the top ten rated with at least 3 ratings (instead of 10 which is the default)?

2. How can I make the "Cool" page sort links by number of hits.

Thanks,

Didi

Quote Reply
Re: Top rated and cool questions In reply to
<<<1. How do change the "top rated" page so that it will <<<show the top ten rated with at least 3 ratings (instead <<<of 10 which is the default)?

I think you go to Links/Build.pm and look for the line:
$link_db->select_options ("ORDER BY Rating DESC", "LIMIT 10");
$rated = $link_db->select ( GT::SQL::Condition->new('Votes', '>=', 10, 'isValidated', '=', 'Yes') );

and change the 10 value to whatever you want.
<<<2. How can I make the "Cool" page sort links by number <<<of hits.

in your setup go to build options and at build_sort_order_cool change it to isPopular .



Regards
Abd

http://www.idleb.com
Quote Reply
Re: Top rated and cool questions In reply to
Thanks for the help, after trying a few things here is the best solution I found:

1. For changing the number of votes going to Build.pm and changing the defaults in *2* lines:

$link_db->select_options ("ORDER BY Rating DESC", "LIMIT 10");
$rated = $link_db->select ( GT::SQL::Condition->new('Votes', '>=', 10, 'isValidated', '=', 'Yes') );

$link_db->select_options ("ORDER BY Votes DESC", "LIMIT 10");
$voted = $link_db->select ( GT::SQL::Condition->new('Votes', '>=', 10, 'isValidated', '=', 'Yes') );

Change the "10" into whatever number you wish, but only in the 'Votes', '>=', 10 (the LIMIT is used for changing the number of resources on the top rating list).

2. For sorting by number of hits I used Hits DESC in the build_sort_order_cool (for some reason isPopular didn't do the job).

Didi

Quote Reply
Re: Top rated and cool questions In reply to
This should be an option that is set via the Links Admin. It could be done via a plug-in, but that would be like using a scoop shovel to dig a hole for a marigold.

Maybe Alex will add that variable in to the Config next release! :)

I posted a whole set of codes for the 1.13 version, to change the cut offs, votes, etc.

Most of that applies to the 2.0 version as long as you want to edit those routines as you showed.



PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum