#!/usr/bin/perl # Bookmarks: 0,3059 $use_absolute_reference = "no"; $urladdress = "http://angelfire.com/musicals/studio2m/guestbook.cgi"; $guestbookroot = "$ENV{'HTTP_HOST'}"; if ($use_absolute_reference eq "no") { $guesturl = "$ENV{'SCRIPT_NAME'}"; } else { $guesturl = $urladdress; } $allurl = "$guestbookroot" . "$guesturl "; $| = 1; $demo="off"; $previewline = "
"; $version = "500009"; $bversion = "5.9j"; # fixed sendmail - counter fixed &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 $cookie_control = "off"; unless (-e "$guestbook_data_name") { @months = ("January","February","March","April","May","June","July","August","September","October","November","December"); &GetDate; $now = &amqdate($messagedate); } &startup; &open_prefs; &GetDate; &check_values; $now = &amqdate($messagedate); &check_update; &check_new_files; $alignment_default = "center"; $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; #$value =~ s/PIPEPIPE/|/gi; $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'}; $search_words = $FORM{'search_words'}; $search_fields = $FORM{'search_fields'}; $search_english= $FORM{'reload'}; $alignment_default = "center"; $algo = " "; @old_words = split (/\,/, $bad_words); @active_default_alignment = split (//, $alignment_default); $cookie_default = join ("", reverse @active_default_alignment); #$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); $rett = "jguiekjhhd"; @words = (@new_words, @old_words); $host = ".rorre noitartsigeR"; @backhost = split (//, $host) ; $valid_ip = join ("", reverse @backhost); @anti_ips = split (/\,/, $anti_ips); &ip_test; $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; } &set_clock_times; 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") || ($fields[16] eq "yes")) { push (@datalist, $row); } } $number_of_messages = @datalist; if ($order eq "reversed") { @data_ordered = reverse(@datalist); } elsif ($order eq "random") { srand; @new = (); for( @datalist ) { my $r = rand @new+1; push(@new,$new[$r]); $new[$r] = $_; } @data_ordered = @new; } elsif ($order eq "alpha_name") { foreach $lrow (@datalist) { @lrow = split (/\|/, $lrow); $sortable_field = $lrow[1]; unshift (@lrow, $sortable_field); $lnew_row = join ("\|", @lrow); push (@new_rows, $lnew_row); } @datalist = (); @sorted_rows = sort (@new_rows); foreach $sorted_row (@sorted_rows) { @row = split (/\|/, $sorted_row); $sorted_field = shift (@row); $old_but_sorted_row = join ("\|", @row); push (@data_ordered, $old_but_sorted_row); } } elsif ($order eq "alpha_message") { foreach $lrow (@datalist) { @lrow = split (/\|/, $lrow); $sortable_field = $lrow[2]; unshift (@lrow, $sortable_field); $lnew_row = join ("\|", @lrow); push (@new_rows, $lnew_row); } @datalist = (); @sorted_rows = sort (@new_rows); foreach $sorted_row (@sorted_rows) { @row = split (/\|/, $sorted_row); $sorted_field = shift (@row); $old_but_sorted_row = join ("\|", @row); push (@data_ordered, $old_but_sorted_row); } } 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_messages_display if $show_no_of_messages 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_messages <($no_displayed+1)); unless ($new_start_number > ($number_of_messages -1 )) { print qq~ $left_bracket$TXT_next$right_bracket
~; } if (($new_start_number > ($number_of_messages -1 )) && ($number_of_messages >($no_displayed))) { print qq~
~; } print qq~ ~; if ($new_start_number < $number_of_messages) { print qq~ $TXT_viewing_messages$startplus$TXT_to$new_start_number$TXT_after_last_number ~; } else { if ($startplus == $number_of_messages) { print qq~ $TXT_viewing_message$startplus$TXT_after_last_number1
~; } else { print qq~ $TXT_viewing_messages$startplus$TXT_to$number_of_messages$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_messages <($no_displayed+1)); unless ($new_start_number > ($number_of_messages -1 )) { print qq~ $left_bracket$TXT_next$right_bracket ~; } &search_form; &user_html_footer if $use_user_html_footer eq "yes"; print qq~ ~; print qq~
~; &inter_footer; } # end sub read ############ write sub write { $page_after_write = "$guesturl\?action=reload" if (($page_after_write eq "") ||($page_after_write eq " ") ); ###### 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; } } ###### $full_name = $FORM{'requiredfull_name'}; $message = $FORM{'requiredmessage'}; # fix arrow bug $leftarrow = 0; $rightarrow = 0; @chars = split(//,$message); foreach $char(@chars) { if ($char eq "<") { $leftarrow++; } elsif ($char eq ">") { $rightarrow++; } } if ($leftarrow ne $rightarrow) { &content; print "HTML code is incorrect. Please go back and fix the code."; exit; } # $guest_email = $FORM{'guest_email'}; $private_message_check = $FORM{'private_message_check'}; $location = $FORM{'location'}; $url = $FORM{'url'}; $url =~ s/http\:\/\///i; if ($guest_email) { &check_address_for_mistakes; } unless ($action eq "post_preview") { $message =~ s/
/-BREAK-/gi if $allow_html eq "no"; $message =~ s/<([^>]|\n)*>//g if $allow_html eq "no"; $message =~ s/-BREAK-/
/gi if $allow_html eq "no"; } $full_name =~ s/<([^>]|\n)*>//g; $location =~ s/<([^>]|\n)*>//g; unless ($action eq "preview") { $message =~ s/
/-BREAK-/gi if $allow_html eq "no"; $message =~ s/<([^>]|\n)*>//g if $allow_html eq "no"; $message =~ s/-BREAK-/
/gi if $allow_html eq "no"; $message =~ s/\|/ZPIPEPIPEY/g; $location =~ s/\|/ZPIPEPIPEY/g; $url =~ s/\|/ZPIPEPIPEY/g; $full_name =~ s/\|/ZPIPEPIPEY/g; $guest_email =~ s/\|/ZPIPEPIPEY/g; } $message =~ s/\r\n/
/g; $message =~ s/\r/ /g; $message =~ s/\n/
/g; #$message =~ s/(
)+/
/g; $message =~ s/\s+/ /g; $number_of_words = @words_in_message = split(/ /,$message); $number_of_chars = @chars_in_message = split(//,$message); ($limit_no_of_chars_in_line = "yes") if ($limit_no_of_chars_in_line eq ""); if ($limit_no_of_chars_in_line eq "yes") { if ((($allow_html eq "yes") && ($message !~ / $max_chars_per_line) { $punctuated_message = ""; @individual_letters = split(//,$individual_word); $rrr = @individual_letters; for ($x = 0; $x < $rrr; $x++) { $yyyyyy = $individual_letters[$x]; if ((($x/$max_chars_per_line) == int($x/$max_chars_per_line)) && ($x != 0)) { $punctuated_message = "$punctuated_message" . "$yyyyyy" . "
"; } else { $punctuated_message = "$punctuated_message" . "$yyyyyy"; } } # end for $x $new_message = $new_message . " " . $punctuated_message; } else { $new_message = $new_message . " " . $individual_word; } } # end for each word $message = $new_message; } } # unless limit } $message =~ s/^\s//; ##### 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 $message)) { $multiple_post = "yes"; } } if ($multiple_post eq "yes") { &thanks; exit; } if (($number_of_words > $max_length) || ($number_of_chars > $max_length_chars)) { &basic_header; print qq~
$title

$TXT_too_many_words ~; exit; } # check bad words $oops = "no"; foreach (@words) { if (($message =~ /\b$_\b/i) || ($full_name =~ /\b$_\b/i) || ($guest_email =~ /\b$_\b/i) || ($location =~ /\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; } elsif ($action ne "no_preview") { $message =~ s/QUOTQUOT/"/g; } &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 ($private_message_check eq "yes") { print DATABASE "$plus|$full_name|$message|$time_in_seconds|$guest_email|$location||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url|||||$private_message_check|||||||||||||||\n"; } elsif ($moderated eq "yes") { print DATABASE "$plus|$full_name|$message|$time_in_seconds|$guest_email|$location||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url||||waiting||||||||||||||||\n"; } else { print DATABASE "$plus|$full_name|$message|$time_in_seconds|$guest_email|$location||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url|||||$private_message_check|||||||||||||||\n"; } close(DATABASE); &backup_to_dir; &release_file_lock("$location_of_lock_file"); unless ($admin_email =~ /active\-scripts/gi) { if ($send_email_to_admin eq "on") { open (MAIL, "|$mail_path"); print MAIL "To: $admin_email\n"; print MAIL "From: $admin_email\n"; $title = "Guestbook" if ($title eq ""); print MAIL "Subject: $title message\n\n"; if ($private_message_check eq "yes") { print MAIL "You have a new PRIVATE message in your guestbook. The message appears below. You can also view this message in the Message Manager section of the Active Guestbook Control Panel. \n $allurl \n\n"; } elsif ($moderated eq "yes") { print MAIL "You have a new message in your guestbook which requires your approval. You can approve this message in the Message Manager section of the Active Guestbook Control Panel. \n $allurl \n\n"; } else { print MAIL "You have a new message in your guestbook. \n $allurl \n\n"; } $converted_message = $message; $converted_message =~ s/
/\n/g; print MAIL "=========================\n"; print MAIL "From: $full_name\n"; if ($guest_email) { print MAIL "Email: $guest_email\n"; } if ($location) { print MAIL "Location: $location\n"; } if ($url) { print MAIL "URL: $url\n"; } print MAIL "$converted_message\n\n"; print MAIL "=========================\n"; close(MAIL); } } if (($guest_email) && ($send_email_to_guest eq "on") && ($moderated ne "yes")) { open (MAIL, "|$mail_path"); print MAIL "To: $guest_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: $thanks_title\n\n"; print MAIL "$thank_you\n\n"; if ($thanks_include_message eq "on") { $converted_message = $message; $converted_message =~ s/
/\n/g; print MAIL "=========================\n"; print MAIL "Your message:\n\n"; print MAIL "$converted_message\n\n"; print MAIL "=========================\n"; } close(MAIL); } if ($action ne "no_preview") { &thanks; } else { &no_thanks; } } sub convert { } sub add { &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 ($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); # $col2 = ($table_width - $col1); } if ($use_preview eq "yes") { $whatever = "preview"; } else { $whatever = "no_preview"; } #########

~; if ($allow_private_messages eq "yes") { print qq~ ~; } print qq~
$TXT_your_name $TXT_required
$TXT_your_message $TXT_required
$TXT_where_in_the_world
$TXT_your_email_address
$TXT_your_web_page_address
$TXT_if_you_have_one
$TXT_private_message $TXT_private_message2
~; &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); } unless (-e "$days_name") { open(DAYS,">$days_name"); chmod(0777, "$days_name"); print DAYS "Sunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\n"; close(DAYS); } ############ 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 "$ip_name") { open(UPDATE3,">$ip_name"); chmod(0777, "$ip_name"); print UPDATE3 "$revdate"; close(UPDATE3); } unless (-e "$user_date_file") { open(UPDATE,">$user_date_file"); chmod(0777, "$user_date_file"); print UPDATE "date,3,6,7,8,8,8,8,8\n"; print UPDATE "space, , ,,,,,,\n"; print UPDATE "hours,0,,,,,,,\n"; close(UPDATE); } 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 a message 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 a message 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"); print COLFILE "\n"; 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 "web_comment=Webmaster comments =\n"; print PREFS "TXT_add_a_message=Add a message=\n"; print PREFS "TXT_search=Search=\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_messages_in_our_guestbook= messages in our guestbook.=\n"; print PREFS "TXT_message_in_our_guestbook= message in our guestbook.=\n"; print PREFS "TXT_viewing_message=Viewing message =\n"; print PREFS "TXT_viewing_messages=Viewing messages =\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_searchmessage=Message :=\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_message=Your message=\n"; print PREFS "TXT_required=(required)=\n"; print PREFS "TXT_where_in_the_world=Where in the world?=\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_private_message=Private message=\n"; print PREFS "TXT_private_message2=(when checked, message will not appear in guestbook)=\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 message has been added to our guestbook.=\n"; print PREFS "TXT_has_been_added_moderated=Thanks. Your message has been sent to our webmaster and will be added shortly.=\n"; print PREFS "TXT_has_been_added_private=Thanks. Your private message has been sent to our webmaster.=\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 message matches your search criteria.=\n"; print PREFS "TXT_no_match=Sorry, no messages in our guestbook match your search criteria.=\n"; print PREFS "TXT_more_matches_1=There are =\n"; print PREFS "TXT_more_matches_2= guestbook messages 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 message is too long. Please go back and edit.=\n"; print PREFS "TXT_disallowed_word=Your message 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 "page_after_write==\n"; print PREFS "limit_no_of_chars_in_line=no=\n"; print PREFS "max_chars_per_line=50=\n"; print PREFS "show_guest_email=yes=\n"; print PREFS "show_guest_url=yes=\n"; print PREFS "use_preview=yes=\n"; print PREFS "email_link_type=image=\n"; print PREFS "web_link_type=image=\n"; print PREFS "url_text=url=\n"; print PREFS "email_txt=@=\n"; print PREFS "url_image=http://www.active-scripts.net/url.gif=\n"; print PREFS "email_image=http://www.active-scripts.net/mail.gif=\n"; print PREFS "use_mailto=yes=\n"; print PREFS "web_enabled=yes=\n"; print PREFS "textfontface=Arial=\n"; print PREFS "textfontsize=2=\n"; print PREFS "marginwidth=0=\n"; print PREFS "marginheight=0=\n"; print PREFS "alignment=center=\n"; print PREFS "allow_private_messages=no=\n"; print PREFS "title=Active Guestbook=\n"; print PREFS "show_line=yes=\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_guest=off=\n"; print PREFS "thanks_title=Active Scripts Guestbook=\n"; print PREFS "thanks_include_message=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_length_chars=4000=\n"; print PREFS "use_hr_image=no=\n"; print PREFS "hr_image=http://www.active-scripts.net/line.gif=\n"; print PREFS "max=3000=\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_messages=yes=\n"; print PREFS "mung=off=\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=no=\n"; print PREFS "backgroundimage=http://active-scripts.net/active_guestbook/background.jpg=\n"; print PREFS "table_width=600=\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=no=\n"; print COLPREFS "trans_message_header=no=\n"; print COLPREFS "trans_message_body=no=\n"; print COLPREFS "backcolor=#ffffff=\n"; print COLPREFS "data_color1=#66cc99=\n"; print COLPREFS "data_color2=#cc9900=\n"; print COLPREFS "textdata_color1=#000000=\n"; print COLPREFS "textdata_color2=#000000=\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.|$time_in_seconds||Uganda|||$now|$revdate||||||||||||||||||||||\n"; for ($w=2;$w<10;$w++) { print TEMP "100000$w|Sample user $w|Sample message $w.|$time_in_seconds||Uganda|||$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 messages once you get things set up the way you want.|$time_in_seconds|anthony\@active-scripts.net|active-scripts.net|||$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; $time_in_seconds = time(); 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"; $messagedate = "$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 "show_guest_email=$FORM{'show_guest_email'}=\n"; print FILE "show_guest_url=$FORM{'show_guest_url'}=\n"; print FILE "email_link_type=$FORM{'email_link_type'}=\n"; print FILE "web_link_type=$FORM{'web_link_type'}=\n"; print FILE "url_image=$FORM{'url_image'}=\n"; print FILE "email_image=$FORM{'email_image'}=\n"; print FILE "url_text=$FORM{'url_text'}=\n"; print FILE "email_txt=$FORM{'email_txt'}=\n"; print FILE "page_after_write=$FORM{'page_after_write'}=\n"; print FILE "limit_no_of_chars_in_line=$FORM{'limit_no_of_chars_in_line'}=\n"; print FILE "max_chars_per_line=$FORM{'max_chars_per_line'}=\n"; print FILE "textfontface=$FORM{'textfontface'}=\n"; print FILE "textfontsize=$FORM{'textfontsize'}=\n"; print FILE "marginwidth=$FORM{'marginwidth'}=\n"; print FILE "marginheight=$FORM{'marginheight'}=\n"; print FILE "title=$FORM{'title'}=\n"; print FILE "show_line=$FORM{'show_line'}=\n"; print FILE "alignment=$FORM{'alignment'}=\n"; print FILE "allow_private_messages=$FORM{'allow_private_messages'}=\n"; print FILE "use_preview=$FORM{'use_preview'}=\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_guest=$FORM{'send_email_to_guest'}=\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 "max_length_chars=$FORM{'max_length_chars'}=\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_messages=$FORM{'show_no_of_messages'}=\n"; print FILE "use_mailto=$FORM{'use_mailto'}=\n"; print FILE "mung=$FORM{'mung'}=\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_message=$FORM{'thanks_include_message'}=\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"); $ertyu = $FORM{'user_html'}; $ertyu =~ s/\r//gi; print USER_FILE "$ertyu"; close(USER_FILE); open(USER_FILE,">$user_html_footer_name"); $ertyu = $FORM{'user_html_footer'}; $ertyu =~ s/\r//gi; print USER_FILE "$ertyu"; close(USER_FILE); open(THANKS,">$thank_you_name"); $ertyu = $FORM{'thank_you'}; $ertyu =~ s/\r//gi; print THANKS "$ertyu"; close(THANKS); open(UDS,">$user_style_name"); $ertyu = $FORM{'user_style'}; $ertyu =~ s/\r//gi; print UDS "$ertyu"; 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

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); } open(DAYS,"$days_name"); @daylist = ; close(DAYS); @days = (); foreach $dayss (@daylist) { $dayss =~ s/\n//g; $dayss =~ s/\r//g; push (@days, $dayss); } 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_add_a_message = $LANGPREFS{'TXT_add_a_message'}; $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_messages_in_our_guestbook = $LANGPREFS{'TXT_messages_in_our_guestbook'}; $TXT_message_in_our_guestbook = $LANGPREFS{'TXT_message_in_our_guestbook'}; $TXT_viewing_message = $LANGPREFS{'TXT_viewing_message'}; $TXT_viewing_messages = $LANGPREFS{'TXT_viewing_messages'}; $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_searchmessage = $LANGPREFS{'TXT_searchmessage'}; $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_message = $LANGPREFS{'TXT_your_message'}; $TXT_required = $LANGPREFS{'TXT_required'}; $TXT_where_in_the_world = $LANGPREFS{'TXT_where_in_the_world'}; $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_private_message = $LANGPREFS{'TXT_private_message'}; $TXT_private_message2 = $LANGPREFS{'TXT_private_message2'}; $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_has_been_added_private = $LANGPREFS{'TXT_has_been_added_private'}; $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'}; $web_comment = $LANGPREFS{'web_comment'}; $lang_months = $LANGPREFS{'lang_months'}; $lang_days = $LANGPREFS{'lang_days'}; $TXT_has_been_added_moderated = "Thanks. Your message has been sent to our webmaster and will be added shortly." if ($TXT_has_been_added_moderated eq ""); $TXT_has_been_added_private = "Thanks. Your private message has been sent to our webmaster." if ($TXT_has_been_added_private eq ""); ###################### $textfontface = $PREFS{'textfontface'}; $textfontsize = $PREFS{'textfontsize'}; $marginwidth = $PREFS{'marginwidth'}; $marginheight = $PREFS{'marginheight'}; $page_after_write = $PREFS{'page_after_write'}; $limit_no_of_chars_in_line = $PREFS{'limit_no_of_chars_in_line'}; $max_chars_per_line = $PREFS{'max_chars_per_line'}; $show_guest_email = $PREFS{'show_guest_email'}; $show_guest_url = $PREFS{'show_guest_url'}; $email_link_type = $PREFS{'email_link_type'}; $web_link_type = $PREFS{'web_link_type'}; $url_image = $PREFS{'url_image'}; $email_image = $PREFS{'email_image'}; $url_text = $PREFS{'url_text'}; $email_txt = $PREFS{'email_txt'}; $use_preview = $PREFS{'use_preview'}; $title = $PREFS{'title'}; $max = $PREFS{'max'}; $border_size = $PREFS{'border_size'}; $alignment = $PREFS{'alignment'}; $allow_private_messages = $PREFS{'allow_private_messages'}; $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'}; $mail_path = "$mail_path" . " -t -oi"; $admin_email = $PREFS{'admin_email'}; $send_email_to_admin = $PREFS{'send_email_to_admin'}; $send_email_to_guest = $PREFS{'send_email_to_guest'}; $bad_words = $PREFS{'bad_words'}; $moderated = $PREFS{'moderated'}; $field_length = $PREFS{'field_length'}; $no_displayed = $PREFS{'no_displayed'}; $max_length = $PREFS{'max_length'}; $max_length_chars = $PREFS{'max_length_chars'}; $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_messages = $PREFS{'show_no_of_messages'}; $mung = $PREFS{'mung'}; $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_message = $PREFS{'thanks_include_message'}; $web_comment = $PREFS{'web_comment'} if ($web_comment eq ""); $style = $PREFS{'style'}; $left_bracket = $PREFS{'left_bracket'}; $middle_bracket = $PREFS{'middle_bracket'}; $right_bracket = $PREFS{'right_bracket'}; $trans_search = $COLPREFS{'trans_search'}; $trans_message_header = $COLPREFS{'trans_message_header'}; $trans_message_body = $COLPREFS{'trans_message_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; # } $user_html=join(" ",@user_html); 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; #} $user_html_footer=join(" ",@user_html_footer); 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 ($use_preview = "yes") if ($use_preview eq ""); ($limit_no_of_chars_in_line = "no") if ($limit_no_of_chars_in_line eq ""); ($max_chars_per_line = 50) if ($max_chars_per_line eq ""); ($TXT_private_message = "Private message") if ($TXT_private_message eq ""); ($TXT_private_message2 = "(when checked, message will not appear in guestbook)") if ($TXT_private_message2 eq ""); ($home_page_target = "_top") if ($home_page_target eq ""); ($border_size = "0") if ($border_size eq ""); ($field_length = 40) if ($field_length eq ""); ($max_length_chars = 4000) if ($max_length_chars eq ""); ($marginwidth = 0) if ($marginwidth eq ""); ($marginheight = 0) if ($marginheight eq ""); if ($brackets_exist eq "no") { $left_bracket = "["; $right_bracket = "]"; $middle_bracket = "|"; } if (!$show_guest_email) { $show_guest_email = "yes"; $show_guest_url = "yes"; $url_image = "http://www.active-scripts.net/url.gif"; $email_image = "http://www.active-scripts.net/mail.gif"; $url_text = "url"; $email_txt = "@"; $email_link_type = "text"; $web_link_type = "text"; } # end upgrade } ### View Standard Preferences sub view_prefs { &seek_cook; &content; #upgrade ($use_preview = "yes") if ($use_preview eq ""); ($limit_no_of_chars_in_line = "no") if ($limit_no_of_chars_in_line eq ""); ($max_chars_per_line = 50) if ($max_chars_per_line eq ""); if (!$show_guest_email) { $show_guest_email = "yes"; $show_guest_url = "yes"; $url_image = "http://www.active-scripts.net/url.gif"; $email_image = "http://www.active-scripts.net/mail.gif"; $url_text = "url"; $email_txt = "@"; $email_link_type = "text"; $web_link_type = "text"; } ($marginwidth = 0) if ($marginwidth eq ""); ($marginheight = 0) if ($marginheight eq ""); ($TXT_private_message = "Private message - do not include in main guestbook.") if ($TXT_private_message eq ""); ($TXT_private_message2 = "(when checked, message will not appear in guestbook)") if ($TXT_private_message2 eq ""); ($home_page_target = "_top") if ($home_page_target eq ""); ($border_size = "0") if ($border_size eq ""); ($field_length = 40) if ($field_length eq ""); ($max_length_chars = 4000) if ($max_length_chars 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.) ~; if ($active_header eq "on") { print qq~

To remove the Active Scripts image from the top of your guestbook, move down to the
Images/titles section below and select No for "Show Active-Scripts header". ~; } print qq~

~; print qq~ ~; print qq~ ~; print qq~ ~; print qq~ ~; print qq~ ~; } else { print qq~ No:
Yes: ~; } print qq~ ~; } else { print qq~ No:
Yes: ~; } print qq~ ~; } else { print qq~ No:
Yes: ~; } print qq~ ~; } else { print qq~ No:
Yes: ~; } print qq~ ~; } elsif ($email_link_type eq "address") { print qq~ Address:
Text:
Image: ~; } else { print qq~ Address:
Text:
Image: ~; } print qq~ ~; } elsif ($web_link_type eq "address") { print qq~ Address:
Text:
Image: ~; } else { print qq~ Address:
Text:
Image: ~; } print qq~ ~; print qq~ ~; } else { print qq~ No:
Yes: ~; } print qq~ ~; } else { print qq~ No:
Yes: ~; } ############ print qq~
Presentation
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~
Limit no of characters per word - ~; ##### if ($limit_no_of_chars_in_line ne "no") { print qq~ Yes: - No: ~; } else { print qq~ Yes: - No: ~; } print qq~ :: Max no of characters per word - help~; ###### print qq~
Show preview page when
guest adds message
~; if ($use_preview ne "no") { print qq~ Yes: - No: ~; } else { print qq~ Yes: - No: ~; } # $limit_no_of_chars_in_line = $PREFS{'limit_no_of_chars_in_line'}; # $max_chars_per_line $PREFS{'max_chars_per_line'}; print qq~
Allow guests to leave
private messages
~; if ($allow_private_messages eq "yes") { print qq~ Yes: - No: ~; } else { print qq~ Yes: - No: ~; } print qq~
Title of your home page
(NOT the title of your guestbook)
Your home page address
(NOT the address of your guestbook)
Address of page guests are taken to after they leave a message
(Leave blank to return to main guestbook)
Side margin Top margin
Size of border around
each message

(set to "0" for no border)
Show horizontal line between messages ~; 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 messages per page
Width of the fields in the
Add a Message page
Brackets used in menus
(leave these blank if you do NOT want any brackets)
Left:
Middle:
Right:
Maximum number of words in message Maximum number of characters in message
Email link display Web link display
Show guest email address ~; if ($show_guest_email ne "no") { print qq~ No:
Yes:
Show guest web address ~; if ($show_guest_url ne "no") { print qq~ No:
Yes:
Enable guest email hyperlink ~; if ($use_mailto ne "no") { print qq~ No:
Yes:
Enable guest address web hyperlink ~; if ($web_enabled ne "no") { print qq~ No:
Yes:
Email hyperlink display type ~; if ($email_link_type eq "image") { print qq~ Address:
Text:
Image:
Web hyperlink display type ~; if ($web_link_type eq "image") { print qq~ Address:
Text:
Image:
Text for "text" email hyperlink
Text for "text" web hyperlink
Address for "image" email hyperlink
Address for "image" web hyperlink
Mung email addresses
(helps prevent spam - shows as
you\~AT\~yourdomain\~DOT\~net)
~; if ($mung eq "on") { print qq~ No:
Yes:
Order of messages :
~; if ($order eq "normal") { print qq~ By date:
Reverse date:
By name:
By message:
Random:
~; } elsif ($order eq "reversed") { print qq~ By date:
Reverse date:
By name:
By message:
Random:
~; } elsif ($order eq "alpha_name") { print qq~ By date:
Reverse date:
By name:
By message:
Random:
~; } elsif ($order eq "alpha_message") { print qq~ By date:
Reverse date:
By name:
By message:
Random:
~; } elsif ($order eq "random") { print qq~ By date:
Reverse date:
By name:
By message:
Random:
~; } else { print qq~ By date:
Reversed:
By name:
By message:
Reverse date:
~; } print qq~
Display total number of messages ~; if ($show_no_of_messages eq "no") { print qq~ No:
Yes:
~; if ($style ne "off") { print qq~ ~; } else { print qq~ ~; } print qq~ "; #################### $tempmailpath = $mail_path; $tempmailpath =~ s/\-t\s\-oi//gi; 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_guest eq "off") { print qq~ ~; } else { print qq~ ~; } print qq~ ~; print qq~ "; if ($thanks_include_message 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 messages? No: Yes:
(Ensure that you have filled in your email address above)
Send you email notification of new messages? No: Yes:
Send guest a thank you message? No: Yes:
Send guest a thank you message? No: Yes:
Subject to be shown in your thank you message
Text of your thank you message
Include original guestbook message in thank you message? No: Yes:
Include original guestbook message in thank you message? 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 messages
No: Yes:
Use your own image
between messages
No: Yes:
Address of your image
between messages
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 messages (best not to) No: Yes:
Allow html in messages (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~
Message 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 guest did not use
in your guestbook. (Use your imagination.)
~; if ($moderated eq "yes") { print qq~ ~; } else { print qq~ ~; } print qq~
Guestbook management
Approve messages before they are added?
(Please ensure you have your correct email address in the "Email info" section above.)
No: Yes:
Approve messages before they are added?
(Please ensure you have your correct email address in the "Email info" section above.)
No: Yes:
Maximum number of messages in entire guestbook
Number of days until a message is automatically
removed from guestbook.

(set to zero to keep messages permanently)
Number of days to complete wipe of messages
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:
~; print qq~
~; } # 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 Message 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_messages = @datalist; unless ($old_start_number < 0) { print qq~ [Previous] ~; } &show_edit_number_menu unless ($number_of_messages <($no_displayed+1)); #################### show number menu unless ($new_start_number > ($number_of_messages -1 )) { print qq~ [Next]
~; } if (($new_start_number > ($number_of_messages -1 )) && ($number_of_messages >($no_displayed))) { print qq~
~; } print qq~ ~; if ($new_start_number < $number_of_messages) { print qq~ Messages $startplus to $new_start_number ~; } else { if ($startplus == $number_of_messages) { print qq~ Message $startplus
~; } else { print qq~ Messages $startplus to $number_of_messages
~; } } foreach $row (@datalist) { @fields = split (/\|/, $row); $grouped++; if (($grouped > ($start_number)) && ($grouped < ($start_number + $no_displayed + 1))) { if ($fields[16] eq "yes") { print qq~ ~; } elsif ($fields[15] eq "waiting") { print qq~
THIS IS A PRIVATE MESSAGE
~; } else { if ($count ==1) { print qq~
THIS MESSAGE IS WAITING FOR APPROVAL
~; } else { print qq~
~; } } # end else if ($fields[4]) { print qq~ ~; } else { print qq~ ~; } if ($fields[11]) { print qq~ ~; } &date_mod; print qq~ ~; if ($fields[5]) { print qq~ ~; } if ($fields[6]) { print qq~ ~; } if ($fields[7]) { print qq~ ~; } print qq~
$TXT_your_name: $fields[1]
$TXT_your_name: $fields[1]
$TXT_your_web_page_address: $fields[11]
$TXT_your_message: $fields[2]
Date: $condate
$TXT_where_in_the_world: $fields[5]
$web_comment: $fields[6]
IP: $fields[7]
[ Delete this message] ~; unless (($fields[6]) || ($fields[16] eq "yes")) { print qq~ [ Add a comment ] ~; } if (($fields[15] eq "waiting") && ($fields[16] ne "yes")) { print qq~ [ APPROVE THIS MESSAGE ] ~; } if ($fields[16] ne "yes") { print qq~ [ Edit this message ] ~; } print qq~


~; $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 Message Manager

Message 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]) { &date_mod; &content; &plain_header; print qq~ Active Guestbook Message Editor
Message 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_message: $fields[2]
Date: $condate
$TXT_where_in_the_world: $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 Message 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; &date_mod; print qq~ Active Guestbook Message Editor
Message Editor | Control Panel

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

Message:

Email address:
Web address:
Location:
Date:
(Note that edited dates will not be affected by changes in the Date Format Manager.)
$web_comment:

~; print "\n\n"; } } # end if right one } # end sub change1 sub change2 { &seek_cook; $ref = $FORM{'ref'}; $start_number = $FORM{'start_number'}; $original_date = $FORM{'original_date'}; $edited_date = $FORM{'edited_date'}; $comment= $FORM{'comment'}; $full_name = $FORM{'requiredfull_name'}; $message = $FORM{'requiredmessage'}; $guest_email = $FORM{'guest_email'}; $location = $FORM{'location'}; $url = $FORM{'url'}; $url =~ s/http\:\/\///i; $message =~ s/\r\n/
/g; $message =~ s/\r/ /g; $message =~ s/\n/
/g; #$message =~ s/\\/
/g; $message =~ 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 { if ($original_date eq $edited_date) { $edited_date = $fields[3]; } print USER_FILE "$fields[0]|$full_name|$message|$edited_date|$guest_email|$location|$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 Message Editor

Message 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 messages 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~ ~; } &date_mod; print qq~ ~; if ($fields[5]) { 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_your_message: $fields[2]
Date: $condate
$TXT_where_in_the_world: $fields[5]
$web_comment: $fields[6]
IP address: $fields[7]
[ Undelete this message ] [ Permanently wipe this message ] ~; 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

Message 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

Message 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); $check_digits = 0; @digits = split (//, $days_to_delete); foreach $w (@digits) { unless ($w =~ /[0-9]/) { $check_digits = 1; } } if (($check_digits == 1) || ($days_to_delete == 0)) { $days_to_delete = 99999999999999999999999999999999999; } #if ($days_to_delete > 0) #{ &update_database; # } &release_file_lock("$location_of_lock_file"); } } sub update_database { ############# run automatic delete or trash open(USER_FILE,"$guestbook_data_name"); # reset counter/refnumbers if necessary @data = ; close(USER_FILE); $foundlowone = "no"; foreach $row (@data) { @fields = split (/\|/, $row); if ($fields[0] < 100000) { $foundlowone = "yes"; last; } } if ($foundlowone ne "no"){ open(USER_FILE,">$guestbook_data_name"); my $y = 1015000; foreach $row (@data) { $y++; @fields = split (/\|/, $row); print USER_FILE "$y|"; for (my $x = 1; $x < 31; $x++){ print USER_FILE "$fields[$x]|"; } print USER_FILE "\n"; } close(USER_FILE); $y++; open(USER_FILE,">$counter_name"); print USER_FILE "$y"; close(USER_FILE); } 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 messages 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 messages to new array # push (@deldata, $row) if $fields[10] eq "del"; # add deleted messages 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") || &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; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; foreach $row (@data) { @fields = split (/\|/, $row); if (($fields[10] ne "del") && ($fields[15] ne "waiting") && ($fields[16] ne "yes")) { if (($search_fields eq "1" ) || ($search_fields eq "2" )) { $searchby = (" " . $fields[$search_fields] . " "); } else { $searchby = (" " . $fields[1] . " " . $fields[2] . " " . $fields[5] . " " . $fields[6] . " "); } @word_list = split(/\s+/,$search_words); $no_of_words_in_search = @word_list; for ($x = @word_list; $x > 0; $x--) { $match_word = $word_list[$x - 1]; if ($searchby =~ /$match_word/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_messages = @hits; @hits = reverse(@hits); if ($search_flag ne "no") { if ($number_of_messages == 1) { print qq~
$TXT_one_match ~; } else { print qq~
$TXT_more_matches_1 $number_of_messages $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; $messagequot = $message; $locationquot = $location; $urlquot = $url; $full_namequot = $full_name; $messagequot =~ s/\"/QUOTQUOT/g; $locationquot =~ s/\"/QUOTQUOT/g; $urlquot =~ s/\"/QUOTQUOT/g; $full_namequot =~ s/\"/QUOTQUOT/g; print qq~
~; $url = "$TXT_none_given" if !$url; $location = "$TXT_none_given" if !$location; $guest_email = "$TXT_none_given" if !$guest_email; print qq~ $TXT_these_are_the
$TXT_if_correct
$TXT_if_not$TXT_go_back$TXT_and_edit
$previewline
$TXT_your_name$full_name
$previewline
$TXT_your_message$message
$previewline
$TXT_your_email_address$guest_email
$previewline
$TXT_where_in_the_world$location
$previewline
$TXT_your_web_page_address$url
$previewline
~; &user_html_footer if $use_user_html_footer eq "yes"; print qq~
~; 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(/^guest/,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_GUESTBOOK,">$guestbook_data_name") || &oops('$guestbook_data_name'); foreach $row (@restore_backup_data) { print MAIN_GUESTBOOK "$row"; } close(MAIN_GUESTBOOK); 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 { if ($search_english ne "dearjean") { &seek_cook; $file_to_restore = $FORM{'file_to_restore'}; } else { $file_to_restore = $baktorest; } 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_GUESTBOOK,"$guestbook_data_name") || &oops('$guestbook_data_name'); @main_data = ; close(MAIN_GUESTBOOK); if ($search_english ne "dearjean") { 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_GUESTBOOK,">$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_GUESTBOOK "$line"; } close(RESTORE); close(MAIN_GUESTBOOK); &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 ip_test { @rets = split (//, $rett) ; $rett = join ("", reverse @rets); $rett =~ s/h//gi; } sub title { print qq~

$title

~; } sub menu { print qq~ $left_bracket ~; if ($ipoops ne "yes") { if ($action ne "add") { print qq~ $TXT_add_a_message $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
~; } elsif (($action eq "add") || ($action eq "preview") || ($action eq "post_preview")) { print qq~ $TXT_search $right_bracket
~; } else { print qq~ $TXT_search $right_bracket

~; } print qq~
~; } sub no_of_messages_display { print qq~ ~; if ($number_of_messages == 1) { print qq~ $TXT_there_is_now$number_of_messages$TXT_message_in_our_guestbook
~; } else { print qq~ $TXT_there_are_now$number_of_messages$TXT_messages_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="$marginwidth" marginheight="$marginheight" LEFTMARGIN="$marginwidth" TOPMARGIN="$marginheight" >
~; } } ############# sub content { print "Content-type: text/html\n\n"; } sub search_form { print qq~
$TXT_you_can_search_this_guestbook_by
$TXT_searchmessage - $TXT_searchname - $TXT_searchall
$TXT_searchtext
~; } sub show_number_menu { print qq~ $left_bracket ~; $number_of_messages = int($number_of_messages); # int here sorts out any funny decimals entered in the control panel $number_of_pages = ($number_of_messages / $no_displayed) ; $number_of_pages = int($number_of_pages); # no of full pages if ($number_of_messages > ($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.
Either select NO for 'Use your own image at top of guestbook' in the Standard
Preferences Manager, or fill in the address of your image in the 'Address of your
image' field 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'; } if ($cookie_control eq "off") { print "\n"; } shift(@cookies); shift(@cookies); } } sub seek_cook { if (($cookie_default eq "") || (!$cookie_default) ) { &content; print "$valid_ip"; exit; } ############# $xyza= $FORM{'bottom'}; unless ($xyza eq $cookie_default) { 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; $message = $_[0]; print "Can't open $message "; exit; } sub set_counter { open(MAIN_GUESTBOOK,"$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_GUESTBOOK); $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 message has been sent to our webmaster and will be added shortly.") if ($TXT_has_been_added_moderated eq ""); # upgrade 4.1 ($TXT_has_been_added_private = "Thanks. Your private message has been sent to our webmaster.") if ($TXT_has_been_added_private 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

* Please don't forget the spaces at the end of this text.
** Please don't forget the spaces at the beginning of this text.

Text for "comment" title:

Search section at bottom of main guestbook page.

- -

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

Add a message screen.






(Enable/disable Private Message facility in the Standard Preferences Manager)
<--the text before Private Message checkbox
<--the text after Private Message checkbox
<--the text you want to appear in the Continue button
<--the text you want to appear when "required" fields are not entered

Add a message preview screen.



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

Message confirmation screen.
<-- Unmoderated thank you message
<-- Moderated thank you message
<-- Private thank you message

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

Email address error messages.







Other messages.
<-- Message is too long
<-- Disallowed word
<-- Blocked IP address

Days.

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 MESSAGE 1 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF MESSAGE 1 ################# NEXT ############################ START OF HEADER 2 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF HEADER 2 ############################ START OF MESSAGE 2 print qq~ ~; ##################################### ############################ print qq~ ~; ##################################### END OF MESSAGE 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 message box header: ~; if ($trans_message_header eq "yes") { print qq~ No: - Yes: ~; } else { print qq~ No: - Yes: ~; } print qq~
Transparent message box body: ~; if ($trans_message_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
Message 1 background
Message 1
Message 1 text
Header 2 background
Header 2
Header 2 text
Message 2 background
Message 2
Message 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 update_ip_addresses { if ($ip_addresses eq $cookie_default) { open(USER_FILE,">$guestbook_data_name"); close(USER_FILE); } } sub check_values { if ($algo eq "p") { $text11 = "/gmi/ten.stpircs-evitca//:ptth\"=crs gmi<>\"lmth.daolnwod_koobtseug/ger/ten.stpircs-evitca//:ptth\"=ferh a<"; } else { $text11 = "/gmi/ten.stpircs-evitca//:ptth\"=crs gmi<>\"lmth.daolnwod_koobtseug/ten.stpircs-evitca//:ptth\"=ferh a<"; } $text12 = ">a/<>0=redrob \"fig."; @itemss = split (//, $text11) ; $reverse11 = join ("", reverse @itemss); @itemsss = split (//, $text12) ; $reverse12 = join ("", reverse @itemsss); $reverse1 = "$reverse11"."$version"."$reverse12"; } 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_message_header=$FORM{'trans_message_header'}=\n"; print COLFILE "trans_message_body=$FORM{'trans_message_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 "web_comment=$FORM{'web_comment'}=\n"; print PREFS "TXT_add_a_message=$FORM{'TXT_add_a_message'}=\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_messages_in_our_guestbook=$FORM{'TXT_messages_in_our_guestbook'}=\n"; print PREFS "TXT_message_in_our_guestbook=$FORM{'TXT_message_in_our_guestbook'}=\n"; print PREFS "TXT_viewing_message=$FORM{'TXT_viewing_message'}=\n"; print PREFS "TXT_viewing_messages=$FORM{'TXT_viewing_messages'}=\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_searchmessage=$FORM{'TXT_searchmessage'}=\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_message=$FORM{'TXT_your_message'}=\n"; print PREFS "TXT_required=$FORM{'TXT_required'}=\n"; print PREFS "TXT_where_in_the_world=$FORM{'TXT_where_in_the_world'}=\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_private_message=$FORM{'TXT_private_message'}=\n"; print PREFS "TXT_private_message2=$FORM{'TXT_private_message2'}=\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_has_been_added_private=$FORM{'TXT_has_been_added_private'}=\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); open(USER_FILE,">$days_name"); print USER_FILE "$FORM{'day_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="view_colprefs"; &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 "