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

Special Sort Order - Tricky?

Quote Reply
Special Sort Order - Tricky?
I'm trying to build a subcategory that Orders differently from all the other categories. Currently, I'm Ordering on a user_specific field called ImageIs where valid entries are Tall Wide and Square (It relates to an uploaded image, and depending on the value I can manually specify the image dimensions - which is necessary for quicker loading pages.)

So the ImageIs field does two things. It tells me the dimensions and it groups all my talls, square and wides together. For this one category however, I need to NOT Order according to the ImageIs, but rather by ID, (which is actually my second sort order for all the other categories) HOWEVER, I still need to use the ImageIs field to specify my dimensions. Leaving the ImageIs blank allows me to sort by ID, but then my pages load like a slug - It's a catch 22.

I looked in nph-build.cgi, and sub build_category_pages { }
the subroutine firsts grabs the links in the category AND sorts them by $LINKS{build_sort_order_category} at the same time. So because I'm grabbing ? categories, I can't say something like:

if CategoryID=somecategory) { $sortorder=(ID,IsNew,etc..);
} else { $sortorder=$LINKS{build_sort_order_category};
}

$get_links = $LINKDB->prepare (" SELECT * FROM $table WHERE CategoryID ? ORDER BY $sortorder LIMIT 1000 ");

Then I noticed sub build_sort_links, but that only appears to work if their are alt categories which there aren't.

So, where or how would I go about implementing this?

Thanks for any help.

Peace.

Kyle
Subject Author Views Date
Thread Special Sort Order - Tricky? klangan 1576 Mar 8, 2000, 5:36 AM
Post Re: Special Sort Order - Tricky?
pugdog 1518 Mar 8, 2000, 8:23 AM
Post Re: Special Sort Order - Tricky?
klangan 1512 Mar 8, 2000, 2:17 PM
Post Re: Special Sort Order - Tricky?
pugdog 1508 Mar 8, 2000, 8:02 PM