# ================================================================== # Plugins::Bad_Link - Auto Generated Install Module # # Plugins::Bad_Link # Author : PUGDOGŪ Enterprises, Inc. # Version : 2.1.1a # Updated : Sept 12 2002 # # # ================================================================== # package Plugins::Bad_Link; # ================================================================== use strict; use GT::Plugins qw/STOP CONTINUE/; use Links qw/$IN $DB $CFG/; use vars qw/$VERSION $DEBUG $NAME $FONT/; # Your code begins here! Good Luck! $VERSION = '2.1.1a'; $DEBUG = 0; $NAME = 'Bad_Link'; $FONT = 'font face="Tahoma,Arial,Helvetica" size="2"'; sub view { # ------------------------------------------------------------------- # This is the admin view, it lets people search on keywords # and purge old listings. # my $db = $DB->table('Bad_Link'); my $days = $IN->param('days'); if (defined $days and $days =~ /^\d+$/) { Links::init_date(); my $date = GT::Date::date_get (time - 86400 * $days); $db->delete ( GT::SQL::Condition->new ( 'TimeCheck', '<', $date) ); } my $nh = $IN->param('nh') || 1; my $mh = $IN->param('mh') || 25; my $sth = $db->query_sth ($IN); my $hits = $sth->rows; my $tb = $DB->html($db,$IN)->toolbar ($nh, $mh, $hits, $IN->url); my $output = qq~
~; while (my $hit = $sth->fetchrow_hashref) { #my $escaped = $IN->escape ($hit->{ID}); my $id = $hit->{LinkID}; $output .= qq! !; } $output .= "
<$FONT>LinkID <$FONT>URL <$FONT>Title <$FONT>Status
<$FONT>$hit->{LinkID}<$FONT>$hit->{URL}<$FONT>$hit->{Title}<$FONT>$hit->{Status}
"; print $IN->header(); print qq~ Links SQL: Bad Links Reported.
~; print Links::header ('Bad Links Reported', 'This screen shows you a list of Bad Links people have Reported so far', 0); print qq~

<$FONT>$output

~; ($tb) and print "

<$FONT>Pages: $tb

"; print qq~

<$FONT>Purge listings older then days old.

~; } sub help { ## my $cfg = Links::Plugins::get_plugin_user_cfg ('Bad_Link'); print $IN->header(); print Links::header ('Help Menu', qq| Bad_Link.cgi should be in your LinkSQL CGI directory -- where jump.cgi, etc are located. It needs to be chmod 755 .

Call this from your templates or pages as


   <A href="<%db_cgi_url%>/bad_link.cgi?ID=<%ID%>">Report this link as bad!</A>

The only parameter the program expects -- or looks for -- is ID=nnnn It requires it, or you get an error (can't report a blank link!)

There is NO REASON to call this script in any way other than the above! It will do all the work once you tell it which link you want to report! Just pass it an ID!! |); } # Always end with a 1. 1;