#!/usr/local/bin/perl $| = 1; $demo="off"; $version = "n300004"; # September 1st 2001 $bversion = "b3.4"; &subdirectory; &ver204; &cookie_vars; #basic cookie variable $salt = "active"; # to help crypt $enc = crypt(active, $salt); # set default password $location_of_lock_file = "guestbook.lock"; ## thanks to extropia.com unless (-e "$guestbook_data_name") { @months = ("January","February","March","April","May","June","July","August","September","October","November","December"); } &startup; &open_prefs; &GetDate; $now = &amqdate($itemdate); &check_update; &check_new_files; $alignment = "center" if ($alignment eq ""); if ($ENV{'REQUEST_METHOD'} eq "GET") { $buffer = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; $name =~ s/_/ /g; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; } $action = $FORM{'action'}; $direct = $FORM{'direct'}; @old_words = split (/\,/, $bad_words); $added_words = "skcuf daehtihs etihs tihs stihs tawt reggin rekcufrehtom rekcuf tnuc rekcus kcoc dratsab kcuf gnikcuf sknaw knaw stnuc sdratsab sreknaw reknaw elohesra selohesra esra sesra"; @letters = split (//, $added_words) ; $reverse = join ("", reverse @letters); @new_words = split (/ /, $reverse); @words = (@new_words, @old_words); @anti_ips = split (/\,/, $anti_ips); $ipoops = "no"; $RemoteHost = $ENV{'REMOTE_HOST'}; if ((!$RemoteHost) || ($RemoteHost =~ m!^\d+\.\d+\.\d+\.\d+$!)) { if ($ENV{'REMOTE_ADDR'} =~ m!^(\d+)\.(\d+)\.(\d+)\.(\d+)$!) { $RemoteHost = (gethostbyaddr(pack('C4',$1,$2,$3,$4),2))[0] || $ENV{'REMOTE_ADDR'}; } $RemoteHost =~ tr[A-Z][a-z]; } foreach (@anti_ips) { next unless $_; $ipoops = "yes" if ($RemoteHost =~ m!$_!); $ipoops = "yes" if ($ENV{'REMOTE_ADDR'} =~ m!$_!); } sub end { &basic_header; print qq~
$title

$TXT_blocked_IP ~; exit; } &actions; ########### read sub read { open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @datalist = (); @data = (); @data = ; close(USER_FILE); foreach $row (@data) { @fields = split (/\|/, $row); unless (($fields[10] eq "del") || ($fields[15] eq "waiting")) { push (@datalist, $row); } } $number_of_items = @datalist; if ($order eq "reversed") { @data_ordered = reverse(@datalist); } else { @data_ordered = @datalist; } ############## &content; &main_header; &active_header if $active_header eq "on"; print qq~
~; &user_image if $user_image eq "yes"; &title if $use_title eq "on"; &user_html if $use_user_html eq "yes"; &menu; &no_of_items_display if $show_no_of_items eq "yes"; $count = 1; $grouped = 0; $no_displayed = int($no_displayed); # fix any funny numbers entered by user # fix any numbers entered less than one if ($no_displayed <1) { $no_displayed = 1; } $start_number = $FORM{'start_number'}; $new_start_number = ($start_number + $no_displayed); $old_start_number = ($start_number - $no_displayed); $startplus = $start_number +1; # print qq~ ~; unless ($old_start_number < 0) { print qq~ $left_bracket$TXT_previous$right_bracket ~; } &show_number_menu unless ($number_of_items <($no_displayed+1)); unless ($new_start_number > ($number_of_items -1 )) { print qq~ $left_bracket$TXT_next$right_bracket
~; } if (($new_start_number > ($number_of_items -1 )) && ($number_of_items >($no_displayed))) { print qq~
~; } print qq~ ~; if ($new_start_number < $number_of_items) { print qq~ $TXT_viewing_items$startplus$TXT_to$new_start_number$TXT_after_last_number ~; } else { if ($startplus == $number_of_items) { print qq~ $TXT_viewing_item$startplus$TXT_after_last_number1
~; } else { print qq~ $TXT_viewing_items$startplus$TXT_to$number_of_items$TXT_after_last_number ~; } } foreach $row (@data_ordered) { @fields = split (/\|/, $row); $grouped++; if (($grouped > ($start_number)) && ($grouped < ($start_number + $no_displayed + 1))) { &main_table_results; } # end if number is right } # end for each row print qq~ ~; if ($use_hr_image eq "yes") { print "
"; } unless ($old_start_number < 0) { print qq~ $left_bracket$TXT_previous$right_bracket ~; } &show_number_menu unless ($number_of_items <($no_displayed+1)); unless ($new_start_number > ($number_of_items -1 )) { print qq~ $left_bracket$TXT_next$right_bracket ~; } &search_form; &user_html_footer if $use_user_html_footer eq "yes"; print qq~ ~; &inter_footer; print qq~
~; } # end sub read ############ write sub write { ###### anti-spam bit if ($anti_spam eq "on") { $multiple_ip = "no"; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); foreach $row (@data) { @fields = split (/\|/, $row); if (($ENV{'REMOTE_ADDR'} eq $fields[7]) && ($fields[9] eq $revdate)) { $multiple_ip = "yes"; } } if ($multiple_ip eq "yes") { &content; print qq~ $title

Active Guestbook

$TXT_has_been_added

~; &inter_footer; exit; } } ###### if ($access eq "restricted") { $add_an_item_password = $FORM{'requiredadd_an_item_password'}; if ($add_an_item_password ne $pass_restricted) { &content; &main_header; &active_header if $active_header eq "on"; print qq~
~; &user_image if $user_image eq "yes"; &title if $use_title eq "on"; &user_html if $use_user_html eq "yes"; print qq~ $TXT_incorrect_password
~; &user_html_footer if $use_user_html_footer eq "yes"; exit; } } $full_name = $FORM{'requiredfull_name'}; $item = $FORM{'requireditem'}; $sender_email = $FORM{'sender_email'}; $news_item_title = $FORM{'requirednews_item_title'}; $url = $FORM{'url'}; $url =~ s/http\:\/\///i; if ($sender_email) { &check_address_for_mistakes; } unless ($action eq "post_preview") { $item =~ s/<([^>]|\n)*>//g if $allow_html eq "no"; } $full_name =~ s/<([^>]|\n)*>//g; $news_item_title =~ s/<([^>]|\n)*>//g; $number_of_words = @words_in_item = split(/ /,$item); $item =~ s/\|//g; $news_item_title =~ s/\|//g; $url =~ s/\|//g; $full_name =~ s/\|//g; $sender_email =~ s/\|//g; $item =~ s/\r\n/
/g; $item =~ s/\r/ /g; $item =~ s/\n/
/g; $item =~ s/(
)+/
/g; $item =~ s/\s+/ /g; ##### block multiple posts $multiple_post = "no"; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); foreach $row (@data) { @fields = split (/\|/, $row); if (($full_name eq $fields[1]) && ($fields[2] eq $item)) { $multiple_post = "yes"; } } if ($multiple_post eq "yes") { &thanks; exit; } if ($number_of_words > $max_length) { &basic_header; print qq~
$title

$TXT_too_many_words ~; exit; } # check bad words $oops = "no"; foreach (@words) { if (($item =~ /\b$_\b/i) || ($full_name =~ /\b$_\b/i) || ($sender_email =~ /\b$_\b/i) || ($news_item_title =~ /\b$_\b/i) || ($url =~ /\b$_\b/i)) { $oops = "yes"; last; } } if ($oops eq "yes") { &basic_header; print qq~

$title

$TXT_disallowed_word ~; exit; } # end check bad words # check for blocked IP if ($ipoops eq "yes") { &basic_header; print qq~

$title

$TXT_blocked_IP ~; exit; } # end check for blocked IP if ($action eq "preview") { &preview; } &get_file_lock("$location_of_lock_file"); open(NUMBER,"$counter_name") || &oops('$counter_name'); $num = ; close(NUMBER); $plus = $num+1; open (NUMBER,">$counter_name"); print NUMBER "$plus"; close(NUMBER); open(DATABASE,">>$guestbook_data_name"); if ($moderated eq "yes") { print DATABASE "$plus|$full_name|$item|$mydate|$sender_email|$news_item_title||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url||||waiting||||||||||||||||\n"; } else { print DATABASE "$plus|$full_name|$item|$mydate|$sender_email|$news_item_title||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url||||||||||||||||||||\n"; } close(DATABASE); &backup_to_dir; &release_file_lock("$location_of_lock_file"); if ($send_email_to_admin eq "on") { unless (-e $mail_path) { &content; print qq~ The path to the mail path which you have given as - $mail_path - in the Control Panel does not seem to exist.

Please check and change.

In the short term you can turn off the email options and the program will run okay. ~; exit; } open (MAIL, "|$mail_path $admin_email"); print MAIL "To: $admin_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: Guestbook item\n\n"; if ($moderated eq "yes") { print MAIL "You have a new item in your guestbook which requires your approval. You can approve this item in the Item Manager section of the Active Guestbook Control Panel.\n\n"; } else { print MAIL "You have a new item in your guestbook\n\n"; } $converted_item = $item; $converted_item =~ s/
/\n/g; print MAIL "=========================\n"; print MAIL "From: $full_name\n"; if ($sender_email) { print MAIL "Email: $sender_email\n"; } if ($url) { print MAIL "URL: $url\n"; } if ($news_item_title) { print MAIL "Title: $news_item_title\n"; } print MAIL "$converted_item\n\n"; print MAIL "=========================\n"; close(MAIL); } if (($sender_email) && ($send_email_to_sender eq "on")) { open (MAIL, "|$mail_path $sender_email"); print MAIL "To: $sender_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: $thanks_title\n\n"; print MAIL "$thank_you\n\n"; if ($thanks_include_item eq "on") { $converted_item = $item; $converted_item =~ s/
/\n/g; print MAIL "=========================\n"; print MAIL "Your item:\n\n"; print MAIL "$converted_item\n\n"; print MAIL "=========================\n"; } close(MAIL); } &thanks; } sub convert { } sub add { if ($access eq "private") { &seek_cook; } else { &end if ($ipoops eq "yes"); } &content; &main_header; &active_header if $active_header eq "on"; print qq~ print qq~
~; &user_image if $user_image eq "yes"; &title if $use_title eq "on"; &user_html if $use_user_html eq "yes"; &menu; if ($access eq "restricted") { print qq~
$TXT_access_is_limited
~; } if ($table_width =~ /\%/) { $table_width_per = $table_width; $table_width_per =~ s/\%//gi; $table_width_per = $table_width_per/3; $table_width_per = ($table_width_per . "%"); $col1 = $table_width_per; } else { $col1 = ($table_width/3); } #########

~; if ($access eq "restricted") { print qq~ ~; } print qq~
Password $TXT_required
$TXT_your_name $TXT_required
$TXT_news_item_title $TXT_required
$TXT_your_item $TXT_required
$TXT_your_email_address
$TXT_your_web_page_address
$TXT_if_you_have_one
~; &user_html_footer if $use_user_html_footer eq "yes"; print qq~ ~; print "\n\n"; } # end sub add ########## startup sub startup { unless (-e "$guestbook_backups_directory") { mkdir ($guestbook_backups_directory, 0777); chmod(0777, "$guestbook_backups_directory"); open(BAK,">./$guestbook_backups_directory/undo_restore.bak"); close(BAK); } unless (-e "$guestbook_files_directory") { mkdir ($guestbook_files_directory, 0777); chmod(0777, "$guestbook_files_directory"); } ########## months unless (-e "$months_name") { open(MONTHS,">$months_name"); chmod(0777, "$months_name"); print MONTHS "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember\n"; close(MONTHS); } unless (-e "$months_bak_name") { open(MONTHS,">$months_bak_name"); chmod(0777, "$months_bak_name"); print MONTHS "January\nFebruary\nMarch\nApril\nMay\nJune\nJuly\nAugust\nSeptember\nOctober\nNovember\nDecember\n"; close(MONTHS); } ############ added for version 1.9 # create user and factory style defaults and style unless (-e "$user_style_name") { open(STYLE,">$user_style_name"); chmod(0777, "$user_style_name"); print STYLE " \n"; print STYLE "\n"; close(STYLE); } #################### unless (-e "$senddate_name") { open(UPDATE1,">$senddate_name"); chmod(0777, "$senddate_name"); print UPDATE1 "$now"; close(UPDATE1); } unless (-e "$update_name") { open(UPDATE,">$update_name"); chmod(0777, "$update_name"); print UPDATE "$revdate"; close(UPDATE); } unless (-e "$user_html_name") { open(USER_HTML,">$user_html_name"); chmod(0777, "$user_html_name"); print USER_HTML "You can type some html here which will appear just above the menu.
"; close(USER_HTML); } unless (-e "$user_html_footer_name") { open(USER_HTML,">$user_html_footer_name"); chmod(0777, "$user_html_footer_name"); print USER_HTML "You can type some html here which will appear at the bottom of your page."; close(USER_HTML); } unless (-e "$user_default_html_name") { open(USER_DEFAULT_HTML,">$user_default_html_name"); chmod(0777, "$user_default_html_name"); print USER_DEFAULT_HTML "You can type some html here which will appear just above the menu.
"; close(USER_DEFAULT_HTML); } unless (-e "$user_default_html_footer_name") { open(USER_DEFAULT_HTML,">$user_default_html_footer_name"); chmod(0777, "$user_default_html_footer_name"); print USER_DEFAULT_HTML "You can type some html here which will appear at the bottom of your page."; close(USER_DEFAULT_HTML); } unless (-e "$thank_you_name") { open(THANKS,">$thank_you_name"); chmod(0777, "$thank_you_name"); print THANKS "Thank you very much for adding an item to our guestbook. Your support is much appreciated.\n\n"; print THANKS "Regards\n"; print THANKS "All at active-scripts.net\n\n"; print THANKS "=================================\n"; close(THANKS); } unless (-e "$thank_you_user_default_name") { open(THANKS,">$thank_you_user_default_name"); chmod(0777, "$thank_you_user_default_name"); print THANKS "Thank you very much for adding an item to our guestbook. Your support is much appreciated.\n\n"; print THANKS "Regards\n"; print THANKS "All at active-scripts.net\n\n"; print THANKS "=================================\n"; close(THANKS); } unless (-e "$tempcolprefs_name") { open(COLFILE,">$tempcolprefs_name"); chmod(0777, "$tempcolprefs_name"); close(COLFILE); } unless (-e "$counter_name") { open(COUNTER,">>$counter_name"); chmod(0777, "$counter_name"); print COUNTER "1000100"; close(COUNTER); chmod(0777, "$counter_name"); } unless (-e "$active_name") { if (&GetCookies('activea')) { $coolkiepass = $Cookies{'activea'}; open(ACTIVE,">>$active_name"); chmod(0777, "$active_name"); print ACTIVE "$coolkiepass"; close(ACTIVE); } else { open(ACTIVE,">>$active_name"); chmod(0777, "$active_name"); print ACTIVE "$enc"; close(ACTIVE); } } ############# # language prefs added version 1.9 unless (-e "$langprefs_name") { open(PREFS,">>$langprefs_name"); chmod(0777, "$langprefs_name"); print PREFS "TXT_added_by= added by =\n"; print PREFS "TXT_incorrect_password=Incorrect password. Please go back and edit.=\n"; print PREFS "TXT_access_is_limited=Access to this newboard is limited. Please use your password to add a message.=\n"; print PREFS "TXT_add_a_message=Add a message=\n"; print PREFS "TXT_previous=<<<=\n"; print PREFS "TXT_next=>>>=\n"; print PREFS "TXT_there_is_now=There is now =\n"; print PREFS "TXT_there_are_now=There are now =\n"; print PREFS "TXT_items_in_our_guestbook= items in our guestbook.=\n"; print PREFS "TXT_item_in_our_guestbook= item in our guestbook.=\n"; print PREFS "TXT_viewing_item=Viewing item =\n"; print PREFS "TXT_viewing_items=Viewing items =\n"; print PREFS "TXT_to= to =\n"; print PREFS "TXT_after_last_number=.=\n"; print PREFS "TXT_after_last_number1=.=\n"; print PREFS "TXT_you_can_search_this_guestbook_by=You can search this guestbook by:=\n"; print PREFS "TXT_searchitem=Item :=\n"; print PREFS "TXT_searchname=Name :=\n"; print PREFS "TXT_searchall=All :=\n"; print PREFS "TXT_searchsearch=Search=\n"; print PREFS "TXT_searchtext=Please type some text:=\n"; print PREFS "TXT_back_to_guestbook=Back to guestbook=\n"; print PREFS "TXT_your_name=Your name=\n"; print PREFS "TXT_your_item=Your item=\n"; print PREFS "TXT_required=(required)=\n"; print PREFS "TXT_news_item_title=News item title=\n"; print PREFS "TXT_your_email_address=Your email address=\n"; print PREFS "TXT_your_web_page_address=Your web page address=\n"; print PREFS "TXT_if_you_have_one=(if you have one)=\n"; print PREFS "TXT_continue=Continue=\n"; print PREFS "TXT_these_are_the=These are the details you have given.=\n"; print PREFS "TXT_if_correct=If they are correct, please click Continue.=\n"; print PREFS "TXT_if_not=If not, please =\n"; print PREFS "TXT_go_back=go back =\n"; print PREFS "TXT_and_edit=and edit.=\n"; print PREFS "TXT_none_given=None given=\n"; print PREFS "TXT_has_been_added=Thanks. Your item has been added to our guestbook.=\n"; print PREFS "TXT_has_been_added_moderated=Thanks. Your item has been sent to our webmaster and will be added shortly.=\n"; print PREFS "TXT_search_results=Search results=\n"; print PREFS "TXT_back_search_again=Back to Guestbook/Search again=\n"; print PREFS "TXT_one_match=One guestbook item matches your search criteria.=\n"; print PREFS "TXT_no_match=Sorry, no items in our guestbook match your search criteria.=\n"; print PREFS "TXT_more_matches_1=There are =\n"; print PREFS "TXT_more_matches_2= guestbook items that match your search criteria.=\n"; print PREFS "TXT_please_fill_in=Please fill in all required fields.=\n"; print PREFS "TXT_please_go_back_and_edit=Please go back and edit=\n"; print PREFS "TXT_no_dot_at_start=Email addresses don't start with dots or @ signs.=\n"; print PREFS "TXT_no_www_at_start=Email addresses don't start with www. That's a web page address.=\n"; print PREFS "TXT_no_squiggles_in_domain=There should not be any underlines or squiggles or hashes after the @ in your email address.=\n"; print PREFS "TXT_only_one_at=There should be one (and only one) @ in your email address.=\n"; print PREFS "TXT_no_dots_next=You are not allowed to have dots next to each other or next to @ sign in your email address.=\n"; print PREFS "TXT_wrong_end=All email addresses end in a dot and some letters (such as .com, .net, .uk, .ac etc.).=\n"; print PREFS "TXT_too_many_words=Your item contains too many words. Please go back and edit.=\n"; print PREFS "TXT_disallowed_word=Your item contains a disallowed word. Please go back and edit.=\n"; print PREFS "TXT_blocked_IP=This service is currently unavailable.=\n"; close(PREFS); } ######## create and write FACTORY DEFAULT $langprefs_backup_name unless (-e "$langprefs_backup_name") { open(FILE,"$langprefs_name"); @lines = ; close(FILE); open(BAK,">$langprefs_backup_name"); chmod(0777, "$langprefs_backup_name"); foreach $line (@lines) { print BAK "$line"; } close(BAK); } ############### unless (-e "$prefs_name") { open(PREFS,">>$prefs_name"); chmod(0777, "$prefs_name"); print PREFS "access=private=\n"; print PREFS "textfontface=Arial=\n"; print PREFS "textfontsize=2=\n"; print PREFS "alignment=center=\n"; print PREFS "title=Active Guestbook=\n"; print PREFS "show_line=no=\n"; print PREFS "pass_restricted=guest=\n"; print PREFS "home_page=http://active-scripts.net/=\n"; print PREFS "show_home_page_link=yes=\n"; print PREFS "home_page_target=_top=\n"; print PREFS "home_page_title=Active Scripts=\n"; print PREFS "order=reversed=\n"; print PREFS "border_size=0=\n"; print PREFS "mail_path=/usr/lib/sendmail=\n"; print PREFS "admin_email=webmaster\@active-scripts.net=\n"; print PREFS "send_email_to_admin=off=\n"; print PREFS "send_email_to_sender=off=\n"; print PREFS "thanks_title=Active Scripts Guestbook=\n"; print PREFS "thanks_include_item=off=\n"; print PREFS "anti_ips=111.111.111.3,server.isp.com=\n"; print PREFS "bad_words=wankle,rotary,engine=\n"; print PREFS "no_displayed=5=\n"; print PREFS "max_length=400=\n"; print PREFS "max=300=\n"; print PREFS "use_hr_image=no=\n"; print PREFS "hr_image=http://www.active-scripts.net/line.gif=\n"; print PREFS "max=300=\n"; print PREFS "days_to_delete=1000=\n"; print PREFS "days_to_trash=365=\n"; print PREFS "days_to_delete_backup_files=60=\n"; print PREFS "mail_backup_to_admin=no=\n"; print PREFS "mail_admin_backups_interval=monthly=\n"; print PREFS "mail_admin_backups_day=1=\n"; print PREFS "mail_admin_backups_month=1=\n"; print PREFS "anti_spam=off=\n"; print PREFS "allow_html=no=\n"; print PREFS "active_header=on=\n"; print PREFS "use_title=off=\n"; print PREFS "show_no_of_items=yes=\n"; print PREFS "use_mailto=yes=\n"; print PREFS "web_enabled=yes=\n"; print PREFS "user_image=no=\n"; print PREFS "user_image_url==\n"; print PREFS "use_user_html=no=\n"; print PREFS "use_user_html_footer=no=\n"; print PREFS "table_width=600=\n"; print PREFS "usebackgroundimage=yes=\n"; print PREFS "backgroundimage=http://active-scripts.net/guestbook_back.jpg=\n"; print PREFS "table_width=600=\n"; print PREFS "web_comment=Webmaster comments=\n"; print PREFS "style=on=\n"; print PREFS "moderated=no=\n"; print PREFS "field_length=40=\n"; print PREFS "left_bracket==\n"; print PREFS "middle_bracket=:=\n"; print PREFS "right_bracket==\n"; close(PREFS); } ######## create and write FACTORY DEFAULT $prefs_backup_name unless (-e "$prefs_backup_name") { open(FILE,"$prefs_name"); @lines = ; close(FILE); open(BAK,">$prefs_backup_name"); chmod(0777, "$prefs_backup_name"); foreach $line (@lines) { print BAK "$line"; } close(BAK); } ######## create and write USER DEFAULT $prefs_backup_name unless (-e "$userprefs_backup_name") { open(USERDEFAULT,">$userprefs_backup_name"); chmod(0777, "$userprefs_backup_name"); foreach $line (@lines) { print USERDEFAULT "$line"; } close(USERDEFAULT); } ######## create and write COLOR preferences unless (-e "$colprefs_name") { open(COLPREFS,">>$colprefs_name"); chmod(0777, "$colprefs_name"); print COLPREFS "trans_search=yes=\n"; print COLPREFS "trans_item_header=no=\n"; print COLPREFS "trans_item_body=yes=\n"; print COLPREFS "backcolor=#ffffff=\n"; print COLPREFS "data_color1=#0099ff=\n"; print COLPREFS "data_color2=#000000=\n"; print COLPREFS "textdata_color1=#ffffff=\n"; print COLPREFS "textdata_color2=#ffffff=\n"; print COLPREFS "table_color1=#fffff0=\n"; print COLPREFS "table_color2=#ffffd0=\n"; print COLPREFS "texttable_color1=#000000=\n"; print COLPREFS "texttable_color2=#000000=\n"; print COLPREFS "backcolor=#ffffff=\n"; print COLPREFS "link=#000000=\n"; print COLPREFS "vlink=#000000=\n"; print COLPREFS "alink=#000000=\n"; print COLPREFS "text=#000000=\n"; print COLPREFS "commentcolor=#ff0000=\n"; print COLPREFS "searchcolor=#eeeeee=\n"; close(COLPREFS); } ######## create and write FACTORY DEFAULT COLOR preferences unless (-e "$colprefs_backup_name") { open(FILE,"$colprefs_name"); @lines = ; close(FILE); open(BAK,">$colprefs_backup_name"); chmod(0777, "$colprefs_backup_name"); foreach $line (@lines) { print BAK "$line"; } close(BAK); } ######## create and write USER DEFAULT COLOR preferences unless (-e "$usercolprefs_backup_name") { open(USERDEFAULT,">$usercolprefs_backup_name"); chmod(0777, "$usercolprefs_backup_name"); foreach $line (@lines) { print USERDEFAULT "$line"; } close(USERDEFAULT); } unless (-e "$guestbook_data_name") { chmod(0777, "$prefs_name"); chmod(0777, "$colprefs_name"); &open_prefs; umask 000; open(TEMP,">>$guestbook_data_name"); print TEMP "1000001|Sample user|Great guestbook.|$mydate||Sample news item|||$now|$revdate||||||||||||||||||||||\n"; for ($w=2;$w<10;$w++) { print TEMP "100000$w|Sample user $w|Sample item $w.|$mydate||Sample news item|||$now|$revdate||||||||||||||||||||||\n"; } print TEMP "1000030|Active Scripts |Well done. You have successfully installed Active Guestbook.

"; print TEMP "Once you have browsed the features in the public part of the guestbook, you will want to access the Active Guestbook Control Panel which allows you to manage your guestbook. To access the Control Panel, you will normally need to use a password. The default password is the word active in lower case but you can change it to anything you like."; print TEMP "

The first thing you should do once you visit the Control Panel is to add the page to your Bookmarks/Favorites so that you can easily get there in the future.

You can now go to the Control Panel by clicking here.

"; print TEMP "You will of course want to delete all these sample items once you get things set up the way you want.|$mydate|anthony\@active-scripts.net|Congratulations|||$now|$revdate||www.active-scripts.net||||||||||||||||||||\n"; close(TEMP); chmod(0777, "$guestbook_data_name"); &finish_start; exit; } } # end startup sub finish_start { &content; print qq~ $title

Active Guestbook Installation Manager
Active Guestbook has been successfully installed and all support files have been generated.
Click here to view the guestbook ~; } ############ Get Date sub GetDate { ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $bakday = $mday; if ($sec < 10) { $sec = "0$sec"; } if ($min < 10) { $min = "0$min"; } if ($hour < 10) { $hour = "0$hour"; } # if ($mon < 10) { $mon = "0$mon"; } if ($mday < 10) { $mday = "0$mday"; } $month = ($mon + 1); if ($month < 10) { $month = "0$month"; } @weekdaysbak = ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); $today = "$year"."$month"."$mday"; $bugyear = ($year + 1900); $bugtoday = "$bugyear"."$month"."$mday"; $itemdate = "$mday"."/"."$month"."/"."$bugyear"; $mydate = "$mday"." "."$months[$mon]"." "."$bugyear"; $amqdate = "$mday"."/"."$month"."/"."$bugyear"; $revdate = "$bugyear"."$month"."$mday"; $housetoday1 = "$bugyear"."$month"."$mday"; } ### sub get_file_lock { local ($lock_file) = @_; local ($endtime); $endtime = 2; $endtime = time + $endtime; while (-e $lock_file && time < $endtime) { sleep(2); } open(LOCK_FILE, ">$lock_file"); } sub release_file_lock { local ($lock_file) = @_; close(LOCK_FILE); unlink($lock_file); } ################# preferences sub edit_prefs { &seek_cook; &get_file_lock("$location_of_lock_file"); open(FILE,"$prefs_name"); @lines = ; close(FILE); open(FILE,">$prefs_name"); print FILE "pass_restricted=$FORM{'pass_restricted'}=\n"; print FILE "access=$FORM{'access'}=\n"; print FILE "textfontface=$FORM{'textfontface'}=\n"; print FILE "textfontsize=$FORM{'textfontsize'}=\n"; print FILE "title=$FORM{'title'}=\n"; print FILE "show_line=$FORM{'show_line'}=\n"; print FILE "alignment=$FORM{'alignment'}=\n"; print FILE "border_size=$FORM{'border_size'}=\n"; print FILE "max=$FORM{'max'}=\n"; print FILE "home_page=$FORM{'home_page'}=\n"; print FILE "show_home_page_link=$FORM{'show_home_page_link'}=\n"; print FILE "home_page_target=$FORM{'home_page_target'}=\n"; print FILE "order=$FORM{'order'}=\n"; print FILE "mail_path=$FORM{'mail_path'}=\n"; print FILE "admin_email=$FORM{'admin_email'}=\n"; print FILE "send_email_to_admin=$FORM{'send_email_to_admin'}=\n"; print FILE "send_email_to_sender=$FORM{'send_email_to_sender'}=\n"; print FILE "home_page_title=$FORM{'home_page_title'}=\n"; print FILE "no_displayed=$FORM{'no_displayed'}=\n"; print FILE "max_length=$FORM{'max_length'}=\n"; print FILE "anti_spam=$FORM{'anti_spam'}=\n"; print FILE "days_to_delete=$FORM{'days_to_delete'}=\n"; print FILE "days_to_trash=$FORM{'days_to_trash'}=\n"; print FILE "days_to_delete_backup_files=$FORM{'days_to_delete_backup_files'}=\n"; print FILE "mail_admin_backups_interval=$FORM{'mail_admin_backups_interval'}=\n"; print FILE "mail_admin_backups_day=$FORM{'mail_admin_backups_day'}=\n"; print FILE "mail_admin_backups_month=$FORM{'mail_admin_backups_month'}=\n"; print FILE "allow_html=$FORM{'allow_html'}=\n"; print FILE "active_header=$FORM{'active_header'}=\n"; print FILE "use_title=$FORM{'use_title'}=\n"; print FILE "show_no_of_items=$FORM{'show_no_of_items'}=\n"; print FILE "use_mailto=$FORM{'use_mailto'}=\n"; print FILE "web_enabled=$FORM{'web_enabled'}=\n"; print FILE "use_hr_image=$FORM{'use_hr_image'}=\n"; print FILE "hr_image=$FORM{'hr_image'}=\n"; print FILE "user_image=$FORM{'user_image'}=\n"; print FILE "user_image_url=$FORM{'user_image_url'}=\n"; print FILE "use_user_html=$FORM{'use_user_html'}=\n"; print FILE "use_user_html_footer=$FORM{'use_user_html_footer'}=\n"; print FILE "table_width=$FORM{'table_width'}=\n"; print FILE "usebackgroundimage=$FORM{'usebackgroundimage'}=\n"; print FILE "backgroundimage=$FORM{'backgroundimage'}=\n"; print FILE "mail_backup_to_admin=$FORM{'mail_backup_to_admin'}=\n"; print FILE "thanks_title=$FORM{'thanks_title'}=\n"; print FILE "thanks_include_item=$FORM{'thanks_include_item'}=\n"; print FILE "web_comment=$FORM{'web_comment'}=\n"; print FILE "style=$FORM{'style'}=\n"; print FILE "moderated=$FORM{'moderated'}=\n"; print FILE "field_length=$FORM{'field_length'}=\n"; print FILE "left_bracket=$FORM{'left_bracket'}=\n"; print FILE "middle_bracket=$FORM{'middle_bracket'}=\n"; print FILE "right_bracket=$FORM{'right_bracket'}=\n"; open(USER_FILE,">$user_html_name"); print USER_FILE "$FORM{'user_html'}"; close(USER_FILE); open(USER_FILE,">$user_html_footer_name"); print USER_FILE "$FORM{'user_html_footer'}"; close(USER_FILE); open(THANKS,">$thank_you_name"); print THANKS "$FORM{'thank_you'}"; close(THANKS); open(UDS,">$user_style_name"); print UDS "$FORM{'user_style'}"; close(UDS); $bad = $FORM{'bad_words'}; $bad =~ s/\s\s/ /g; $bad =~ s/\s\s/ /g; $bad =~ s/\s/,/g; $bad =~ s/\,\,/,/g; print FILE "bad_words=$bad=\n"; $bad1 = $FORM{'anti_ips'}; $bad1 =~ s/\s\s/ /g; $bad1 =~ s/\s\s/ /g; $bad1 =~ s/\s/,/g; $bad1 =~ s/\,\,/,/g; print FILE "anti_ips=$bad1=\n"; close(FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Item Editor

Standard preferences updated. ~; &inter_footer; } ########## open prefs sub open_prefs { open(FILE,"$prefs_name"); @LINES = ; close(FILE); open(COLFILE,"$colprefs_name"); @COLLINES = ; close(COLFILE); open(LANGFILE,"$langprefs_name"); @LANGLINES = ; close(LANGFILE); open(MONTHS,"$months_name"); @monthlist = ; close(MONTHS); @months = (); foreach $monthss (@monthlist) { $monthss =~ s/\n//g; $monthss =~ s/\r//g; push (@months, $monthss); } foreach $LANGLINE (@LANGLINES) { @langterms = split(/=/,$LANGLINE); $LANGPREFS{$langterms[0]} = $langterms[1]; } foreach $COLLINE (@COLLINES) { @colterms = split(/=/,$COLLINE); $COLPREFS{$colterms[0]} = $colterms[1]; } $brackets_exist = "no"; foreach $LINE (@LINES) { #upgrade if ($LINE =~ /left_bracket/gi) { $brackets_exist = "yes"; } # end upgrade @terms = split(/=/,$LINE); $PREFS{$terms[0]} = $terms[1]; } #upgrade # end upgrade ################ $TXT_added_by = $LANGPREFS{'TXT_added_by'}; $TXT_incorrect_password = $LANGPREFS{'TXT_incorrect_password'}; $TXT_access_is_limited = $LANGPREFS{'TXT_access_is_limited'}; $TXT_add_a_item = $LANGPREFS{'TXT_add_a_item'}; $TXT_search = $LANGPREFS{'TXT_search'}; $TXT_previous = $LANGPREFS{'TXT_previous'}; $TXT_next = $LANGPREFS{'TXT_next'}; $TXT_there_is_now = $LANGPREFS{'TXT_there_is_now'}; $TXT_there_are_now = $LANGPREFS{'TXT_there_are_now'}; $TXT_items_in_our_guestbook = $LANGPREFS{'TXT_items_in_our_guestbook'}; $TXT_item_in_our_guestbook = $LANGPREFS{'TXT_item_in_our_guestbook'}; $TXT_viewing_item = $LANGPREFS{'TXT_viewing_item'}; $TXT_viewing_items = $LANGPREFS{'TXT_viewing_items'}; $TXT_to = $LANGPREFS{'TXT_to'}; $TXT_after_last_number = $LANGPREFS{'TXT_after_last_number'}; $TXT_after_last_number1 = $LANGPREFS{'TXT_after_last_number1'}; $TXT_you_can_search_this_guestbook_by = $LANGPREFS{'TXT_you_can_search_this_guestbook_by'}; $TXT_searchitem = $LANGPREFS{'TXT_searchitem'}; $TXT_searchname = $LANGPREFS{'TXT_searchname'}; $TXT_searchall = $LANGPREFS{'TXT_searchall'}; $TXT_searchsearch = $LANGPREFS{'TXT_searchsearch'}; $TXT_searchtext = $LANGPREFS{'TXT_searchtext'}; $TXT_back_to_guestbook = $LANGPREFS{'TXT_back_to_guestbook'}; $TXT_your_name = $LANGPREFS{'TXT_your_name'}; $TXT_your_item = $LANGPREFS{'TXT_your_item'}; $TXT_required = $LANGPREFS{'TXT_required'}; $TXT_news_item_title = $LANGPREFS{'TXT_news_item_title'}; $TXT_your_email_address = $LANGPREFS{'TXT_your_email_address'}; $TXT_your_web_page_address = $LANGPREFS{'TXT_your_web_page_address'}; $TXT_if_you_have_one = $LANGPREFS{'TXT_if_you_have_one'}; $TXT_continue = $LANGPREFS{'TXT_continue'}; $TXT_these_are_the = $LANGPREFS{'TXT_these_are_the'}; $TXT_if_correct = $LANGPREFS{'TXT_if_correct'}; $TXT_if_not = $LANGPREFS{'TXT_if_not'}; $TXT_go_back = $LANGPREFS{'TXT_go_back'}; $TXT_and_edit = $LANGPREFS{'TXT_and_edit'}; $TXT_none_given = $LANGPREFS{'TXT_none_given'}; $TXT_has_been_added = $LANGPREFS{'TXT_has_been_added'}; $TXT_has_been_added_moderated = $LANGPREFS{'TXT_has_been_added_moderated'}; $TXT_back_search_again = $LANGPREFS{'TXT_back_search_again'}; $TXT_one_match = $LANGPREFS{'TXT_one_match'}; $TXT_no_match = $LANGPREFS{'TXT_no_match'}; $TXT_more_matches_1 = $LANGPREFS{'TXT_more_matches_1'}; $TXT_more_matches_2 = $LANGPREFS{'TXT_more_matches_2'}; $TXT_please_fill_in = $LANGPREFS{'TXT_please_fill_in'}; $TXT_please_go_back_and_edit = $LANGPREFS{'TXT_please_go_back_and_edit'}; $TXT_search_results = $LANGPREFS{'TXT_search_results'}; $TXT_no_dot_at_start = $LANGPREFS{'TXT_no_dot_at_start'}; $TXT_no_www_at_start = $LANGPREFS{'TXT_no_www_at_start'}; $TXT_no_squiggles_in_domain = $LANGPREFS{'TXT_no_squiggles_in_domain'}; $TXT_only_one_at = $LANGPREFS{'TXT_only_one_at'}; $TXT_no_dots_next = $LANGPREFS{'TXT_no_dots_next'}; $TXT_wrong_end = $LANGPREFS{'TXT_wrong_end'}; $TXT_too_many_words = $LANGPREFS{'TXT_too_many_words'}; $TXT_disallowed_word = $LANGPREFS{'TXT_disallowed_word'}; $TXT_blocked_IP = $LANGPREFS{'TXT_blocked_IP'}; $lang_months = $LANGPREFS{'lang_months'}; $lang_days = $LANGPREFS{'lang_days'}; $TXT_has_been_added_moderated = "Thanks. Your item has been sent to our webmaster and will be added shortly." if ($TXT_has_been_added_moderated eq ""); ###################### $pass_restricted = $PREFS{'pass_restricted'}; $access = $PREFS{'access'}; $textfontface = $PREFS{'textfontface'}; $textfontsize = $PREFS{'textfontsize'}; $title = $PREFS{'title'}; $max = $PREFS{'max'}; $border_size = $PREFS{'border_size'}; $alignment = $PREFS{'alignment'}; $home_page = $PREFS{'home_page'}; $home_page_title = $PREFS{'home_page_title'}; $show_home_page_link = $PREFS{'show_home_page_link'}; $home_page_target = $PREFS{'home_page_target'}; $order = $PREFS{'order'}; $show_line = $PREFS{'show_line'}; $mail_path = $PREFS{'mail_path'}; $admin_email = $PREFS{'admin_email'}; $send_email_to_admin = $PREFS{'send_email_to_admin'}; $send_email_to_sender = $PREFS{'send_email_to_sender'}; $bad_words = $PREFS{'bad_words'}; $moderated = $PREFS{'moderated'}; $field_length = $PREFS{'field_length'}; $no_displayed = $PREFS{'no_displayed'}; $max_length = $PREFS{'max_length'}; $anti_spam = $PREFS{'anti_spam'}; $anti_ips = $PREFS{'anti_ips'}; $days_to_delete = $PREFS{'days_to_delete'}; $days_to_trash = $PREFS{'days_to_trash'}; $days_to_delete_backup_files = $PREFS{'days_to_delete_backup_files'}; $mail_admin_backups_interval = $PREFS{'mail_admin_backups_interval'}; $mail_admin_backups_day = $PREFS{'mail_admin_backups_day'}; $mail_admin_backups_month = $PREFS{'mail_admin_backups_month'}; $allow_html = $PREFS{'allow_html'}; $active_header = $PREFS{'active_header'}; $use_title = $PREFS{'use_title'}; $show_no_of_items = $PREFS{'show_no_of_items'}; $use_mailto = $PREFS{'use_mailto'}; $web_enabled = $PREFS{'web_enabled'}; $user_image = $PREFS{'user_image'}; $user_image_url = $PREFS{'user_image_url'}; $use_hr_image = $PREFS{'use_hr_image'}; $hr_image = $PREFS{'hr_image'}; $use_user_html = $PREFS{'use_user_html'}; $use_user_html_footer = $PREFS{'use_user_html_footer'}; $table_width = $PREFS{'table_width'}; $usebackgroundimage = $PREFS{'usebackgroundimage'}; $backgroundimage = $PREFS{'backgroundimage'}; $mail_backup_to_admin = $PREFS{'mail_backup_to_admin'}; $thanks_title = $PREFS{'thanks_title'}; $thanks_include_item = $PREFS{'thanks_include_item'}; $web_comment = $PREFS{'web_comment'}; $style = $PREFS{'style'}; $left_bracket = $PREFS{'left_bracket'}; $middle_bracket = $PREFS{'middle_bracket'}; $right_bracket = $PREFS{'right_bracket'}; $trans_search = $COLPREFS{'trans_search'}; $trans_item_header = $COLPREFS{'trans_item_header'}; $trans_item_body = $COLPREFS{'trans_item_body'}; $backcolor = $COLPREFS{'backcolor'}; $data_color1 = $COLPREFS{'data_color1'}; $data_color2 = $COLPREFS{'data_color2'}; $textdata_color1 = $COLPREFS{'textdata_color1'}; $textdata_color2 = $COLPREFS{'textdata_color2'}; $table_color1 = $COLPREFS{'table_color1'}; $table_color2 = $COLPREFS{'table_color2'}; $texttable_color1 = $COLPREFS{'texttable_color1'}; $texttable_color2 = $COLPREFS{'texttable_color2'}; #$back = $COLPREFS{'back'}; $link = $COLPREFS{'link'}; $vlink = $COLPREFS{'vlink'}; $alink = $COLPREFS{'alink'}; $text = $COLPREFS{'text'}; $searchcolor = $COLPREFS{'searchcolor'}; $commentcolor = $COLPREFS{'commentcolor'}; $user_html = ""; $user_style = ""; $user_html_footer = ""; $thank_you = ""; open(FILE,"$user_html_name") || &oops("$user_html_name"); @user_html = ; foreach $row(@user_html) { $user_html = $user_html . $row; } close(FILE); open(FILE,"$user_style_name") || &oops('$user_style_name'); @user_style = ; foreach $row(@user_style) { $user_style = $user_style . $row; } close(FILE); open(FILE,"$user_html_footer_name") || &oops('$user_html_footer_name'); @user_html_footer = ; foreach $frow(@user_html_footer) { $user_html_footer = $user_html_footer . $frow; } close(FILE); open(FILE,"$thank_you_name") || &oops('$thank_you_name'); @thank_you = ; foreach $row(@thank_you) { $thank_you = $thank_you . $row; } close(FILE); open(NUMBER,"$active_name") || &oops('$active_name'); $active_string = ; close(NUMBER); #upgrade ($home_page_target = "_top") if ($home_page_target eq ""); ($border_size = "0") if ($border_size eq ""); ($field_length = 40) if ($field_length eq ""); if ($brackets_exist eq "no") { $left_bracket = "["; $right_bracket = "]"; $middle_bracket = "|"; } # end upgrade } ### View Standard Preferences sub view_prefs { &seek_cook; &content; #upgrade ($home_page_target = "_top") if ($home_page_target eq ""); ($border_size = "0") if ($border_size eq ""); ($field_length = 40) if ($field_length eq ""); # end upgrade print qq~

Active Guestbook - Standard Preferences Manager Active Guestbook - Standard Preferences Manager

Return to Guestbook | Return to Control Panel
Restore FACTORY defaults | Restore USER defaults
Save these settings as USER defaults
(If you have made any changes, you first need to UPDATE using the button at the bottom.) ~; print qq~

~; if ($access ne "restricted") { print qq~ ~; } print qq~ ~; print qq~ ~; print qq~ ~; if ($order eq "normal") { print qq~ ~; } else { print qq~ ~; } if ($use_mailto eq "no") { print qq~ ~; } else { print qq~ ~; } if ($web_enabled eq "no") { print qq~ ~; } else { print qq~ ~; } if ($show_no_of_items eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; ############ print qq~
Presentation
Type of guestbook: ~; if ($access eq "public") { print qq~ Public - Restricted - Private -
Access is currently set to Public. All visitors can add items to your guestbook. ~; } elsif ($access eq "restricted") { print qq~ Public - Restricted - Private -
Password for guests to be able to add news items: ~; } else { print qq~ Public - Restricted - Private -
Access is currently set to Private. News items can only be added via the Control Panel. ~; } print qq~
Alignment ~; if ($alignment eq "left") { print qq~ Left: - Center: - Right: ~; } elsif ($alignment eq "right") { print qq~ Left: - Center: - Right: ~; } else { print qq~ Left: - Center: - Right: ~; } print qq~
Title of your home page
(or whatever page you want to link
to from your guestbook)
Your home page address
Size of border around
each item

(set to "0" for no border)
Show horizontal line between items ~; if ($show_line eq "no") { print qq~ No:
Yes: ~; } else { print qq~ No:
Yes: ~; } print qq~
Show links to home page
(you may not want to if
using frames)
~; if ($show_home_page_link eq "no") { print qq~ No:
Yes: ~; } else { print qq~ No:
Yes: ~; } print qq~
Frame target for home page address
(if using frames. If you are NOT
using frames, just leave blank)
Font face Font size
Board width (in pixels or as a percentage) Number of items per page
Width of the fields in the
Add an item page
Brackets used in menus
(leave these blank if you do NOT want any brackets)
Left:
Middle:
Right:
Maximum number of words in itemOrder of items Normal:
Reversed:
Order of items Normal:
Reversed:
Enable email mailto links No:
Yes:
Enable email mailto links No:
Yes:
Show sender web page links No:
Yes:
Show sender web page links No:
Yes:
Display total number of items No:
Yes:
Display total number of items No:
Yes:
Text for "comment" title

~; if ($style ne "off") { print qq~ ~; } else { print qq~ ~; } print qq~ "; #################### print qq~
Style/CSS
Use Style/CSS No: Yes:
Use Style/CSS No: Yes:
Style code

~; if ($send_email_to_admin eq "off") { print qq~ ~; } else { print qq~ ~; } if ($send_email_to_sender eq "off") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; print qq~ "; if ($thanks_include_item eq "off") { print qq~ ~; } else { print qq~ ~; } print qq~
Email info
Path to your sendmail programme
Your email address
Send you email notification of new items? No: Yes:
Send you email notification of new items? No: Yes:
Send sender a thank you item? No: Yes:
Send sender a thank you item? No: Yes:
Subject to be shown in your thank you item
Text of your thank you item
Include original guestbook item in thank you item? No: Yes:
Include original guestbook item in thank you item? No: Yes:

~; if ($active_header eq "off") { print qq~ ~; } else { print qq~ ~; } if ($user_image eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; if ($use_title eq "off") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; if ($usebackgroundimage eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; ############## ($hr_image = "http://www.active-scripts.net/line.gif") if ($hr_image eq ""); if ($use_hr_image ne "yes") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; ############ if ($use_user_html eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~ "; #################### ############ if ($use_user_html_footer eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~ "; #################### if ($allow_html eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~
Images/titles
Show Active-Scripts header No: Yes:
Show Active-Scripts header No: Yes:
Use your own image at top of guestbook No: Yes:
Use your own image at top of guestbook No: Yes:
Address of your image
Use text title No: Yes:
Use text title No: Yes:
Title of your guestbook
Use your own background image No: Yes:
Use your own background image No: Yes:
Address of your
background image
Use your own image
between items
No: Yes:
Use your own image
between items
No: Yes:
Address of your image
between items
Use your own html header at top of guestbook? No: Yes:
Use your own html header at top of guestbook? No: Yes:
User header html
Use your own html footer at bottom of guestbook? No: Yes:
Use your own html footer at bottom of guestbook? No: Yes:
User footer html
Allow html in items (best not to) No: Yes:
Allow html in items (best not to) No: Yes:

~; if ($anti_spam eq "off") { print qq~ ~; } else { print qq~ ~; } $anti_ips =~ s/\,/ /g; print qq~ ~; $bad_words =~ s/\,/ /g; print qq~
Item control
Block multiple posts in same day by same IP?
(Only use this if you suffer from regular spamming.)
No: Yes:
Block multiple posts in same day by same IP?
(Only use this if you suffer from regular spamming.)
No: Yes:
List any servers or IP addresses (or parts thereof) that you wish to block. (use a white space between multiple addresses)
List words you would rather your sender did not use
in your guestbook. (Use your imagination.)

~; if ($moderated eq "yes") { print qq~ ~; } else { print qq~ ~; } print qq~
Guestbook management
Approve items before they are added?
No: Yes:
Approve items before they are added?
No: Yes:
Maximum number of items in entire guestbook
Number of days until an item is automatically
removed from guestbook.
Number of days to complete wipe of items
following removal.
No of days your daily automatic backups are retained

~; if ($mail_backup_to_admin eq "no") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; if ($mail_admin_backups_interval eq "daily") { print qq~ ~; } else { print qq~ ~; } if ($mail_admin_backups_interval eq "weekly") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; if ($mail_admin_backups_interval eq "monthly") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; print qq~
Backup email
Send regular email backup to admin? No: Yes:
Send regular email backup to admin? No: Yes:
Frequency of regular email of backup to adminDaily:
Daily:
Weekly: Weekly: Day of week :
Monthly:
Monthly: Day of month:

~; } # end view_prefs ############### sub view_to_edit { &seek_cook; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); @data_ordered = reverse(@data); &basic_header; print qq~
Active Guestbook Item Manager

Control Panel ~; @datalist = (); $count = 1; foreach $row (@data_ordered) { @fields = split (/\|/, $row); unless ($fields[10] eq "del") { push (@datalist, $row); } } #################### ###################### ################### ################### print "
"; $count = 1; $grouped = 0; $no_displayed = 5; $start_number = $FORM{'start_number'}; $new_start_number = ($start_number + $no_displayed); $old_start_number = ($start_number - $no_displayed); $startplus = $start_number +1; $number_of_items = @datalist; unless ($old_start_number < 0) { print qq~ [Previous] ~; } &show_edit_number_menu unless ($number_of_items <($no_displayed+1)); #################### show number menu unless ($new_start_number > ($number_of_items -1 )) { print qq~ [Next]
~; } if (($new_start_number > ($number_of_items -1 )) && ($number_of_items >($no_displayed))) { print qq~
~; } print qq~ ~; if ($new_start_number < $number_of_items) { print qq~ Items $startplus to $new_start_number ~; } else { if ($startplus == $number_of_items) { print qq~ Item $startplus
~; } else { print qq~ Items $startplus to $number_of_items
~; } } foreach $row (@datalist) { @fields = split (/\|/, $row); $grouped++; if (($grouped > ($start_number)) && ($grouped < ($start_number + $no_displayed + 1))) { if ($fields[15] eq "waiting") { print qq~ ~; } else { if ($count ==1) { print qq~
THIS Item IS WAITING FOR APPROVAL
~; } else { print qq~
~; } } # end else if ($fields[4]) { print qq~ ~; } else { print qq~ ~; } print qq~ ~; print qq~ ~; if ($fields[6]) { print qq~ ~; } if ($fields[11]) { print qq~ ~; } if ($fields[7]) { print qq~ ~; } print qq~ ~; print qq~ ~; print qq~
$TXT_your_name: $fields[1]
$TXT_your_name: $fields[1]
$TXT_news_item_title: $fields[5]
$TXT_your_item: $fields[2]
Date: $fields[3]
$web_comment: $fields[6]
$TXT_your_web_page_address: $fields[11]
IP: $fields[7]
[ Delete this item] ~; unless ($fields[6]) { print qq~ [ Add a comment ] ~; } if ($fields[15] eq "waiting") { print qq~ [ APPROVE THIS Item ] ~; } print qq~ [ Edit this item ]


~; $count++; if ($count >2) { $count = 1; } } } } # end sub sub delete_item { &seek_cook; &get_file_lock("$location_of_lock_file"); $ref = $FORM{'ref'}; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data) { @fields = split (/\|/, $row); if ($ref ne $fields[0]) { print USER_FILE "$row"; } else { print USER_FILE "$fields[0]|$fields[1]|$fields[2]|$fields[3]|$fields[4]|$fields[5]|$fields[6]|$fields[7]|$fields[8]|$fields[9]|del|$fields[11]|$now|$fields[13]|$fields[14]|$fields[15]|$fields[16]|$fields[17]|$fields[18]|$fields[19]|$fields[20]|$fields[21]|$fields[22]|$fields[23]|$fields[24]|$fields[25]|$fields[26]|$fields[27]|$fields[28]|$fields[29]|$fields[30]|\n"; } ### This adds "del" to field 9 and the date it is deleted to field 12. } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Item Manager

Item deleted
~; } # end delete_item ############## add response sub add_response1 { &seek_cook; $ref = $FORM{'ref'}; $start_number = $FORM{'start_number'}; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); foreach $row (@data) { @fields = split (/\|/, $row); if ($ref eq $fields[0]) { &content; &plain_header; print qq~ Active Guestbook Item Editor
Item Editor | Control Panel

~; print qq~ ~; if ($fields[4]) { print qq~ ~; } else { print qq~ ~; } print qq~ ~; if ($fields[5]) { print qq~ ~; } $fields[6] =~ s/\/\n/g; print qq~ ~; print qq~
$TXT_your_name: $fields[1]
$TXT_your_name: $fields[1]
$TXT_your_item: $fields[2]
Date: $fields[3]
$TXT_news_item_title: $fields[5]
$web_comment:

~; } } } # end add response1 sub add_response2 { &seek_cook; $ref = $FORM{'ref'}; $start_number = $FORM{'start_number'}; $comment= $FORM{'comment'}; $comment =~ s/\r//g; $comment =~ s/\n/
/g; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); &get_file_lock("$location_of_lock_file"); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data) { chop($row); @fields = split (/\|/, $row); if ($ref ne $fields[0]) { print USER_FILE "$row\n"; } else { print USER_FILE "$fields[0]|$fields[1]|$fields[2]|$fields[3]|$fields[4]|$fields[5]|$comment|$fields[7]|$fields[8]|$fields[9]|$fields[10]|$fields[11]|$fields[12]|$fields[13]|$fields[14]|$fields[15]|$fields[16]|$fields[17]|$fields[18]|$fields[19]|$fields[20]|$fields[21]|$fields[22]|$fields[23]|$fields[24]|$fields[25]|$fields[26]|$fields[27]|$fields[28]|$fields[29]|$fields[30]|\n"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Item Editor

Comment successfully added. ~; &inter_footer; } # end add response2 sub change1 { &seek_cook; $start_number = $FORM{'start_number'}; $ref = $FORM{'ref'}; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); foreach $row (@data) { @fields = split (/\|/, $row); if ($ref eq $fields[0]) { $fields[2] =~ s/\/\n/g; &content; &plain_header; print qq~ Active Guestbook Item Editor
Item Editor | Control Panel

~; $fields[6] =~ s/\/\n/g; print qq~ ~; print qq~
Name

Title:
Item:

Email address:
Web address:
Date:
$web_comment:

~; print "\n\n"; } } # end if right one } # end sub change1 sub change2 { &seek_cook; $ref = $FORM{'ref'}; $start_number = $FORM{'start_number'}; $edited_date = $FORM{'edited_date'}; $comment= $FORM{'comment'}; $full_name = $FORM{'requiredfull_name'}; $item = $FORM{'requireditem'}; $sender_email = $FORM{'sender_email'}; $news_item_title = $FORM{'requirednews_item_title'}; $url = $FORM{'url'}; $url =~ s/http\:\/\///i; $item =~ s/\r\n/
/g; $item =~ s/\r/ /g; $item =~ s/\n/
/g; $item =~ s/\\/
/g; $item =~ s/\s\s/ /g; $comment =~ s/\r//g; $comment =~ s/\n/
/g; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); &get_file_lock("$location_of_lock_file"); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data) { chop($row); @fields = split (/\|/, $row); if ($ref ne $fields[0]) { print USER_FILE "$row\n"; } else { print USER_FILE "$fields[0]|$full_name|$item|$edited_date|$sender_email|$news_item_title|$comment|$fields[7]|$fields[8]|$fields[9]|$fields[10]|$url|$fields[12]|$fields[13]|$fields[14]|$fields[15]|$fields[16]|$fields[17]|$fields[18]|$fields[19]|$fields[20]|$fields[21]|$fields[22]|$fields[23]|$fields[24]|$fields[25]|$fields[26]|$fields[27]|$fields[28]|$fields[29]|$fields[30]|\n"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Item Editor

Item successfully edited. ~; &inter_footer; } # end change2 ############### sub view_to_undo { &seek_cook; @datalist = (); open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); foreach $row (@data) { @fields = split (/\|/, $row); if ($fields[10] eq "del") { push (@datalist, $row); } } ############# if (@datalist <1) { &content; &plain_header; print qq~ Active Guestbook Trash Manager
No deleted items found.
Control Panel ~; exit; } else { @sorteddata = sort(@datalist); @reversesorteddata = reverse(@sorteddata); &basic_header; print qq~

Active Guestbook Trash Manager
Control Panel ~; $count = 1; foreach $row (@reversesorteddata) { @fields = split (/\|/, $row); ############## if ($count ==1) { print qq~ ~; } else { print qq~
~; } if ($fields[4]) { print qq~ ~; } else { print qq~ ~; } print qq~ ~; print qq~ ~; if ($fields[6]) { print qq~ ~; } if ($fields[7]) { print qq~ ~; } print qq~ ~; print qq~
$TXT_your_name: $fields[1]
$TXT_your_name: $fields[1]
$TXT_news_item_title: $fields[5]
$TXT_your_item: $fields[2]
Date: $fields[3]
$web_comment: $fields[6]
IP address: $fields[7]
[ Undelete this item ] [ Permanently wipe this item ] ~; print qq~

~; $count++; if ($count >2) { $count = 1; } } } # end foreach undo } # end sub sub undelete_item { &seek_cook; $ref = $FORM{'ref'}; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); &get_file_lock("$location_of_lock_file"); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data) { @fields = split (/\|/, $row); if ($ref ne $fields[0]) { print USER_FILE "$row"; } else { print USER_FILE "$fields[0]|$fields[1]|$fields[2]|$fields[3]|$fields[4]|$fields[5]|$fields[6]|$fields[7]|$now|$fields[9]||$fields[11]||$fields[13]|$fields[14]|$fields[15]|$fields[16]|$fields[17]|$fields[18]|$fields[19]|$fields[20]|$fields[21]|$fields[22]|$fields[23]|$fields[24]|$fields[25]|$fields[26]|$fields[27]|$fields[28]|$fields[29]|$fields[30]|\n"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Trash Manager

Item successfully undeleted. ~; &inter_footer; exit; } sub trash_item { &seek_cook; $ref = $FORM{'ref'}; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); &get_file_lock("$location_of_lock_file"); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data) { @fields = split (/\|/, $row); if ($ref ne $fields[0]) { print USER_FILE "$row"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; print qq~ ~; &main_headerb; print qq~

Active Guestbook Trash Manager

Item permanently wiped. ~; &inter_footer; exit; } # end trash_item sub amqdate { $amqdate = $_[0]; @bits = split (/\//, $amqdate); $amqyear = $bits[2]; if ($amqyear > 1999) { $amqyear = ($amqyear - 2000); } if ($amqyear == 4 || $amqyear == 8 || $amqyear == 12 || $amqyear == 16 || $amqyear == 0 || $amqyear == 20 || $amqyear == 24) {$leap = "yes";} else {$leap = "no";} if ($amqyear == 1 || $amqyear == 5 || $amqyear == 9 || $amqyear == 13 || $amqyear == 17 || $amqyear == 21 || $amqyear == 25) { $extradays = ((($amqyear - 1)/4)+1); } $amqyeardays = (($amqyear * 365)+$extradays); $amqday = $bits[0]; if ($bits[1] == 1) {$monthdays = 0;} if ($bits[1] == 2) {$monthdays = 31;} if ($bits[1] == 3) {$monthdays = 59;} if ($bits[1] == 4) {$monthdays = 90;} if ($bits[1] == 5) {$monthdays = 120;} if ($bits[1] == 6) {$monthdays = 151;} if ($bits[1] == 7) {$monthdays = 181;} if ($bits[1] == 8) {$monthdays = 212;} if ($bits[1] == 9) {$monthdays = 243;} if ($bits[1] == 10) {$monthdays = 273;} if ($bits[1] == 11) {$monthdays = 304;} if ($bits[1] == 12) {$monthdays = 334;} if ($leap eq "yes" && $bits[1] >2) { $monthdays = ($monthdays+1); } $amqtotal = ($amqday + $amqyeardays + $monthdays); return($amqtotal); } sub check_update { unless (-e "$update_name") { umask 000; } open(NUMBER,"$update_name") || &oops('$update_name'); $num = ; close(NUMBER); if ($num < $revdate) { &get_file_lock("$location_of_lock_file"); open(NUMBER,">$update_name"); print NUMBER "$revdate"; close(NUMBER); &update_database; &release_file_lock("$location_of_lock_file"); } } sub update_database { ############# run automatic delete or trash open(USER_FILE,"$guestbook_data_name"); @data = ; close(USER_FILE); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data) { @fields = split (/\|/, $row); if (($fields[10] eq "del") && ($fields[12]) && ($fields[12] < $now - $days_to_trash)) { } elsif ((!$fields[12]) && ($fields[8] < ($now - $days_to_delete))) { print USER_FILE "$fields[0]|$fields[1]|$fields[2]|$fields[3]|$fields[4]|$fields[5]|$fields[6]|$fields[7]|$fields[8]|$fields[9]|del|$fields[11]|$now|$fields[13]|$fields[14]|$fields[15]|$fields[16]|$fields[17]|$fields[18]|$fields[19]|$fields[20]|$fields[21]|$fields[22]|$fields[23]|$fields[24]|$fields[25]|$fields[26]|$fields[27]|$fields[28]|$fields[29]|$fields[30]|\n"; } else { print USER_FILE "$row"; } } # end for each close(USER_FILE); ########### automatic prune if non-deleted items greater than max open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); @revdata = reverse(@data); @nondeldata = (); @deldata = (); @arraytodisplay = (); foreach $row (@revdata) { @fields = split (/\|/, $row); push (@nondeldata, $row) if $fields[10] ne "del"; # add non-deleted items to new array # push (@deldata, $row) if $fields[10] eq "del"; # add deleted items to new array # } if (@nondeldata >$max) { $counter = 0; foreach $row (@nondeldata) { @fields = split (/\|/, $row); if ($counter < $max) { push (@arraytodisplay, $row); } else { $delrow = "$fields[0]|$fields[1]|$fields[2]|$fields[3]|$fields[4]|$fields[5]|$fields[6]|$fields[7]|$fields[8]|$fields[9]|del|$fields[11]|$now|$fields[13]|$fields[14]|$fields[15]|$fields[16]|$fields[17]|$fields[18]|$fields[19]|$fields[20]|$fields[21]|$fields[22]|$fields[23]|$fields[24]|$fields[25]|$fields[26]|$fields[27]|$fields[28]|$fields[29]|$fields[30]|\n"; push (@arraytodisplay, $delrow); } $counter++; } @alldata = (@arraytodisplay, @deldata); @sortedalldata = sort(@alldata); open(USER_FILE,">$guestbook_data_name") || &oops('$guestbook_data_name'); foreach $row (@sortedalldata) { print USER_FILE "$row"; } close(USER_FILE); } ######### &delete_old_backups; &mail_backup if $mail_backup_to_admin eq "yes"; } sub backup_to_dir { open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @user_data = ; close(USER_FILE); $location1 = "./$guestbook_backups_directory/guestbook_backup.$revdate"; umask 000; open(BAK,">$location1"); foreach $row (@user_data) { print BAK "$row"; } close(BAK); } # end backup to dir ###################### sub mail_backup { open(NUMBER2,"$senddate_name") || &oops('$senddate_name'); $senddate = ; close(NUMBER2); if ((($mail_admin_backups_interval eq "monthly") && (($mail_admin_backups_month == $bakday) || (($now -$senddate) >27 ) )) || (($mail_admin_backups_interval eq "weekly") && (($mail_admin_backups_day == $wday) || (($now -$senddate) >6 ) ) ) || ($mail_admin_backups_interval eq "daily")) { open (MAIL, "|$mail_path $admin_email") || &oops('the mail program. Please check the mail path in the Control Panel.'); print MAIL "To: $admin_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: Database backup\n\n"; print MAIL "Below is a backup data file from your Active Guestbook. For details of how to restore your data from this file, please visit www.active-scripts.net.\n\n"; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @user_data = ; close(USER_FILE); foreach $row (@user_data) { print MAIL "$row\n"; } close (MAIL); open(NUMBER1,"$senddate_name") || &oops('$senddate_name'); open (NUMBER1,">$senddate_name"); print NUMBER1 "$now"; close(NUMBER1); } } ##################### sub delete_old_backups { opendir (USERS, "./$guestbook_backups_directory") || &oops('the $guestbook_backups_directory directory'); @files = grep(/^g/,readdir(USERS)); closedir (USERS); foreach $file (@files) { if (-M "./$guestbook_backups_directory/$file" > $days_to_delete_backup_files) { unlink("./$guestbook_backups_directory/$file"); } } } # End of sub delete_old_bak sub search { &content; @hits = (); &main_header; &active_header if $active_header eq "on"; print qq~
~; &user_image if $user_image eq "yes"; &title if $use_title eq "on"; &user_html if $use_user_html eq "yes"; print qq~

$TXT_search_results

~; &menu; $search_words = $FORM{'search_words'}; $search_fields = $FORM{'search_fields'}; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; foreach $row (@data) { @fields = split (/\|/, $row); if ($fields[10] ne "del") { if (($search_fields eq "1" ) || ($search_fields eq "2" )) { $searchby = $fields[$search_fields]; } else { $searchby = $row; } @word_list = split(/\s+/,$search_words); for ($x = @word_list; $x > 0; $x--) { $match_word = $word_list[$x - 1]; if ($searchby =~ /\b$match_word\b/i) { splice(@word_list,$x - 1, 1); } # End of If } # End of For Loop if (@word_list < 1) { push (@hits, $row); } } } # end foreach $row (@data) close(USER_FILE); if (@hits <1) { print "
$TXT_no_match
"; } else { &html_search_results; } if (($use_user_html_footer eq "yes") && ($use_hr_image eq "yes")) { print "
"; &user_html_footer ; } if (($use_user_html_footer eq "yes") && ($use_hr_image ne "yes")) { &user_html_footer ; } print qq~
~; } ######### sub html_search_results { $count = 1; $number_of_items = @hits; @hits = reverse(@hits); if ($search_flag ne "no") { if ($number_of_items == 1) { print qq~
$TXT_one_match ~; } else { print qq~
$TXT_more_matches_1 $number_of_items $TXT_more_matches_2~; } } foreach $row (@hits) { ######### @fields = split (/\|/, $row); # $grouped++; # if (($grouped > ($start_number)) && ($grouped < ($start_number + $no_displayed + 1))) # { &main_table_results; # } # end if number is right } # end for each row ######### } ############## sub preview { &content; &main_header; &active_header if $active_header eq "on"; print qq~
~; &user_image if $user_image eq "yes"; &title if $use_title eq "on"; &user_html if $use_user_html eq "yes"; &menu; $item =~ s/\"/'/g; $news_item_title =~ s/\"/'/g; $url =~ s/\"/'/g; $full_name =~ s/\"/'/g; print qq~
~; $url = "$TXT_none_given" if !$url; $sender_email = "$TXT_none_given" if !$sender_email; print qq~ $TXT_these_are_the
$TXT_if_correct
$TXT_if_not$TXT_go_back$TXT_and_edit

$TXT_your_name$full_name

$TXT_news_item_title$news_item_title

$TXT_your_item$item

$TXT_your_email_address$sender_email

$TXT_your_web_page_address$url

~; &user_html_footer if $use_user_html_footer eq "yes"; exit; } sub view_backups { &seek_cook; open(RESTORE_BACKUP,"./$guestbook_backups_directory/undo_restore.bak"); @restore_backup_data = ; close(RESTORE_BACKUP); opendir (USERS, "./$guestbook_backups_directory") || &oops('the backups directory'); @files = grep(/^news/,readdir(USERS)); closedir (USERS); if (@files<1) { &content; print qq~ $title

Active Guestbook Backup Manager

There are currently no backups to restore.

~; } else { &content; print qq~
$title Active Guestbook Backup Manager

Control Panel ~; if (@restore_backup_data >2) { print qq~ | Undo last restore ~; } print qq~

~; @sorted_files = sort(@files); foreach $file (@sorted_files) { $year = substr($file, -8,4); $month = substr($file, -4,2); $month = $month-1; $mon = $months[$month]; $day = substr($file, -2,2); print qq~ ~; } print qq~
Select backup to restore
$day - $mon - $year - View
~; } &inter_footer; } sub undo_last_restore { &seek_cook; open(RESTORE_BACKUP,"./$guestbook_backups_directory/undo_restore.bak"); @restore_backup_data = ; close(RESTORE_BACKUP); if (@restore_backup_data <2) { &content; print qq~ $title
Active Guestbook Backup Manager

No undo available at the moment.

~; } open(MAIN_NEWSBOARD,">$guestbook_data_name") || &oops('$guestbook_data_name'); foreach $row (@restore_backup_data) { print MAIN_NEWSBOARD "$row"; } close(MAIN_NEWSBOARD); open(RESTORE_BACKUP,">./$guestbook_backups_directory/undo_restore.bak"); # wipe undo restore file close(RESTORE_BACKUP); &set_counter; &content; print qq~ $title
Active Guestbook Backup Manager

Last restore undone.

~; exit; } sub restore_backups { &seek_cook; $file_to_restore = $FORM{'file_to_restore'}; if ($file_to_restore eq "") { { &basic_header; print qq~
$title

You didn't select a backup to restore. Please go back and select. ~; exit; } } open(MAIN_NEWSBOARD,"$guestbook_data_name") || &oops('$guestbook_data_name'); @main_data = ; close(MAIN_NEWSBOARD); open(RESTORE_BACKUP,">./$guestbook_backups_directory/undo_restore.bak"); foreach $row (@main_data) { print RESTORE_BACKUP "$row"; } close(RESTORE_BACKUP); &get_file_lock("$location_of_lock_file"); open(MAIN_NEWSBOARD,">$guestbook_data_name"); open(RESTORE,"./$guestbook_backups_directory/$file_to_restore") || &oops('/$guestbook_backups_directory/$file_to_restore'); @restore_data = ; foreach $line (@restore_data) { print MAIN_NEWSBOARD "$line"; } close(RESTORE); close(MAIN_NEWSBOARD); &release_file_lock("$location_of_lock_file"); &set_counter; &content; print qq~ $title

Active Guestbook Backup Manager

Backup has been restored.
(You can undo this from the main Backup Manager page.)

~; exit; } sub view_single_backup { &seek_cook; &basic_header; $file_to_restore = $FORM{'file_to_restore'}; $year = substr($file_to_restore, -8,4); $month = substr($file_to_restore, -4,2); $month = $month-1; $mon = $months[$month]; $day = substr($file_to_restore, -2,2); $datestamp = "$day"."-"."$mon"."-"."$year"; print qq~
Backup date: $datestamp
Restore this guestbook | Return to Backup Manager ~; open(RESTORE,"./$guestbook_backups_directory/$file_to_restore"); @hits = ; close(RESTORE); $search_flag = "no"; &html_search_results_plain; } sub active_header { if ($demo eq "off") { print qq~

~; } else { print qq~

~; } } sub title { print qq~

$title

~; } sub menu { print qq~ $left_bracket ~; if ($access ne "private") { if ($ipoops ne "yes") { if ($action ne "add") { print qq~ $TXT_add_a_item $middle_bracket ~; } } } unless ($show_home_page_link eq "no") { print qq~ $home_page_title $middle_bracket ~; } if ($action eq "add") { print qq~ $TXT_back_to_guestbook $middle_bracket ~; } if ($action eq "search") { print qq~ $TXT_back_search_again $right_bracket
~; } else { print qq~ $TXT_search $right_bracket
~; } print qq~
~; } sub no_of_items_display { print qq~ ~; if ($number_of_items == 1) { print qq~ $TXT_there_is_now$number_of_items$TXT_item_in_our_guestbook
~; } else { print qq~ $TXT_there_are_now$number_of_items$TXT_items_in_our_guestbook
~; } print qq~
~; } sub main_header { print qq~ $title ~; &required_script if $action eq "add"; if ($style ne "off") { print qq~ $user_style ~; } print qq~
~; } ######################## sub main_headera { print qq~ $title ~; &required_script if $action eq "add"; } sub main_headerc { if ($style ne "off") { print qq~ $user_style ~; } print qq~
~; } sub main_headerb { if ($style ne "off") { print qq~ $user_style ~; } print qq~
~; } else { print qq~ TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000" marginwidth="0" marginheight="0" LEFTMARGIN="0" TOPMARGIN="0" >
~; } } ############# sub content { print "Content-type: text/html\n\n"; } sub search_form { print qq~
$TXT_you_can_search_this_guestbook_by
$TXT_searchitem - $TXT_searchname - $TXT_searchall
$TXT_searchtext
~; } sub show_number_menu { print qq~ $left_bracket ~; $number_of_items = int($number_of_items); # int here sorts out any funny decimals entered in the control panel $number_of_pages = ($number_of_items / $no_displayed) ; $number_of_pages = int($number_of_pages); # no of full pages if ($number_of_items > ($number_of_pages * $no_displayed)) { $extra = "yes"; } if ($extra eq "yes") { $number_of_pages = $number_of_pages +1; } ($start_number = 0) if (!$start_number); for ($x = 1; $x < $number_of_pages+1 ; $x++ ) { $sn = (($x*$no_displayed)- $no_displayed); $bottom = ($start_number - (11 * $no_displayed)); $top = ($start_number + (11 * $no_displayed)); if ((($sn > $bottom) && ($sn < $top)) || ($x == "1") || ($x == $number_of_pages)) { if ($sn ne $start_number) { print qq~
$x ~; } else { print qq~ $x ~; } # end else } } # end for print qq~ $right_bracket ~; } sub user_image { if ($user_image_url) { print qq~
~; } else { print qq~ You have not given an image file address in the Standard Preferences Manager.
~; } } sub user_html { print qq~ $user_html ~; } sub user_html_footer { print qq~ $user_html_footer
~; } sub view_change_password { &seek_cook; &content; print qq~ $title ~; &required_script; print qq~ ~; print qq~
Password Manager
Control Panel
Please enter your new password twice.
(please note that passwords are case-sensitive)
New password
New password again
~; &inter_footer; } sub change_password { &seek_cook; $pass1 = $FORM{'requiredpass1'}; $passcheck = $FORM{'requiredpasscheck'}; if ($pass1 eq $passcheck) { open(ACTIVE,">$active_name"); $newpass = crypt($pass1, $salt); print ACTIVE "$newpass"; close(ACTIVE); &SetCookies('activea',$newpass); &content; &main_headera; print qq~ ~; &main_headerb; print qq~ Change Active Guestbook Control Panel Password
Password has been changed.
~; } else { &content; &plain_header_stop; print qq~ Change Active Guestbook Control Panel Password

The password has NOT been changed.
The two passwords you typed were not the same.

Control Panel | Try again ~; } } sub enter_password { &content; print qq~ $title ~; print qq~

Active Guestbook Control Panel
Please enter password.
You will need to have Cookies enabled for easy navigation
through the Control Panel features.
Password
~; &inter_footer; } sub cookie_vars { $Cookie_Exp_Date = ''; $Cookie_Path = ''; $Cookie_Domain = ''; $Secure_Cookie = '0'; @Cookie_Encode_Chars = ('\%', '\+', '\;', '\,', '\=', '\&', '\:\:', '\s'); %Cookie_Encode_Chars = ('\%', '%25', '\+', '%2B', '\;', '%3B', '\,', '%2C', '\=', '%3D', '\&', '%26', '\:\:', '%3A%3A', '\s', '+'); @Cookie_Decode_Chars = ('\+', '\%3A\%3A', '\%26', '\%3D', '\%2C', '\%3B', '\%2B', '\%25'); %Cookie_Decode_Chars = ('\+', ' ', '\%3A\%3A', '::', '\%26', '&', '\%3D', '=', '\%2C', ',', '\%3B', ';', '\%2B', '+', '\%25', '%'); } sub GetCookies { local(@ReturnCookies) = @_; local($cookie_flag) = 0; local($cookie,$value); if ($ENV{'HTTP_COOKIE'}) { if ($ReturnCookies[0] ne '') { foreach (split(/; /,$ENV{'HTTP_COOKIE'})) { ($cookie,$value) = split(/=/); foreach $char (@Cookie_Decode_Chars) { $cookie =~ s/$char/$Cookie_Decode_Chars{$char}/g; $value =~ s/$char/$Cookie_Decode_Chars{$char}/g; } foreach $ReturnCookie (@ReturnCookies) { if ($ReturnCookie eq $cookie) { $Cookies{$cookie} = $value; $cookie_flag = "1"; } } } } else { foreach (split(/; /,$ENV{'HTTP_COOKIE'})) { ($cookie,$value) = split(/=/); # foreach $char (@Cookie_Decode_Chars) { $cookie =~ s/$char/$Cookie_Decode_Chars{$char}/g; $value =~ s/$char/$Cookie_Decode_Chars{$char}/g; } $Cookies{$cookie} = $value; } $cookie_flag = 1; } } return $cookie_flag; } sub SetCookies { local(@cookies) = @_; local($cookie,$value,$char); while( ($cookie,$value) = @cookies ) { foreach $char (@Cookie_Encode_Chars) { $cookie =~ s/$char/$Cookie_Encode_Chars{$char}/g; $value =~ s/$char/$Cookie_Encode_Chars{$char}/g; } print 'Set-Cookie: ' . $cookie . '=' . $value . ';'; if ($Cookie_Exp_Date) { print ' expires=' . $Cookie_Exp_Date . ';'; } if ($Cookie_Path) { print ' path=' . $Cookie_Path . ';'; } if ($Cookie_Domain) { print ' domain=' . $Cookie_Domain . ';'; } if ($Secure_Cookie) { print ' secure'; } print "\n"; shift(@cookies); shift(@cookies); } } sub seek_cook { if (&GetCookies('activea')) { $password = $Cookies{'activea'}; $first_time = "no"; } else { $xyz= $FORM{'password'}; $password = crypt($xyz, $salt); $first_time = "yes"; } if ($password eq $active_string) { if ($first_time eq "yes") { &SetCookies('activea',$password); &content; print qq~ $title ~; exit; } } else { &enter_password; exit; } } sub oops { &content; $item = $_[0]; print "Can't open $item "; exit; } sub set_counter { open(MAIN_NEWSBOARD,"$guestbook_data_name"); @main_data = ; $max = 0; foreach $row (@main_data) { @fields = split (/\|/, $row); if ($fields[0] > $max) { $max = $fields[0]; } } # end for each close(MAIN_NEWSBOARD); $max++; &get_file_lock("$location_of_lock_file"); open (NUMBER,">$counter_name"); print NUMBER "$max"; close(NUMBER); &release_file_lock("$location_of_lock_file"); } sub restore_defaults { &seek_cook; open(DEFAULTS,"$prefs_backup_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$prefs_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Standard Preferences Manager

Factory default preferences restored. ~; &inter_footer; } sub restore_language_defaults { &seek_cook; open(DEFAULTS,"$langprefs_backup_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$langprefs_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$months_bak_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$months_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); &content; &main_headera; print qq~ ~; &main_headerb; print qq~

Active Guestbook Language Preferences Manager

Factory default language preferences restored. ~; &inter_footer; } sub check_new_files { unless (-e "$counter_name") { &content; print "The file $counter_name does not exist" ; exit; } unless (-e "$guestbook_data_name") { &content; print "The file $guestbook_data_name does not exist" ; exit; } unless (-e "$prefs_name") { &content; print "The file $prefs_name does not exist" ; exit; } unless (-r "$counter_name") { &content; print "The file $counter_name does can not be read." ; exit; } unless (-r "$guestbook_data_name") { &content; print "The file guestbook_data can not be read." ; exit; } unless (-r "$prefs_name") { &content; print "The file $prefs_name can not be read." ; exit; } unless (-w "$counter_name") { &content; print "The file $counter_name can not be written to." ; exit; } unless (-w "$guestbook_data_name") { &content; print "The file $guestbook_data_name can not be written to." ; exit; } unless (-w "$prefs_name") { &content; print "The file $prefs_name can not be written to." ; exit; } } sub view_langprefs { &seek_cook; &content; # upgrade 2.1 ($TXT_has_been_added_moderated = "Thanks. Your item has been sent to our webmaster and will be added shortly.") if ($TXT_has_been_added_moderated eq ""); print qq~

Active Guestbook - Language Preferences Manager
Active Guestbook - Language Preferences Manager

Return to Guestbook | Return to Control Panel
Restore defaults

Top of main guestbook page.
[ | Active Scripts | ]
1
45
[] [1 2 3 ] []
1
1 10

Search section at bottom of main guestbook page.

- -

<--the text you want to appear in the Search button

Add an item screen.






<--the text you want to appear in the Continue button
<--the text you want to appear when "required" fields are not entered

Add an message preview screen.



<--the text you want to appear when a field is left blank

Message confirmation screen.
<-- Unmoderated setup item
<-- Moderated setup item

Search results screen.
<--Title
<--Link back to guestbook
<-- "No results" item
<-- "One result" item
23 <-- "Multiple results" item

Email address error items.







Other items.
<-- added by
<-- Restricted access
<-- Incorrect password
<-- Too many words in item
<-- Disallowed word
<-- Blocked IP address

Months.
~; } sub view_colprefs { &seek_cook; $ignore = $FORM{'ignore'}; unless ($ignore eq "yes") # only backup when you first enter view_colprefs { open(COLFILE,"$colprefs_name"); @cols = ; close(COLFILE); open(TEMPCOLFILE,">$tempcolprefs_name"); foreach $line (@cols) { print TEMPCOLFILE "$line"; } close(TEMPCOLFILE); } &content; print qq~

Active Guestbook - Color Preferences Manager
Active Guestbook - Color Preferences Manager

Return to Guestbook | Use these colors/Return to Control Panel
Restore FACTORY color defaults | Restore USER color defaults
Cancel all changes made during this visit
Save these colors as USER color defaults
(If you have made any changes, you first need to click VIEW COLORS using the button at the bottom.) ~; ############################ START OF HEADER 1 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF HEADER 1 ############################ START OF Item 1 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF Item 1 ################# NEXT ############################ START OF HEADER 2 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF HEADER 2 ############################ START OF Item 2 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF Item 2 ############################### ############################ START OF MAIN BACKGROUND/TEXT print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF MAIN BACKGROUND/TEXT #################### Start of comment text colors print qq~ ~; ################## End of comment text colors print qq~ ~; print qq~ ~; print qq~ ~; print qq~ ~; print qq~
Transparent item box header: ~; if ($trans_item_header eq "yes") { print qq~ No: - Yes: ~; } else { print qq~ No: - Yes: ~; } print qq~
Transparent item box body: ~; if ($trans_item_body eq "yes") { print qq~ No: - Yes: ~; } else { print qq~ No: - Yes: ~; } print qq~
Transparent search box background: ~; if ($trans_search eq "yes") { print qq~ No: - Yes: ~; } else { print qq~ No: - Yes: ~; } print qq~

These settings override the colors selected below.
Item
Color
Samples
Header 1 background
Header 1
Header 1 text
Item 1 background
Item 1
Item 1 text
Header 2 background
Header 2
Header 2 text
Item 2 background
Item 2
Item 2 text
Main page background
Main text
Main text
Comment text color  
Search box background color
Link color
Visited link color
Active link color
~; } sub edit_colprefs { &seek_cook; ## TEMPCOLFILE now has the last saved preferences open(COLFILE,">$colprefs_name"); print COLFILE "trans_search=$FORM{'trans_search'}=\n"; print COLFILE "trans_item_header=$FORM{'trans_item_header'}=\n"; print COLFILE "trans_item_body=$FORM{'trans_item_body'}=\n"; print COLFILE "data_color1=$FORM{'data_color1'}=\n"; print COLFILE "data_color2=$FORM{'data_color2'}=\n"; print COLFILE "textdata_color1=$FORM{'textdata_color1'}=\n"; print COLFILE "textdata_color2=$FORM{'textdata_color2'}=\n"; print COLFILE "table_color1=$FORM{'table_color1'}=\n"; print COLFILE "table_color2=$FORM{'table_color2'}=\n"; print COLFILE "texttable_color1=$FORM{'texttable_color1'}=\n"; print COLFILE "texttable_color2=$FORM{'texttable_color2'}=\n"; print COLFILE "backcolor=$FORM{'backcolor'}=\n"; print COLFILE "link=$FORM{'link'}=\n"; print COLFILE "vlink=$FORM{'vlink'}=\n"; print COLFILE "alink=$FORM{'alink'}=\n"; print COLFILE "text=$FORM{'text'}=\n"; print COLFILE "commentcolor=$FORM{'commentcolor'}=\n"; print COLFILE "searchcolor=$FORM{'searchcolor'}=\n"; close(COLFILE); &content; print qq~ $title

Now loading new color preferences
~; } ################# sub edit_langprefs { &seek_cook; open(PREFS,">$langprefs_name"); print PREFS "TXT_added_by=$FORM{'TXT_added_by'}=\n"; print PREFS "TXT_incorrect_password=$FORM{'TXT_incorrect_password'}=\n"; print PREFS "TXT_access_is_limited=$FORM{'TXT_access_is_limited'}=\n"; print PREFS "TXT_add_a_item=$FORM{'TXT_add_a_item'}=\n"; print PREFS "TXT_search=$FORM{'TXT_search'}=\n"; print PREFS "TXT_previous=$FORM{'TXT_previous'}=\n"; print PREFS "TXT_next=$FORM{'TXT_next'}=\n"; print PREFS "TXT_there_is_now=$FORM{'TXT_there_is_now'}=\n"; print PREFS "TXT_there_are_now=$FORM{'TXT_there_are_now'}=\n"; print PREFS "TXT_items_in_our_guestbook=$FORM{'TXT_items_in_our_guestbook'}=\n"; print PREFS "TXT_item_in_our_guestbook=$FORM{'TXT_item_in_our_guestbook'}=\n"; print PREFS "TXT_viewing_item=$FORM{'TXT_viewing_item'}=\n"; print PREFS "TXT_viewing_items=$FORM{'TXT_viewing_items'}=\n"; print PREFS "TXT_to=$FORM{'TXT_to'}=\n"; print PREFS "TXT_after_last_number=$FORM{'TXT_after_last_number'}=\n"; print PREFS "TXT_after_last_number1=$FORM{'TXT_after_last_number1'}=\n"; print PREFS "TXT_you_can_search_this_guestbook_by=$FORM{'TXT_you_can_search_this_guestbook_by'}=\n"; print PREFS "TXT_searchitem=$FORM{'TXT_searchitem'}=\n"; print PREFS "TXT_searchname=$FORM{'TXT_searchname'}=\n"; print PREFS "TXT_searchall=$FORM{'TXT_searchall'}=\n"; print PREFS "TXT_searchsearch=$FORM{'TXT_searchsearch'}=\n"; print PREFS "TXT_searchtext=$FORM{'TXT_searchtext'}=\n"; print PREFS "TXT_back_to_guestbook=$FORM{'TXT_back_to_guestbook'}=\n"; print PREFS "TXT_your_name=$FORM{'TXT_your_name'}=\n"; print PREFS "TXT_your_item=$FORM{'TXT_your_item'}=\n"; print PREFS "TXT_required=$FORM{'TXT_required'}=\n"; print PREFS "TXT_news_item_title=$FORM{'TXT_news_item_title'}=\n"; print PREFS "TXT_your_email_address=$FORM{'TXT_your_email_address'}=\n"; print PREFS "TXT_your_web_page_address=$FORM{'TXT_your_web_page_address'}=\n"; print PREFS "TXT_if_you_have_one=$FORM{'TXT_if_you_have_one'}=\n"; print PREFS "TXT_continue=$FORM{'TXT_continue'}=\n"; print PREFS "TXT_these_are_the=$FORM{'TXT_these_are_the'}=\n"; print PREFS "TXT_if_correct=$FORM{'TXT_if_correct'}=\n"; print PREFS "TXT_if_not=$FORM{'TXT_if_not'}=\n"; print PREFS "TXT_go_back=$FORM{'TXT_go_back'}=\n"; print PREFS "TXT_and_edit=$FORM{'TXT_and_edit'}=\n"; print PREFS "TXT_none_given=$FORM{'TXT_none_given'}=\n"; print PREFS "TXT_has_been_added=$FORM{'TXT_has_been_added'}=\n"; print PREFS "TXT_has_been_added_moderated=$FORM{'TXT_has_been_added_moderated'}=\n"; print PREFS "TXT_search_results=$FORM{'TXT_search_results'}=\n"; print PREFS "TXT_back_search_again=$FORM{'TXT_back_search_again'}=\n"; print PREFS "TXT_one_match=$FORM{'TXT_one_match'}=\n"; print PREFS "TXT_no_match=$FORM{'TXT_no_match'}=\n"; print PREFS "TXT_more_matches_1=$FORM{'TXT_more_matches_1'}=\n"; print PREFS "TXT_more_matches_2=$FORM{'TXT_more_matches_2'}=\n"; print PREFS "TXT_please_fill_in=$FORM{'TXT_please_fill_in'}=\n"; print PREFS "TXT_please_go_back_and_edit=$FORM{'TXT_please_go_back_and_edit'}=\n"; print PREFS "TXT_no_dot_at_start=$FORM{'TXT_no_dot_at_start'}=\n"; print PREFS "TXT_no_www_at_start=$FORM{'TXT_no_www_at_start'}=\n"; print PREFS "TXT_no_squiggles_in_domain=$FORM{'TXT_no_squiggles_in_domain'}=\n"; print PREFS "TXT_only_one_at=$FORM{'TXT_only_one_at'}=\n"; print PREFS "TXT_no_dots_next=$FORM{'TXT_no_dots_next'}=\n"; print PREFS "TXT_wrong_end=$FORM{'TXT_wrong_end'}=\n"; print PREFS "TXT_too_many_words=$FORM{'TXT_too_many_words'}=\n"; print PREFS "TXT_disallowed_word=$FORM{'TXT_disallowed_word'}=\n"; print PREFS "TXT_blocked_IP=$FORM{'TXT_blocked_IP'}=\n"; close(PREFS); open(USER_FILE,">$months_name"); print USER_FILE "$FORM{'month_names'}\n"; close(USER_FILE); &content; print qq~ $title
Language preferences updated
~; } sub restore_coldefaults { &seek_cook; open(DEFAULTS,"$colprefs_backup_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$colprefs_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); &content; print qq~ $title ~; print qq~
Color defaults restored
~; } sub restore_user_defaults { &seek_cook; open(DEFAULTS,"$userprefs_backup_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$prefs_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$user_default_html_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$user_html_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$user_default_html_footer_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$user_html_footer_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$thank_you_user_default_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$thank_you_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); &content; &main_headera; print qq~ ~; &main_headerb; print qq~
Active Guestbook Standard Preferences Manager

User default preferences restored. ~; &inter_footer; } sub save_user_defaults { &seek_cook; open(DEFAULTS,"$prefs_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$userprefs_backup_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$user_html_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$user_default_html_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$user_html_footer_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$user_default_html_footer_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); open(DEFAULTS,"$thank_you_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$thank_you_user_default_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); &content; &main_headera; print qq~ ~; &main_headerb; print qq~

Active Guestbook Standard Preferences Manager

Preferences saved as User Defaults ~; &inter_footer; } sub restore_user_color_defaults { &seek_cook; open(DEFAULTS,"$usercolprefs_backup_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$colprefs_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); &content; print qq~ $title ~; print qq~

User color defaults restored
~; } sub save_user_color_defaults { &seek_cook; open(DEFAULTS,"$colprefs_name"); @default_data = ; close(DEFAULTS); open(PREFS,">$usercolprefs_backup_name"); foreach $row (@default_data) { print PREFS "$row"; } close(PREFS); $where=control_panel; &inter_header; print qq~
Active Guestbook
User defaults saved ~; &inter_footer; } sub link_colors { @realcols = (Black, Maroon, Green, Olive, Navy, Purple, Teal, Gray, Silver, Red, Lime, Yellow, Blue, Fuchsia, Aqua, White); foreach $realcols(@realcols) { if ($matchcol eq $realcols) { print "