# ==================================================================
# 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~
<$FONT>LinkID |
<$FONT>URL |
<$FONT>Title |
<$FONT>Status |
~;
while (my $hit = $sth->fetchrow_hashref) {
#my $escaped = $IN->escape ($hit->{ID});
my $id = $hit->{LinkID};
$output .= qq!
<$FONT>$hit->{LinkID} | <$FONT>$hit->{URL} | <$FONT>$hit->{Title} | <$FONT>$hit->{Status} |
!;
}
$output .= " |
";
print $IN->header();
print qq~
Links SQL: Bad Links Reported.