Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Help with Sorting Links Based on Hits

Quote Reply
Help with Sorting Links Based on Hits
I've searched the FAQ, the forum (all messages), and the readme for this, but can't seem to find the answer. (<= flame retardent)

I'm sorting my links based on hits, but the problem is, the links are sorted in the reverse order. Lowest hits first, and highest hits last.

It's probably a simple fix, so please just post it. The only threads I saw that were close were a little confusing.

Thanks in advance.

Nexus

PS. On my Win 98 with IE, when I go to check spelling, and then hit back to send the message, input is all gone! Bogus! I couldn't see a "send message" on the spell check page. Nice feature...

Quote Reply
Re: Help with Sorting Links Based on Hits In reply to
Well, since no one replied to my message, I guess I stumped the experts. (right..)

For those of you who may stumble across this, here is how I have attempted to fix the problem. I switched the following codes in the sub build_sorthit routine in the db_utils.pl file:

Old code:
return lc($sortby{$b}) cmp lc($sortby{$a});

new code:
return lc($sortby{$a}) cmp lc($sortby{$b});

This seems to be working, ie. a link with 2 hits is listed before a link with 1 hit. However, I fear that it may be sorting reverse alphabetically, so that 2 is before 1, but 2 is also before 19.

I'm hoping one of the real experts will still wade in here and set things straight.

Guys... ?

Nexus