Gossamer Forum
Home : Products : Links 2.0 : Customization :

latest entry first

Quote Reply
latest entry first
probaly simple but - how do i get latest entries to appear at the top of category pages?

(BTW I did search forums-no joy)
Quote Reply
Re: [arthurdavid] latest entry first In reply to
Should be as simple as adding a new tag in site_html_templates.pl, with something like;

Code:
my $number_last = 5;

open(HANDLE, "/path/to/data/folder/links.db") || die &cgierr("Cant open. Reason: $!");
my $data = <HANDLE>;
close(HANDLE);

my @exploded = split("\n",$data);

my $total = $#exploded + 1;

my $count = 0;
my $start = $total - $number_last;
foreach (@exploded)
$count++;
if ($count == $start) {
# do stuff here that will show the last links...
}
}

This is untested, and off the top of my head, so it probably won't work without a few tweaks. I don't have a copy of Links 2 with me, so unfortunatly I can't give you a more detailed answer to your question, with exact instructions (sorry).

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] latest entry first In reply to
suprised there no tested mod that would work to put new entries at the top of the page...