Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Priority sort

Quote Reply
Priority sort
Hi all, i just set up the database and want to display my links with priority on each category. Here is what i already did.

I add a column to my links table, named Priority (INT, 3)

Then, i add 2 links (i´m testing the program Wink), one with priority value as 1 and the other as 0 (default), so what i need is to display the links greaters first on each category.

I found this 2 threads:
http://www.gossamer-threads.com/...orum.cgi?post=185283
http://www.gossamer-threads.com/...orum.cgi?post=185049

and i already have the new file on my server. I also change on my setup search options the value of this 2 options build_sort_order_search_cat and build_sort_order_search with this:

Priority DESC for each

Do i need to change something else? What do i missing? because i still saw the links with 0 value on top of the links with the 1 value. I need to display the great value 1st.

Thanks in advance,

Jesus
Quote Reply
Re: [Jesus] Priority sort In reply to
New STH.pm file doesn't work for me either ...
Quote Reply
Re: [Jesus] Priority sort In reply to
I have:

build_sort_order_search & build_sort_order_search_cat : Priority DESC,score,Rating DESC.

This works for me in the search results, as far as I can tell - i have not fully tested it yet.

I also put this for my category builds:

Priority DESC,isNew DESC,isPopular DESC,Title

So that priority comes first here also.
Quote Reply
Re: [Jesus] Priority sort In reply to
I had the same problem with trying to sort with isPriority.

What I did was set up a new column called Premium, very similar to the Votes column.

Premium
Column Type - INT
Column Index - None
Not Null - No
Default - 5
Form Display - Premium
Form Type - TEXT
Form Size - 10
File Save Method - HASHED

In the build_sort_order_category add "Premium DESC,isNew, etc.

Now the beauty of this is you can govern which link is displayed in sequence.

For example all links have the default of 5, the higher the number the higher the link is displayed, the lower the number the lower the link is displayed.

1st link > 10
2nd link > 9
etc ,etc
Default > 5

If you want a link listed last have it as a Number lower than 5.
(Negative number works also)

2nd Last link > 2
Last link > 1

Works for me.

Regards

minesite
Quote Reply
Re: [minesite] Priority sort In reply to
Hi minesite... i found my problem !! and now its fixed !!

I was not change it the build_sort_order_category value, i was changing in the serach option the build_sort_order_search_cat

But now its working !! and also i like the way you did, that will help each to have always the way to put a link in the premium section before another one.

Again thanks.

Jesus Wink
Quote Reply
Re: [Jesus] Priority sort In reply to
Glad you got it worked out.

With the Premium column it gives you a chance to move the ones that change there name to "AAA" or "111" or increase their hits to get listed at the top of the page.

This way you can give them a negative value and regardless of what they do they are always listed last.

It also put pressure on them to take up the Priority listing.Wink

Regards

minesite