Gossamer Forum
Home : Products : Links 2.0 : Customization :

sort order

Quote Reply
sort order
I've seen a couple of posts about changing sort order and don't mind admitting that I am totally confused. Also, those posts appeared to be geared toward randomizing the sort order, or toward weighting them by number of hits. I really don't want to do either.

The links.def file says:

Code:
# Field number to sort links by:
$db_sort_links = 1;

(with 1 = site title, i.e. alphabetically).
and it appears that the actual (default) sort order in 2.0 is:
1. Popular sites
2. New sites
3. everything else

with each set in alphabetical order.

All I want to change is to NOT have popular sites elevated to the top of the list. I figure a lot of folks will just click those links which will keep them at the top of the list which will prevent other sites from getting much traffic (the same idea as having a first page result from excite or alta vista...those sites always get the most traffic).

How can I change it so that new sites remain on top, but popular sites are just listed alphabetically with the rest of the links? Please keep in mind my general ignorance and be as specific as possible.


On another note, what exactly is the purpose of the 'yes' 'no' selectors for pop and new in the links manager? It doesn't seem to make any difference how they are set because the script overwrites them based on the links.cfg settings.
Quote Reply
Re: sort order In reply to
Hi,

Open up db_utils.pl and look for sub build_sort_hits. Remove the following lines:

Code:
($iscool{$b} and !$iscool{$a}) and return 1;
($iscool{$a} and !$iscool{$b}) and return -1;
...
($iscool{$a} and $iscool{$b}) and return lc($sortby{$a}) cmp lc($sortby{$b});

That will sort new first, then alphabetically.

Cheers,

Alex


[This message has been edited by Alex (edited February 26, 1999).]
Quote Reply
Re: sort order In reply to
Read the readme file included in the script!

>>> Alex is working on it right NOW!