Gossamer Forum
Quote Reply
Browser.pm
I want to change the the sort order of the links in the browser section.
The links should be sorted by a customized column which have date format.
I think there must be changed something in the following part of browser.pm

Am I right?

# Get list of links.
my %output;
while (my $link = $sth->fetchrow_hashref) {
$output{$link->{ID}} = $self->return_template ("browser_link_list.html",
{
category_id => $category_id,
hasChangeRequest => $changed{$link->{ID}} || 0,
linkowner_esc => GT::CGI->escape($link->{LinkOwner}),
%$link,
%$perms
}
);
}



Michael


--
Michael Skaide

http://www.cycle24.de

Quote Reply
Re: [Michael Skaide] Browser.pm In reply to
Hi Michael -

Not exactly sure what you are trying to do, but you probably need to change this line (which appears about 35 lines above the section you quoted):

$link_db->select_options ("LIMIT $offset, $maxhits");

To this

$link_db->select_options ("ORDER BY columnname DESC", "LIMIT $offset, $maxhits");

The "DESC" is optional depending on if you need to sort by ascending or descending (default is ascending).

Hope that helps. Smile

(EDIT: fixed missing quote)

--

Matt G

Last edited by:

Matt Glaspie: Dec 18, 2001, 2:22 PM
Quote Reply
Re: [Matt Glaspie] Browser.pm In reply to
deleted






--
Michael Skaide

http://www.cycle24.de

Last edited by:

Michael Skaide: Dec 18, 2001, 2:14 PM
Quote Reply
Re: [Michael Skaide] Browser.pm In reply to
("ORDER BY columnname DESC", "LIMIT $offset, $maxhits");

Quote Reply
Re: [PaulW] Browser.pm In reply to
darnit, you beat me to it... Wink

--
Matt G
Quote Reply
Re: [Matt Glaspie] Browser.pm In reply to
hehe. Ya gotta keep up ith the youngsters (not that I know your age) Angelic
Quote Reply
Re: [Matt Glaspie] Browser.pm In reply to
I changed it without success .... but some lines below .... I found the reason

$catlink_db->select_options ("ORDER BY isValidated DESC, Title ASC", "LIMIT $offset, $maxhits");

I changed isValidated to my columnname.

Thanks a lot

Michael

--
Michael Skaide

http://www.cycle24.de