#!/usr/local/bin/perl
#########################################
# #
# SCRIPT CREATED BY #
# the_actor-guy #
# #
# MORE SCRIPTS LIKE THIS #
# CAN BE FOUND AT #
# http://webtv.tourguide.net #
# #
# YOU MAY USE AND REDISTRIBUTE #
# THIS SCRIPT AS LONG AS YOU #
# LEAVE THIS HARMLESS LITTLE #
# CREDIT TO ME ALONE. THANX #
# #
#########################################
#############################################
# EDIT THESE TWO VARIABLES #
#############################################
$listhits = "25"; # SITES SHOWN PER PAGE
$log = "ffalog.txt"; # TEXT FILE WHERE INFO STORED
#############################################
# EDITING DONE (REST IS OPTIONAL) #
#############################################
use CGI qw(param);
$showhits = param("showhits");
$showhitsplus = param("showhitsplus");
$action = param("action");
$title = param("title");
$color = param("color");
$link = param("link");
$grad = param("grad");
$desc = param("desc");
$angle = param("angle");
$url = param("url");
$text = param("text");
#############################################
print "Content type: text/html\n\n";
print "
FFA links page
";
if ($action eq "") { &main; }
if ($action eq "add") { &add; }
if ($action eq "preview") { &preview; }
if ($action eq "done") { &done; }
if ($action eq "") {
print "
ADD YOUR SITE"; }
#############################################
sub main {
open (DATA,"$log");
$data = ;
close (DATA);
@data = split(/&&/,$data);
foreach (@data) { ++$totalhits; }
if ($showhits eq "") { $showhits = $listhits; }
$showmin = $showhits - $listhits;
if ($showhits <= $totalhits) {
print "Sites $showmin through
$showhits out of $totalhits
"; } if ($showhits > $totalhits) { print "Sites $showmin through
$totalhits out of $totalhits
"; } if ($showmin >= $listhits) {
print " Prev
$listhits "; }
if ($totalhits >= $showhits) {
$showhitsplus = $showhits + $listhits;
print " Next
$listhits "; }
if ($action eq "") {
print "
ADD YOUR SITE"; } print "
";
$currenthits = 0;
foreach $i (@data) {
++$currenthits;
if ($currenthits > $showmin) {
if ($currenthits <= $showhits) {
($url,$title,$desc,$color,$grad,$angle,$text,$link) = split(/%%/,$i); $title =~ tr/_/ /;
$desc =~ tr/_/ /;
if ($url ne "") {
print "
"; } } } } }
#############################################
sub add {
print "Welcome, please fill out the form. This information will be what is displayed about your site in the FFA links page.