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

sorting problem

Quote Reply
sorting problem
Hi,
In the Links.pm file I have my this line to sort my catagory page:

$LINKS{build_sort_order_category} = "isPopular,isNew,Title";

Now the weird thing is instead of putting the isPopular & isNew links on top, it puts them all on bottom. I can't figure this out. Any thoughts?





Quote Reply
Re: sorting problem In reply to
You need to sort in DESCENDING order:

$LINKS{build_sort_order_category} = "isPopular DESC,isNew DESC,Title";


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: sorting problem In reply to
I tried it. did the "BuildAll" but they are still on bottom.

Can something be corrupted?



Quote Reply
Re: sorting problem In reply to
Do you have a lot of alt-links set up? (Links in additional categories?)


http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: sorting problem In reply to
I have some, not alot, probably 30 links have alt categories

Quote Reply
Re: sorting problem In reply to
Usually, the category sort on build does work. If you have a lot of alt-links, those links sort of mess things up.

The sort-order parameter is passed to the SQL query pretty much "as is". If you go to the SQL monitor, and ask it to:

Select ID,isPopular,isNew,Title from Links ORDER BY isPopular DESC,isNew DESC,Title LIMIT 30

What happens?

If you are using "Yes/No" in the fields, then you might have to remove the "DESC" depending on how it's sorting. If that is an "enum" field, it may sort by the array postion rather than alphabetical.

But, if the sort looks good, then it's the alt-link problem that is causing the trouble.



http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: sorting problem In reply to
I tried what you said and it turned out fine. I'm going to try to find all the alt-links and get rid of them
Thanks!

Quote Reply
Re: sorting problem In reply to
If you have a program like MySQLman or phpMyAdmin just go to the database and "EMPTY" the CategoryAlternates table. That will get rid of all the alt-links.

Or, in the SQL monitor

DELETE from CategoryAlternates

should erase all the alt-links.

With a program like the above, you could copy the table + data to a new table name (such as CategoryAlternatesHold) and the delete the links from CategoryAlternates and then if you decided you wanted them back, just delete the CategoryAlternates table and rename the CategoryAlternatesHold to CategoryAlternates




http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/