#!/usr/bin/perl -w
###################################################################
# ScapeBook version 1.0
# Date written: 3/30/03 (completed as final production on this date
# Freeware compliments of http://dreamscapedesigns.cjb.net
# Written and designed by Dhoss of DreamScape designs
# This is freeware, however, if you choose to use this script, please take
# notice of the appending disclaimer and also keep this copyright intact.
# Email any and ALL problems to dhoss@dreamscapedesigns.cjb.net, or fill out
# our buglog form @ our website (http://dreamscapedesigns.cjb.net/bugs.pl?action=ScapeBook)
# Questons? Comments? Please email me at dhoss@dreamscapedesigns.cjb.net!
# Have fun with your new guestbook!!!
# -Dhoss
####################################################################
# DISCLAIMER
# Copyright Dreamscape designs 2003 version 1.0
# All problems arising from the use of this book that may cause
# damage or other undesired performances are not a liabity of
# Dreamscape designs, Devin J. Austin, or any other Dreamscape affiliates.
# This copyright must remain intact.
# Kindly ask for permission to sell the code for this guestbook , as I will
# gladly say yes. Written consent must be obtained before selling this code!
####################################################################
# Note to users:
# view readme.txt for extensive FAQ, installation, configuration, and tutorial help
#####################################################################
use CGI qw(-compile :all);
use strict;
use diagnostics;
#Comment out after first test drive!!!
#use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
#Variables
my $q = new CGI();
my $action = $q->param('action');
my $data_file = "data/data.dat";
my $t = $q->param('t');
#my $ipLogFile = "data/ip.dat";
my $page_title = "ScapeBook v1.0 --http://dreamscape.cjb.net--";
my $form_validate_script = "validate/form_data.js";
my $ipLog = 0;
#the following is all the arrays that are used in this script
#associative array for images
#img tag will now look like this:
#
##############################################################
my %images = ('logo', '../../img/logo.gif',
'submit', 'img/submit.jpg',
'addTo', 'img/add.jpg',
'adminBook', 'img/adminBook.jpg',
'previewEntry', 'img/prev.jpg',
'linkLogo', 'img/lilLogo.jpg',
'bg', 'img/bg.jpg');
#associative array for URLS
my %urls = ('DreamScape', 'http://dreamscape.cjb.net',
'admin', 'admin/admin.pl',
'sign_book', 'book.cgi?action=sign',
'preview_entry', 'book.cgi?action=preview',
'view_entries', 'book.cgi?action=view_entry',
'report_bug', 'http://dreamscape.cjb.net/bugs.cgi?action=ScapeBook',
'page_style_sheet', 'css/book.css',
'cgi_url', 'book.cgi');
# Initialize list of months
my @month = ("January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December");
#Okay, not an array, but it goes with the date procedure
# Get the date and time information
my ($Seconds, $Minutes, $Hours, $DayInMonth, $Month, $ShortYear, $DayOfWeek, $DayOfYear, $IsDST);
($Seconds, $Minutes, $Hours, $DayInMonth, $Month, $ShortYear, $DayOfWeek, $DayOfYear, $IsDST) = localtime(time);
# Fix the year to keep it Y2K compliant, as described in 'Perl and Y2K'
# http://perl.about.com/library/weekly/aa070299.htm
my $Year = $ShortYear + 1900;
my $EntryDate = "$month[$Month] $DayInMonth, $Year";
#################################################
#init subs for page
$| = 1;
main();
sub main {
write_to_file() if ($q->param('do_it') eq 's');
print_page() if ($q->param('action') eq '');
print_form() if ($action eq 'sign');
}
if ($action eq 'view_entry') {
print_main();
}
sub print_main {
print qq(
| Guestbook functions: |
|
|