#!/usr/bin/perl ############################################################################## # Changes CGI Version 1.0 # # Copyright 1999 Walter Moore aperson@aperson.com # # Created 12/18/98 Last Modified 02/18/99 # # 1272286 Ontario Incorporated: http://www.aperson.com # ############################################################################## # COPYRIGHT NOTICE # # Copyright 1999 Walter Moore aperson@aperson.com # # Licenced to Divi.Com to use for any business purpose except resale. # ############################################################################## # ---------------------------------------------------------------------------- # This must reference the physical location of your changes.txt file # ---------------------------------------------------------------------------- $dbfile = "/home/www/aperson/registration/changes.txt"; # ---------------------------------------------------------------------------- # This is the frame you want link to be loaded in. Can use "_self" # ---------------------------------------------------------------------------- $thetarget = "Main"; # ---------------------------------------------------------------------------- # The maximum number of changes to show the client. # ---------------------------------------------------------------------------- $maxshow = 3; # ---------------------------------------------------------------------------- # Where should we send them if there are no changes. # ---------------------------------------------------------------------------- $nochanges = "http://aperson.com/nochanges.htm"; # ---------------------------------------------------------------------------- # The only changes you will want to do further is the header and trailer # sections. # ---------------------------------------------------------------------------- $date=""; $title=""; $describe=""; $tempcnt = 0; &get_parms; &get_header; &get_changes; &get_trailer; sub get_parms { @pairs = split(/&/, $ENV{'QUERY_STRING'}); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); if ($name eq "date") {$thedate = $value} if ($name eq "vis") {$thevisits = $value} if ($name eq "name") {$thename = $value} } } sub get_changes { open (FILE,"$dbfile") || die "Can't Open $dbfile: $!\n"; @LINES=; $SIZE=@LINES; close(FILE); print "\n"; for ($i=0;$i<=$SIZE;$i++) { $_=$LINES[$i]; @fields = split(/\|/, $_); $date = $fields[0]; $title = $fields[1]; $theloc = $fields[2]; $describe = $fields[3]; $tempdate = $date; $tempdate =~ s/\-//g; if ($thedate <= $tempdate) { print "\n"; $tempcnt = $tempcnt + 1; } if ($tempcnt eq $maxshow) {$i = $SIZE + 1} } print "
$date$title
$describe
\n"; if ($tempcnt < 1) {print "Location: $nochanges"} } sub get_header { print <<"(END HEADER HTML)"; Content-type: text/html Updates since your last visit: "; print "

 

Welcome back $thename
Here's a look at what's been updated since your last visit:
m_1.gif (88 bytes)
(END HEADER HTML) # ending body and html tag in trailer section. } sub get_trailer { print "
"; print "
"; print "
"; exit; }