Gossamer Forum
Home : Products : Links 2.0 : Customization :

portal.cgi

Quote Reply
portal.cgi
hi,

i have installed the portal.cgi. now i would like to know if it is possible to display the links alphabetically. thanks in advance.

regards
tom
Quote Reply
Re: [vaugh vv] portal.cgi In reply to
would you mind telling which version you are using? Cookie 1 or 2.x, Flatfile 1.x, or mySQL .x

--Philip
Links 2.0 moderator
Quote Reply
Re: [ThatPerson1024] portal.cgi In reply to
hi drew,

the current version i am using is ftp://ftp.camelsoup.com/pub/PortalLinks_1.0/portal_2.01.txt. hope this helps.

regards
tom
Quote Reply
Re: [vaugh vv] portal.cgi In reply to
That version already sorts by title....
Code:
my @sorted = sort { ${$a}[1] cmp ${$b}[1] } @links;

Did you mean something else or does the output not appear to be alphabetical? Can you post the url to your installation?

BTW, it's been serveral months since I've done any work on PortalLinks and I see a lot of things that can be improved. Also, did you find and replace "debug.cgi" with "portal.cgi" in the source code? Anyway, next time I find some time I'm going to do some cleaning up on the code.


--Philip
Links 2.0 moderator

Last edited by:

ThatPerson1024: Nov 22, 2001, 6:37 PM
Quote Reply
Re: [ThatPerson1024] portal.cgi In reply to
We worked this out in private... and realized that sorting is case sensitive. Change the above line of code to:
Code:
my @sorted = sort { lc ${$a}[1] cmp lc ${$b}[1] } @links;

--Philip
Links 2.0 moderator
Quote Reply
Re: [ThatPerson1024] portal.cgi In reply to
if anybody is interested...

drew solved the problem by replaceing

my @sorted = sort { ${$a}[1] cmp ${$b}[1] } @links;

with

my @sorted = sort { lc ${$a}[1] cmp lc ${$b}[1] } @links;

in the sub display() in portal.cgi

regards
tom