Hi have found this thread:
http://gossamer-threads.com/perl/forum/showthreaded.pl?Cat=&Board=LSQLNG&Number=153582&page=&view=&sb=&vc=1#Post153582
And I have modified this global to show in the home page or others the 10 last links added to links directory:
Add this global in build options/Template globals:
Global name: Lastlinks10
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Add_Date DESC', 'LIMIT 10');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { Lastlinks10_loop => \@output };
}
Go to the templates (home.html or others) and add this:
<%Lastlinks10%>
<%loop Lastlinks10_loop%>
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><b><%Title%></a>
<%if Description%>
<%Description%>
<%endif%>
Date: <%Add_Date%>
<%endloop%>
from <a href="... to Date:<%Add_Date%> you can format the html at your convenience.
This is correct? Apparently works fine :)
Another doubt: How to display the words or expressions most searched? For example, I need to display to the public one spy page (new template) with the top 50 words searched in the directory & the top 50 last words searched. Or show to the public one spy popup with the last 5 searches & the 5 words or expressions most searched. Any ideas or mods or hacks or plugins?
Thank you very much.
http://gossamer-threads.com/perl/forum/showthreaded.pl?Cat=&Board=LSQLNG&Number=153582&page=&view=&sb=&vc=1#Post153582
And I have modified this global to show in the home page or others the 10 last links added to links directory:
Add this global in build options/Template globals:
Global name: Lastlinks10
sub {
my $tags = shift;
my $table = $DB->table('Links');
$table->select_options ('ORDER BY Add_Date DESC', 'LIMIT 10');
my $sth = $table->select;
my @output;
while (my $link = $sth->fetchrow_hashref) {
push (@output, $link);
}
return { Lastlinks10_loop => \@output };
}
Go to the templates (home.html or others) and add this:
<%Lastlinks10%>
<%loop Lastlinks10_loop%>
<a href="<%db_cgi_url%>/jump.cgi?ID=<%ID%>"><b><%Title%></a>
<%if Description%>
<%Description%>
<%endif%>
Date: <%Add_Date%>
<%endloop%>
from <a href="... to Date:<%Add_Date%> you can format the html at your convenience.
This is correct? Apparently works fine :)
Another doubt: How to display the words or expressions most searched? For example, I need to display to the public one spy page (new template) with the top 50 words searched in the directory & the top 50 last words searched. Or show to the public one spy popup with the last 5 searches & the 5 words or expressions most searched. Any ideas or mods or hacks or plugins?
Thank you very much.