Hi,
I'm new with LSQL, I've used Links 2.0 before and now have some questions ... here is the first one:
I'm using a global to display the top 10 visited Links on my static start page;
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}
and in the template:
<%loop top5_loop%>
<%body_font%><a class="category_links" target="_blank" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>
<br>
<%Hits%> Besuche
<br>
<%endloop%>
Now I like to number the links from "1." to "10." ... as I don't know much about perl, any help is welcome ..
Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de
I'm new with LSQL, I've used Links 2.0 before and now have some questions ... here is the first one:
I'm using a global to display the top 10 visited Links on my static start page;
Code:
sub { my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Hits DESC', 'LIMIT 10');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { top5_loop => \@output };
}
and in the template:
Code:
<%top5%> <%loop top5_loop%>
<%body_font%><a class="category_links" target="_blank" href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><%Title%></a>
<br>
<%Hits%> Besuche
<br>
<%endloop%>
Now I like to number the links from "1." to "10." ... as I don't know much about perl, any help is welcome ..
Kai
___________________________________________
http://www.westalgarve.de
http://www.portugalforum.org
http://www.portugal-links.de