Gossamer Forum
Home : Products : DBMan : Customization :

sorting problem

Quote Reply
sorting problem
Hi,

first of all, my problem is in links 2, and the problem is a typical perl question. So I posted in the 2 boards, got no reply and as I actually got some real good answers in this board, and as the same sorting is being used for dbman as well I thought, let's ask for help here.

So here I go:

I've been trying to modify the sort routine, of links 2 and posted my question about something weird at the links 2 modify board a few days ago:

http://www.gossamer-threads.com/...latest_reply;so=ASC;

Please take a look at the code to see if somebody knows what's going wrong. I tried to add a field and if its content is 'Yes' it should place the link on top of the list. What happens now is that it works, except for one or two links it still leaves on top. I guess my sorting isn't 100% foolproof, and it leaves the last (two) links to be sorted on the top in stead of putting them on their right spot as well. So, I guess I've left a gap in it... But can't fix it by myself.

Thanks a lot,

Lex
Quote Reply
Re: [Lex] sorting problem In reply to
I'm just guessing here, but I see a pattern and then the pattern stops.

Quote:
($unsorted[$db_ispop + ($i * ($#db_cols+1))] eq "Yes") and ($iscool{$i} = 1);

$db_ispop vs $iscool
Quote Reply
Re: [joematt] sorting problem In reply to
Thank you for looking at it, however, that wasn't it. I added the 'priority' stuff, the rest is as it was and worked like a charm. I know if you look at the rest you'd expect it not to change name, but it does...

But thanks again for your/my FIRST ANSWER!!! It really makes me happy!

Lex
Quote Reply
Re: [Lex] sorting problem In reply to
I forgot to put %priority in
my (%sortby, %isnew, %iscool, %priority, $hit, $i, @sorted);
Works like a charm now!

Lex