Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Changing COOL sort to 'hits' only

Quote Reply
Changing COOL sort to 'hits' only
To change the COOL sort from the way it's done now (by Category, then by Title, hits, etc) you can make a change to the nph-build.cgi in the build_cool_page subroutine:

Code:
# Create the HTML for the individual links.
$total = 0;
while ($link = $sth->fetchrow_hashref) {
$total++;
my $get_link = &site_html_link ($link); ##
$link_output{$link->{'Name'}} .= $get_link ; ##
$link_results .= $get_link ; ###
}

# Create the HTML for the category headers, and join it all together into link_results.
## foreach $category (sort keys %link_output) {
## $category_clean = &build_clean_name ($category);
## $link_results .= qq|<P><A HREF="$LINKS{build_root_url}/$category_clean/$LINKS{build_index}">$category</A>\n|;
## $link_results .= $link_output{$category};
## }

The lines with '##' are the changed ones.
You add 2 lines and change 1 in the top subroutine, and comment out the lines in the bottom one (they are next to each other in the file.

To change the way the links are sorted, edit the parameter in the Links.pm file to whatever you want, and the links will be sorted in that order _without_ being grouped by category.

[made a change to prevent two subroutine calls]

[This message has been edited by pugdog (edited October 18, 1999).]

[This message has been edited by pugdog (edited October 18, 1999).]
Subject Author Views Date
Thread Changing COOL sort to 'hits' only pugdog 3029 Oct 18, 1999, 7:48 PM
Post Re: Changing COOL sort to 'hits' only
widgetz 2947 Oct 18, 1999, 8:14 PM
Post Re: Changing COOL sort to 'hits' only
pugdog 2948 Oct 18, 1999, 10:55 PM
Post Re: Changing COOL sort to 'hits' only
Alex 2949 Oct 19, 1999, 6:55 AM
Post Re: Changing COOL sort to 'hits' only
pugdog 2945 Oct 19, 1999, 8:16 AM
Post Re: Changing COOL sort to 'hits' only
widgetz 2947 Oct 19, 1999, 11:06 AM
Post Re: Changing COOL sort to 'hits' only
pugdog 2948 Oct 19, 1999, 12:30 PM
Post Re: Changing COOL sort to 'hits' only
pugdog 2950 Dec 22, 1999, 12:06 AM