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

Cool Sort / sort-order bug

Quote Reply
Cool Sort / sort-order bug
Alex,

If I change the order (criteria) for the sort on the "cool" page in the Links.pm file, the output has all the categories at the top of the page, and all the links following. This is somewhat odd.

I can remove the category display altogether by commenting out:

Code:
# 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};
}

but What I'd _like_ to do is have the category print out above _each_ link (even if the category is repeated) but sort the links in the order Priority,isNew,RandOrder (RandOrder is a pseudo random number based on the size of the description, and added to the nph-build sub build_cool routine ...LENGTH(Links.Description) AS RandOrder)

To do this, "Category_Name" needs to become a property of a "link" so that anywhere (as in link.html, new, cool, etc) the link can access it's own category, not the category that's being worked on at the moment.

This will allow "links" to be found, worked on, and sorted, without the old structure of the "category" imposed upon it.

Categories are a 'default' way to classify a link while 'browsing' but once some other criteria is imposed upon a link (such as a search, sort or rating) the category is only another piece of information _about_ the link, not defining it.

The category is useful, once a link is found, to help people find other links, or continue their search.

With the powerful 'search' features of the LinkSQL, (even Links2.0) I've found visitors on my site almost always resort searching to find what they are looking for (or use the What's New / What's Cool pages) as a starting point. They work backwards into the categories, not forward from them.



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