Gossamer Forum
Home : Products : Gossamer Links : Discussions :

How to present e.g., 5 last URL validated sites...

Quote Reply
How to present e.g., 5 last URL validated sites...
hey all,

1st I must say that I love this bulletin board... very instructing...

I would like to present (in ssi?) the last 5 new sites validated on my homepage (to replace the what's new page)

Anybody knows how to do that?

Thanks for helping.

Quote Reply
Re: How to present e.g., 5 last URL validated sites... In reply to
Here is some code from the top10 plugin that should be easy enough for you to modify...

use strict;
use Links qw/$IN $DB $TPL $CFG/;
use lib '';

top10();


sub top10 {
# -------------------------------------------------------------------
# This subroutine will get called whenever the user clicks
# on 'Top10' in the admin menu. Remember, you need to print
# your own content-type headers, you should use
#
my $FONT = 'font face="Tahoma,Arial,Helvetica" size="2"';
my $db = $DB->table('SearchLog');
my $output = qq~<B>Your current Top10 Queries:</b><BR><BR>
<table border=1 cellpadding=0 cellspacing=0><tr><td>
<table border=0 width=500>
<tr><td><$FONT>URL:</font></td>
</tr>
~;
my $search_db = $DB->table('SearchLog');
$search_db->select_options ('ORDER BY HitCount DESC', 'LIMIT 10');
my $sth = $search_db->select;
while (my $hit = $sth->fetchrow_hashref) {
my $escaped = $IN->escape ($hit->{Term});
$output .= qq!
<tr><td>$hit->{Term}</font></td>
</tr>
!;
}
$output .= "</table></td></tr></table>";
print $IN->header();

print qq~
<p><$FONT>$output</font></p>
~;
}


You would just need to change the table names and variables and this:

$search_db->select_options ('ORDER BY HitCount DESC', 'LIMIT 10');

...to reflect your requirements.

Also add the path to your admin directory at the top like..

use lib '/PATH/TO/ADMIN';

The red parts are the bits you will need to modify.

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: How to present e.g., 5 last URL validated sites... In reply to
Thanks a lot for your help, but.... which TOP10 pluggin are you talking about?

Where can I download it?

Thanks again.

Cheers

steve

Quote Reply
Re: How to present e.g., 5 last URL validated sites... In reply to
The top10 plugin that I made (with help).

I will send it to your email....

Paul Wilson.
new - http://www.wiredon.net
Quote Reply
Re: How to present e.g., 5 last URL validated sites... In reply to
Hi!

> I will send it to your email....

Me too please: dablast@gmx.de


Thanks!

Quote Reply
Re: How to present e.g., 5 last URL validated sites... In reply to
For people wanting the plugins please contact me privately - don't post requests here.

Paul Wilson.
new - http://www.wiredon.net