#!/usr/bin/perl ### All code is copyright active-scripts.net 2006. # Bookmarks: 31,668 1,2179 1,4164 ### Unauthorised use, editing or copying for ANY reason is ### an infringement. Anti-spam code can not be edited ### and/or used in any way outside of the code in this script. $var = time; use CGI qw(:all); use CGI::Carp qw/fatalsToBrowser/; # working on refer for (param()) { $NEWFORM{$_} = param($_); } for (param()) { $FORM{$_} = param($_); $FORM{$_} =~ s/\|/-/gi unless param(action) eq "delete_ips"; } $query = new CGI; @todel = $query->param('todel'); $cookiedata = $ENV{'HTTP_COOKIE'}; @cookies = split(/;/,$cookiedata ); foreach $i (@cookies){ ($name,$cid) = split(/=/,$i); $name =~ s/\s+//gi; $COOK{$name} = $cid; } @var1 = split(//,$var); $lastnotvar = $var1[-1]; $lastnotvar++; $lastnotvar = 2 if $lastnotvar ==1; $lastnotvar2 = $lastnotvar -1; $use_absolute_reference = "no"; $urladdress = "http://www.domainhereifallelsefails.net/cgi-bin/gb/guestbook.cgi"; $font = ""; $guestbookroot = "$ENV{'HTTP_HOST'}"; if ($use_absolute_reference eq "no"){ $guesturl = "$ENV{'SCRIPT_NAME'}"; } else{ $guesturl = $urladdress; } $allurl = "$guestbookroot" . "$guesturl "; $allurl2 = "$guestbookroot" . "$guesturl"; $allurl3 = "$guestbookroot" . "$guesturl" . "?action=control_panel "; $| = 1; $demo="off"; $previewline = "
"; $version = "1400005"; $bversion = "14.5"; &subdirectory; $grace = 604800; $salt = "active"; # to help crypt $enc = crypt(active, $salt); # set default password $location_of_lock_file = "./active_guestbook_files/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); } $alignment_default = "center"; @active_default_alignment = split (//, $alignment_default); $cookie_default = join ("", reverse @active_default_alignment); $algo = ""; &startup; &open_prefs; &GetDate; &open_prefst; &check_values; $now = &amqdate($messagedate); &check_update; &check_new_files; $alignment_default = "center"; $alignment = "center" if ($alignment eq ""); $action = $FORM{'action'}; $direct = $FORM{'direct'}; $search_words = $FORM{'search_words'}; $search_fields = $FORM{'search_fields'}; $search_english= $FORM{'reload'}; @old_words = split (/\,/, $bad_words); # $added_words = "skcuf daehtihs etihs tihs stihs tawt reggin rekcufrehtom rekcuf tnuc rekcus kcoc dratsab kcuf gnikcuf sknaw knaw stnuc sdratsab sreknaw reknaw elohesra selohesra esra sesra"; @letters = split (//, $added_words) ; $reverse = join ("", reverse @letters); @new_words = split (/ /, $reverse); $rett = "jguiekjhhd"; @words = (@new_words, @old_words); $host = ".rorre noitartsigeR"; @backhost = split (//, $host) ; $valid_ip = join ("", reverse @backhost); @anti_ips = split (/\,/, $anti_ips); @anti_emails = split (/\,/, $anti_emails); &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 { &content;; 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); push (@viewtoeditdatalist, $row); unless (($fields[10] eq "del") || ($fields[15] eq "waiting") || ($fields[16] eq "yes")){ push (@datalist, $row); } } @datalist = @viewtoeditdatalist if ($action eq "view_to_edit"); $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; $aspm1 = $varstamp; &main_header; print qq~
~; &active_header if $active_header eq "on"; &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); 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; 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~ ~; $rev_startplus = $number_of_messages - $startplus +1; $rev_new_start_number = $number_of_messages - $new_start_number +1; $rev_number_of_messages = $number_of_messages - $number_of_messages +1; if ($order_of_message_numbers eq "reverse"){ $overall_startplus =$rev_startplus; $overall_new_start_number =$rev_new_start_number; $overall_number_of_messages =$rev_number_of_messages; } else{ $overall_startplus =$startplus; $overall_new_start_number =$new_start_number; $overall_number_of_messages =$number_of_messages; } if ($new_start_number < $number_of_messages){ print qq~ $TXT_viewing_messages$overall_startplus$TXT_to$overall_new_start_number$TXT_after_last_number ~; } else{ if ($startplus == $number_of_messages){ print qq~ $TXT_viewing_message$overall_startplus$TXT_after_last_number1 ~; } else{ print qq~ $TXT_viewing_messages$overall_startplus$TXT_to$overall_number_of_messages$TXT_after_last_number ~; } } if ($lock_gb ne "yes"){ &add2 if $add_page_appears ==1; } $message_number = $start_number+1; foreach $row (@data_ordered){ @fields = split (/\|/, $row); $grouped++; if (($grouped > ($start_number)) && ($grouped < ($start_number + $no_displayed + 1))){ &main_table_results; $message_number++; } # end if number is right } # end for each row 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 ~; } if ($lock_gb ne "yes"){ &add2 if $add_page_appears ==2; } &search_form if $includesearch ne "no"; &user_html_footer if $use_user_html_footer eq "yes"; print qq~ ~; print qq~
~; &inter_footer; } # end sub read sub write{ exit if ($lock_gb eq "yes"); if (($ENV{'REQUEST_METHOD'} ne "POST")&&($limittopost eq "on")){ &content; print "Illegal posting method. You should change settings in A15 of the Standard Preferences Manager"; exit; } $guest_email = $FORM{'guest_email'}; foreach (@anti_emails) { next unless $_; $emailoops = "yes" if ($guest_email =~ m!$_!); } #if ($FORM{'aspm1'} ne $varstamp){ #&basic_header; #print qq~

#
Not allowed
#~; #exit; #} if ($emailoops eq "yes"){ &basic_header; print qq~

Email not allowed
~; exit; } if ($use_referrer_limit eq "yes"){ unless($ENV{HTTP_REFERER}=~ m/$ref_domain/gi){ &content; print "Posting not allowed from your domain - $ENV{HTTP_REFERER}"; exit; } } $TXT_code_not_correct = "Code not correct" if $TXT_code_not_correct eq ""; $page_after_write = "$guesturl\?action=reload" if (($page_after_write eq "") ||($page_after_write eq " ") ); ###### anti-spam bit if ($action ne "preview"){ open(BAK,"$failedcap"); @imgpww = ; close BAK; foreach $juy (@imgpww){ @imgfs = split (/\|/, $juy); if ($FORM{'capmessage'} eq $imgfs[1]){ $foundabadone++; } } if ($foundabadone >1){ &content; print qq~ $title
Active Guestbook

$font Spam limit

~; &inter_footer; exit; } $foundm = "no"; open(CFILE,"$cap"); @caps = ; close (CFILE); $SUB{$FORM{'capa'}} = "yes"; $SUB{$FORM{'capb'}} = "yes"; foreach $cap (@caps){ @capfields = split (/\|/, $cap); if (($SUB{$capfields[1]} eq "yes") && ($SUB{$capfields[2]} eq "yes") && ($FORM{'capmessage'} eq $capfields[4])){ $foundm = "yes"; $var_cap = $capfields[3]; last; } } if ($foundm ne "yes"){ open(UPDATE,">>$failedcap"); print UPDATE "$var|$FORM{'capmessage'}|||||||\n"; close(UPDATE); &content; print qq~ $title
$title

$font $TXT_code_not_correct

~; &inter_footer; exit; } } sub old_spam{ open(BAK,"$imgpw"); @imgpw = ; close BAK; foreach $juy (@imgpw){ @imgfs = split (/\|/, $juy); $IMGFWS{$imgfs[0]} = $imgfs[1]; } if ($IMGFWS{$FORM{'hiddenpwi'}} ne $FORM{'usercod'}){ &content; print qq~ $title
Active Guestbook

$font $TXT_code_not_correct

~; &inter_footer; exit; } } # old spam sub oldone{ $FORM{'cod'} =~ s/\-//gi; if ($showlettercheck eq "yes"){ if (($use_preview eq "yes") && ($FORM{'cod'} ne $FORM{'usercod'})){ &content; print qq~ $title
Active Guestbook

$font $TXT_code_not_correct

~; &inter_footer; exit; } } } # end sub 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

$font $TXT_multiple_not_allowed

~; &inter_footer; exit; } } $full_name = $FORM{'requiredfull_name'}; $tempname = $full_name; $tempname =~ s/\s//gi; $message = $FORM{'requiredmessage'}; $tempmessage = $message; $tempmessage =~ s/\s//gi; $tempmessage =~ s/\n//gi; $tempmessage =~ s/\r//gi; open(FILE,"$smileys"); @smileys = ; close(FILE); foreach(@smileys){ @smiley = split(/\|/, $_); $SMILES{$smiley[1]} = "yes"; } @bitsofmessage = split(/\:/, $tempmessage); foreach(@bitsofmessage){ if ($SMILES{$_} eq "yes"){ $smileycount++; } } if ($smileycount > $max_smileys){ &content; print qq~
Too many smileys. Maximum is $max_smileys. ~; exit; } if (($tempname eq "") || ($tempmessage eq "")){ &content; print qq~
Please fill in all required fields. ~; exit; } if (($use_url_field eq "req") && ($blockurls ne "yes")){ $turl = $FORM{'url'}; $turl =~ s/\s+//gi; if ($turl eq ""){ &content; print "
$TXT_please_fill_in"; exit; } } # $FORM{'user1_field'} =~s/\|//gi; if ($use_user1_field eq "req") { $turl = $FORM{'user1_field'}; $turl =~ s/\s+//gi; if ($turl eq ""){&content; print "
$TXT_please_fill_in"; exit; } } if ($use_user2_field eq "req") { $turl = $FORM{'user2_field'}; $turl =~ s/\s+//gi; if ($turl eq ""){&content; print "
$TXT_please_fill_in"; exit; } } if ($use_user3_field eq "req") { $turl = $FORM{'user3_field'}; $turl =~ s/\s+//gi; if ($turl eq ""){&content; print "
$TXT_please_fill_in"; exit; } } if ($use_location_field eq "req") { $turl = $FORM{'location'}; $turl =~ s/\s+//gi; if ($turl eq ""){&content; print "
$TXT_please_fill_in"; exit; } } $rtyyw= $FORM{'epij'}; $tout = $timeout*60; $rtyyw= reverse($rtyyw); if (($zz - $rtyyw) >$tout) { $target = "http://www.active-scripts.net"; &content; print "Session timed out. Please try again."; exit; } $leftarrow = 0; $rightarrow = 0; @chars = split(//,$message); foreach $char(@chars) { if ($char eq "<"){ $leftarrow++; } elsif ($char eq ">"){ $rightarrow++; } } if ($leftarrow ne $rightarrow){ &content; print "There is a problem with the html. It may simply be that you have entered a left arrow (<) or a right arrow (>) in the text. In order to prevent abuse, this is not allowed."; exit; } $guest_email =~ s/\"//g; $guest_email =~ s/\'//g; $private_message_check = $FORM{'private_message_check'}; $private_message_check = "" if (($private_message_check ne "") && ($private_message_check ne "yes") ); $location = $FORM{'location'}; $url = $FORM{'url'}; $url =~ s/\"//g; $url =~ s/\'//g; $url =~ s/http\:\/\///i; if (($guest_email) || ($use_email_confirmation eq "yes") || ($use_email_field eq "req")){ &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; } $FORM{'user1_field'} =~s/\|//gi; $FORM{'user2_field'} =~s/\|//gi; $FORM{'user3_field'} =~s/\|//gi; $message =~ s/\r\n/
/g; $message =~ s/\r/ /g; $message =~ s/\n/
/g; $message =~ s/
$//g; $message =~ s/\s+/ /g; if ((($use_url_field eq "no") || ($blockurls eq "yes")) && ($url ne "")){ &content; print "Cheeky"; exit; } $warning = "Looks like a web address. URLs are currently blocked."; $message =~ s/\.+/./g if ($blockurls eq "yes"); $url = "" if ($blockurls eq "yes"); $full_name =~ s/\.+/./g if ($blockurls eq "yes"); $location =~ s/\.+/./g if ($blockurls eq "yes"); $number_of_words = @words_in_message = split(/ /,$message); $number_of_chars = @chars_in_message = split(//,$message); if ($blockurls eq "yes"){ if ( ($FORM{'user1_field'}=~/\&\#/gi) || ($FORM{'user1_field'}=~/www\./gi) ||($FORM{'user1_field'}=~/http/gi) ){ &content; print "$warning"; exit; } if ( ($FORM{'user2_field'}=~/\&\#/gi) || ($FORM{'user2_field'}=~/www\./gi) ||($FORM{'user2_field'}=~/http/gi) ){ &content; print "$warning"; exit; } if ( ($FORM{'user3_field'}=~/\&\#/gi) || ($FORM{'user3_field'}=~/www\./gi) ||($FORM{'user3_field'}=~/http/gi) ){ &content; print "$warning"; exit; } if ( ($FORM{'user1_field'}=~tr/\.//>1) ||($FORM{'user2_field'}=~tr/\.//>1) ||($FORM{'user3_field'}=~tr/\.//>1) ){ &content; print "$warning"; exit; } if ( ($guest_email=~/\&\#/gi) || ($guest_email=~/www\./gi) ||($location=~/http/gi) ){ &content; print "$warning"; exit; } if ( ($full_name=~/\&\#/gi) || ($message=~/\&\#/gi) ||($location=~/\&\#/gi) ){ &content; print "$warning"; exit; } if (($location=~tr/\.//>1) || ($location=~/http/gi) || ($location=~/:\/\//gi) || ($location=~/www\./gi)){ &content; print "$warning"; exit; } if (($full_name=~tr/\.//>1) || ($full_name=~/http/gi) || ($full_name=~/:\/\//gi) || ($full_name=~/www\./gi)){ &content; print "$warning"; exit; } foreach $word (@words_in_message){ $word =~ s/
/ /gi; if (($word=~/http/gi) || ($word=~/:\/\//gi) || ($word=~/www\./gi) || ($word=~/\.com/gi)|| ($word=~/\.org/gi) || ($word=~/\.net/gi) || ($word=~/\.biz/gi) || ($word=~/\.info/gi) || ($word=~/\.pl/gi) || ($word=~/\.tc/gi) || ($word=~/\.ru/gi) || ($word=~/\.html/gi) || ($word=~/\.dk/gi) ){ &content; print "$warning"; exit; } } } $max_chars_per_line = 20 if $max_chars_per_line eq ""; if (($max_chars_per_line % 2) != 0){ $max_chars_per_line++; }; ($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+1)/$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//; $message =~ s/^
//; ##### block multiple posts $multiple_post = "no"; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); open(USER_FILE,"$econf"); @data2 = ; close(USER_FILE); @data3 = (@data2, @data); foreach $row (@data3){ @fields = split (/\|/, $row); if (($full_name eq $fields[1]) && ($fields[2] eq $message)) { $multiple_post = "yes"; } ## new counter $newhighest = $fields[0] if $fields[0] > $newhighest ; } $newhighest++; if ($multiple_post eq "yes"){ &basic_header; print qq~
$title

This message has already been added. ~; exit; } if (($number_of_words > $max_length) || ($number_of_chars > $max_length_chars)){ &content; 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 (($message =~ /\[LINK/i) || ($location =~ /\[LINK/i) ||($full_name =~ /\[LINK/i) ||($guest_email =~ /\[LINK/i) || ($FORM{'user2_field'} =~ /\[LINK/i) ||($FORM{'user1_field'} =~ /\[LINK/i) || ($FORM{'user3_field'} =~ /\[LINK/i)) { &content; print qq~

$title

$TXT_disallowed_word ~; exit; } if ($oops eq "yes"){ &content; print qq~

$title

$TXT_disallowed_word ~; exit; } if ($ipoops eq "yes"){ &content; 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;} if ($use_email_confirmation eq "yes"){$filetoadd = $econf; } else{ $filetoadd = $guestbook_data_name; } @enf = split (//, $time_in_seconds); @enf = reverse(@enf); $revtime=join("",@enf); &get_file_lock("$location_of_lock_file"); $full_name =~ s/\n//gi; $full_name =~ s/\r//gi; $url =~ s/\n//gi; $url =~ s/\r//gi; $location =~ s/\n//gi; $location =~ s/\r//gi; $guest_email =~ s/\n//gi; $guest_email =~ s/\r//gi; $FORM{'user1_field'} =~ s/\n//gi; $FORM{'user1_field'} =~ s/\r//gi; $FORM{'user2_field'} =~ s/\n//gi; $FORM{'user2_field'} =~ s/\r//gi; $FORM{'user3_field'} =~ s/\n//gi; $FORM{'user3_field'} =~ s/\r//gi; #if ($lastnotcheck ne $FORM{'lastnot'}){ #&content; #print qq~

$title

$TXT_incorrect_selection ~; #exit; #} open(DATABASE,">>$filetoadd"); $private_message_check = "yes" if $all_private eq "yes"; if ($private_message_check eq "yes") { print DATABASE "$newhighest|$full_name|$message|$time_in_seconds|$guest_email|$location||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url|||||$private_message_check|$FORM{'user1_field'}|$FORM{'user2_field'}|$FORM{'user3_field'}|$revtime|$FORM{'aspm1'}|$var_cap|||||||||\n"; } elsif ($moderated eq "yes"){ print DATABASE "$newhighest|$full_name|$message|$time_in_seconds|$guest_email|$location||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url||||waiting||$FORM{'user1_field'}|$FORM{'user2_field'}|$FORM{'user3_field'}|$revtime|$FORM{'aspm1'}|$var_cap|||||||||\n"; } else { print DATABASE "$newhighest|$full_name|$message|$time_in_seconds|$guest_email|$location||$ENV{'REMOTE_ADDR'}|$now|$revdate||$url|||||$private_message_check|$FORM{'user1_field'}|$FORM{'user2_field'}|$FORM{'user3_field'}|$revtime|$FORM{'aspm1'}|$var_cap|||||||||\n"; } close(DATABASE); &backup_to_dir; &release_file_lock("$location_of_lock_file"); if ($use_email_confirmation eq "yes"){ open (MAIL, "|$mail_path"); print MAIL "Content-Type: text/plain; charset=\"$TXT_main_language\"\n"; print MAIL "To: $guest_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: $TXT_approve_subject\n\n"; print MAIL "$TXT_approve_text\n\n"; print MAIL "http://$allurl2\?action=approve&ref=$newhighest&tero=$revtime\n\n"; print MAIL "=========================\n"; close(MAIL); &thanks; } else{ &handle_notifications; } } sub handle_notifications { #if ($admin_email eq "webmaster") #{ if (($send_email_to_admin eq "on") && ($admin_email ne "")) { &send_email_to_admin; } #} if (($guest_email) && ($send_email_to_guest eq "on") && ($moderated ne "yes")) { &send_email_to_guest; } unless ($action eq "approve") { if ($action ne "no_preview") { &thanks; } else { &no_thanks; } } } sub add { exit if ($lock_gb eq "yes"); &end if ($ipoops eq "yes"); &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"; if ($use_user_html eq "yes"){ &user_html if $disable_user_html_add ne "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); } &add2; if ($use_user_html_footer eq "yes"){ &user_html_footer if $disable_user_html_footer_add ne "yes"; } print qq~
~; print "\n\n"; } # end sub add sub add2{ if ($use_preview eq "yes"){ $whatever = "preview"; } else{ $whatever = "no_preview"; }$zz = reverse($zz); $aspm1 = $FORM{'aspm1'} if $aspm1 eq ""; $box_height = "3" if $box_height eq ""; print qq~

~; open(FILE,"$smileys"); @smileys = ; close(FILE); $ssmil = "yes" if $demo eq "on"; $ssmil = "yes" if (($var - $stamp) < $grace); $ssmil = "yes" if ((($var - $stamp) > $grace) && ($foundasimg ne "yes") ); if ($ssmil eq "yes"){ if ($use_smileys eq "yes"){ print ""; } $use_email_field = "yes" if $use_email_field eq ""; $use_url_field = "yes" if $use_url_field eq ""; $use_location_field = "yes" if $use_location_field eq ""; $use_user1_field = "no" if $use_user1_field eq ""; $use_user2_field = "no" if $use_user2_field eq ""; $use_user3_field = "no" if $use_user3_field eq ""; if (($use_location_field eq "yes")|| ($use_location_field eq "req")){ print qq~ ~; } if (($use_email_field eq "yes")|| ($use_email_field eq "req") || ($use_email_confirmation eq "yes")){ print qq~ ~; } if (($use_url_field eq "yes") || ($use_url_field eq "req")){ if ($blockurls ne "yes"){ print qq~ ~; } } if (($use_user1_field eq "yes") || ($use_user1_field eq "req")){ $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; print qq~ ~; } if (($use_user2_field eq "yes") || ($use_user2_field eq "req")){ $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; print qq~ ~; } if (($use_user3_field eq "yes") || ($use_user3_field eq "req")){ $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print qq~ ~; } unless ($all_private eq "yes"){ if ($allow_private_messages eq "yes"){ print qq~~; } } sub tempig{ $TXT_select_this_number = "Select this number" if $TXT_select_this_number eq ""; print qq~ ~; } print qq~
$TXT_your_name $TXT_required ~; print qq~
$TXT_your_message $TXT_required
~; print qq~
"; foreach(@smileys){ @smiley = split(/\|/, $_); next if $smiley[3] eq "inactive"; $smiley[2] =~ s/http\:\/\///gi; print qq~ ~; } } print "
$TXT_where_in_the_world ~; print "$TXT_required" if ($use_location_field eq "req"); print qq~
$TXT_your_email_address ~; print "$TXT_required" if (($use_email_confirmation eq "yes") || ($use_email_field eq "req")); print qq~
$TXT_your_web_page_address ~; print "$TXT_required" if ($use_url_field eq "req"); print qq~
$TXT_user1_field ~; print "$TXT_required" if ($use_user1_field eq "req"); print qq~
$TXT_user2_field ~; print "$TXT_required" if ($use_user2_field eq "req"); print qq~
$TXT_user3_field ~; print "$TXT_required" if ($use_user3_field eq "req"); print qq~
$TXT_private_message $TXT_private_message2
$TXT_select_this_number: $lastnot ~; print qq~

~; } # end sub add2 ########## startup sub startup { @ooolsd= ("a", "b", "g", "f", "j", "e", "h", "i", "c", "d"); $zz = time; unless (-e "$edit") { open(UPDATE1,">$edit"); #install date-keep chmod(0777, "$edit"); print UPDATE1 "$zz"; close(UPDATE1); } if ($algo ne ""){ unless (-e "$algo_file") { open(UPDATE1,">$algo_file"); chmod(0777, "$algo_file"); print UPDATE1 "$algo"; close(UPDATE1); } } unless (-e "$varedit") { open(UPDATE1,">$varedit"); # variable day time chmod(0777, "$varedit"); print UPDATE1 "$zz"; close(UPDATE1); } unless (-e "$varday") { open(UPDATE1,">$varday"); chmod(0777, "$varday"); print UPDATE1 "$hsday"; close(UPDATE1); } @uns = split(//, $zz); @uns = reverse(@uns); $cod2 = $ooolsd[$uns[0]] . " " . $ooolsd[$uns[4]] . " " . $ooolsd[$uns[1]] . " " . $ooolsd[$uns[2]]; $cod = $ooolsd[$uns[0]] . $ooolsd[$uns[4]] . $ooolsd[$uns[1]] . $ooolsd[$uns[2]]; 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 qq~~; close(STYLE); } #################### unless (-e "$senddate_name") { open(UPDATE1,">$senddate_name"); chmod(0777, "$senddate_name"); print UPDATE1 "$now"; close(UPDATE1); } unless (-e "$econf") { open(UPDATE1,">$econf"); chmod(0777, "$econf"); 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 "$cap") { open(UPDATE,">$cap"); chmod(0777, "$cap"); close(UPDATE); } unless (-e "$history") { open(UPDATE,">$history"); chmod(0777, "$history"); print UPDATE "$version|$var|||||\n"; close(UPDATE); } unless (-e "$failedcap") { open(UPDATE,">$failedcap"); chmod(0777, "$failedcap"); close(UPDATE); } unless (-e "$smileys") { open(SM,">$smileys"); chmod(0777, "$smileys"); print SM "1|biggrin|www.active-scripts.net/smileys5/biggrin.gif|||||\n"; print SM "2|blink|www.active-scripts.net/smileys5/blink.gif|||||\n"; print SM "3|cool|www.active-scripts.net/smileys5/cool.gif|||||\n"; print SM "4|dry|www.active-scripts.net/smileys5/dry.gif|||||\n"; print SM "5|eek|www.active-scripts.net/smileys5/eek.gif|||||\n"; print SM "6|huh|www.active-scripts.net/smileys5/huh.gif|||||\n"; print SM "7|laugh|www.active-scripts.net/smileys5/laugh.gif|||||\n"; print SM "8|light|www.active-scripts.net/smileys5/light.gif|||||\n"; print SM "9|mad|www.active-scripts.net/smileys5/mad.gif|||||\n"; print SM "10|ohmy|www.active-scripts.net/smileys5/ohmy.gif|||||\n"; print SM "11|question|www.active-scripts.net/smileys5/question.gif|||||\n"; print SM "12|rolleyes|www.active-scripts.net/smileys5/rolleyes.gif|||||\n"; print SM "13|sad|www.active-scripts.net/smileys5/sad.gif|||||\n"; print SM "14|smile|www.active-scripts.net/smileys5/smile.gif|||||\n"; print SM "15|thumbdown|www.active-scripts.net/smileys5/thumbdown.gif|||||\n"; print SM "16|thumbup|www.active-scripts.net/smileys5/thumbup.gif|||||\n"; print SM "17|tongue|www.active-scripts.net/smileys5/tongue.gif|||||\n"; print SM "18|unsure|www.active-scripts.net/smileys5/unsure.gif|||||\n"; print SM "19|wacko|www.active-scripts.net/smileys5/wacko.gif|||||\n"; print SM "20|wink|www.active-scripts.net/smileys5/wink.gif|||||\n"; close(SM); } unless (-e "$user_comment_line_name") { open(USER_HTML,">$user_comment_line_name"); chmod(0777, "$user_comment_line_name"); print USER_HTML "
"; close(USER_HTML); } unless (-e "$user_html_name") { open(USER_HTML,">$user_html_name"); chmod(0777, "$user_html_name"); print USER_HTML ""; 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 ""; 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 "$spam_days") { open(THANKS,">$spam_days"); chmod(0777, "$spam_days"); print THANKS "10"; close(THANKS); } 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"; 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"; 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 ($COOK{'activea'} ne "") # if (&GetCookies('activea')) { $coolkiepass = $COOK{'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_approve_subject=Guestbook message confirmation required=\n"; print PREFS "TXT_approve_text=Thank you for adding a message in our guestbook. To complete the process please visit the link below.=\n"; print PREFS "TXT_add_a_message=Add a message=\n"; print PREFS "TXT_main_language=iso-8859-1=\n"; print PREFS "TXT_multiple_not_allowed=Multiple posts are currently not allowed.=\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_incorrect_selection=Incorrect selection :=\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_type_letters_only=Enter the underlined numbers=\n"; print PREFS "TXT_where_in_the_world=Where in the world?=\n"; print PREFS "TXT_user1_field=Extra field 1=\n"; print PREFS "TXT_user2_field=Extra field 2=\n"; print PREFS "TXT_user3_field=Extra field 3=\n"; print PREFS "TXT_select_this_number=Select this number=\n"; print PREFS "TXT_code_not_correct=The code you entered is not correct. Please go back and fix.=\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_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_emailconfsent=Thank you. For your security an email has been sent to you to allow you to confirm your message.=\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=Your email address is not valid.=\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 "disable_user_html_footer_add=no=\n"; print PREFS "lock_gb=no=\n"; print PREFS "disable_user_html_add=no=\n"; print PREFS "use_referrer_limit=no=\n"; print PREFS "limittopost=on=\n"; print PREFS "ref_domain=active-scripts=\n"; print PREFS "replacement_character=;=\n"; print PREFS "replace_dots=no=\n"; print PREFS "order_of_message_numbers=normal=\n"; print PREFS "use_message_numbers=no=\n"; print PREFS "use_own_captcha=no=\n"; print PREFS "captcha_url=no=\n"; print PREFS "message_number_pre=Message =\n"; print PREFS "message_number_post= - =\n"; print PREFS "timeout=10=\n"; print PREFS "show_f1=yes=\n"; print PREFS "show_f2=yes=\n"; print PREFS "show_f3=yes=\n"; print PREFS "show_location=yes=\n"; print PREFS "page_after_write==\n"; print PREFS "use_email_field=yes=\n"; print PREFS "use_url_field=no=\n"; print PREFS "use_location_field=yes=\n"; print PREFS "use_user1_field=no=\n"; print PREFS "use_user2_field=no=\n"; print PREFS "use_user3_field=no=\n"; print PREFS "showlettercheck=yes=\n"; print PREFS "use_email_confirmation=no=\n"; print PREFS "add_page_appears==\n"; print PREFS "max_smileys=10=\n"; print PREFS "blockurls=no=\n"; print PREFS "limit_no_of_chars_in_line=no=\n"; print PREFS "max_chars_per_line=50=\n"; print PREFS "includesearch=yes=\n"; print PREFS "show_guest_email=yes=\n"; print PREFS "show_guest_url=no=\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 "box_height=3=\n"; print PREFS "use_smileys=yes=\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 "alignment_body=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://www.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 "anti_emails=strange.com,stranger.com=\n"; print PREFS "bad_words=wankle rotaryengine=\n"; print PREFS "no_displayed=5=\n"; print PREFS "max_length=400=\n"; print PREFS "max_length_chars=4000=\n"; print PREFS "max=300000=\n"; print PREFS "days_to_delete=1000000=\n"; print PREFS "days_to_trash=1000000=\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=on=\n"; print PREFS "use_user_html=no=\n"; print PREFS "use_user_html_footer=no=\n"; print PREFS "table_width=600=\n"; print PREFS "style=on=\n"; print PREFS "moderated=yes=\n"; print PREFS "field_length=40=\n"; print PREFS "left_bracket==\n"; print PREFS "middle_bracket=:=\n"; print PREFS "right_bracket==\n"; print PREFS "all_private==\n"; close(PREFS); } 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); } open(BAK,"$imgpwver"); $overs = ; close(BAK); if ($version ne $overs){ open(UPDATE,">>$history"); print UPDATE "$version|$var|||||\n"; close(UPDATE); open(IP,"$ip_name") || &oops('$ip_name'); $ip_addresses = ; close(IP); if ($ip_addresses eq $cookie_default) { open(UUU,">$ip_name"); close(UUU); &content; print "Active Guestbook has found a data corruption and repaired it. Please restore your most recent valid backup. Continue"; exit; } open(BAK,">$imgpw"); chmod(0777, "$imgpw"); print BAK qq~2030|7489||| 2031|9453||| 2032|8823||| 2033|0124||| 2034|8458||| 2035|9993||| 2036|3571||| 2037|9064||| 2038|4378||| 2039|2468||| ~; close(BAK); } if ($version ne $overs){ open(BAK,">$imgpwver"); chmod(0777, "$imgpwver"); print BAK "$version"; close(BAK); } unless (-e "$userprefs_backup_name"){ open(USERDEFAULT,">$userprefs_backup_name"); chmod(0777, "$userprefs_backup_name"); foreach $line (@lines){ print USERDEFAULT "$line"; } close(USERDEFAULT); } 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 "link=#000000=\n"; print COLPREFS "vlink=#000000=\n"; print COLPREFS "alink=#000000=\n"; print COLPREFS "text=#000000=\n"; print COLPREFS "searchcolor=#eeeeee=\n"; print COLPREFS "usebackgroundimage=no=\n"; print COLPREFS "fixedbackground==\n"; print COLPREFS "backgroundimage=http://www.active-scripts.net/active_guestbook/background.jpg=\n"; print COLPREFS "user_image=no=\n"; print COLPREFS "user_image_url==\n"; print COLPREFS "use_hr_image=no=\n"; print COLPREFS "hr_image=http://www.active-scripts.net/line.gif=\n"; print COLPREFS "url_image=http://www.active-scripts.net/url2.gif=\n"; print COLPREFS "email_image=http://www.active-scripts.net/mail2.gif=\n"; close(COLPREFS); $firstinstall = "yes"; } unless (-e "$skins_directory"){ mkdir ($skins_directory, 0777); chmod(0777, "$skins_directory"); ©_file($colprefs_name,"$skins_directory/default.skin"); open(COLPREFS,">$skins_directory/skin1.skin"); print COLPREFS qq~trans_search=no= trans_message_header=no= trans_message_body=no= data_color1=#9f9f5f= data_color2=#cc9900= textdata_color1=#ffffff= textdata_color2=#ffffff= table_color1=#000000= table_color2=#000000= texttable_color1=#ffffff= texttable_color2=#ffffff= backcolor=#000000= link=#000000= vlink=#000000= alink=#000000= text=#ffffff= searchcolor=#000000= usebackgroundimage=no= fixedbackground== backgroundimage=http://www.active-scripts.net/active_guestbook/background.jpg= use_hr_image=no= hr_image=http://www.active-scripts.net/line.gif= user_image=no= user_image_url== url_image=http://www.active-scripts.net/url2.gif= email_image=http://www.active-scripts.net/mail2.gif= ~; close(COLPREFS); if ($firstinstall ne "yes"){# upgrade open(FILE,"$prefs_name"); @LINES = ; close(FILE); foreach $LINE (@LINES){ @terms = split(/=/,$LINE); $PREFSW{$terms[0]} = $terms[1]; } open(COLPREFS,">>$colprefs_name"); print COLPREFS "usebackgroundimage=$PREFSW{'usebackgroundimage'}=\n"; print COLPREFS "fixedbackground=$PREFSW{'fixedbackground'}=\n"; print COLPREFS "backgroundimage=$PREFSW{'backgroundimage'}=\n"; print COLPREFS "user_image=$PREFSW{'user_image'}=\n"; print COLPREFS "user_image_url=$PREFSW{'user_image_url'}=\n"; print COLPREFS "use_hr_image=$PREFSW{'use_hr_image'}=\n"; print COLPREFS "hr_image=$PREFSW{'hr_image'}=\n"; print COLPREFS "url_image=$PREFSW{'url_image'}=\n"; print COLPREFS "email_image=$PREFSW{'email_image'}=\n"; close(COLPREFS); open(COLPREFS,">>$skins_directory/default.skin"); print COLPREFS "usebackgroundimage=$PREFSW{'usebackgroundimage'}=\n"; print COLPREFS "fixedbackground=$PREFSW{'fixedbackground'}=\n"; print COLPREFS "backgroundimage=$PREFSW{'backgroundimage'}=\n"; print COLPREFS "user_image=$PREFSW{'user_image'}=\n"; print COLPREFS "user_image_url=$PREFSW{'user_image_url'}=\n"; print COLPREFS "use_hr_image=$PREFSW{'use_hr_image'}=\n"; print COLPREFS "hr_image=$PREFSW{'hr_image'}=\n"; print COLPREFS "url_image=$PREFSW{'url_image'}=\n"; print COLPREFS "email_image=$PREFSW{'email_image'}=\n"; close(COLPREFS); } } 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|frank\@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
$font 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); $hsday = $mday; $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 ($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; unless ($FORM{'fullpageloaded'} eq "yes") { &content; print "
You need to go back and allow the whole page to load before submitting changes."; exit; } &get_file_lock("$location_of_lock_file"); open(FILE,"$prefs_name"); @lines = ; close(FILE); open(FILE,">$prefs_name"); print FILE "disable_user_html_footer_add=$FORM{'disable_user_html_footer_add'}=\n"; print FILE "disable_user_html_add=$FORM{'disable_user_html_add'}=\n"; print FILE "lock_gb=$FORM{'lock_gb'}=\n"; print FILE "use_referrer_limit=$FORM{'use_referrer_limit'}=\n"; print FILE "limittopost=$FORM{'limittopost'}=\n"; print FILE "ref_domain=$FORM{'ref_domain'}=\n"; print FILE "use_own_captcha=$FORM{'use_own_captcha'}=\n"; print FILE "captcha_url=$FORM{'captcha_url'}=\n"; print FILE "replacement_character=$FORM{'replacement_character'}=\n"; print FILE "replace_dots=$FORM{'replace_dots'}=\n"; print FILE "order_of_message_numbers=$FORM{'order_of_message_numbers'}=\n"; print FILE "use_message_numbers=$FORM{'use_message_numbers'}=\n"; print FILE "message_number_pre=$FORM{'message_number_pre'}=\n"; print FILE "message_number_post=$FORM{'message_number_post'}=\n"; print FILE "timeout=$FORM{'timeout'}=\n"; print FILE "show_f1=$FORM{'show_f1'}=\n"; print FILE "show_f2=$FORM{'show_f2'}=\n"; print FILE "show_f3=$FORM{'show_f3'}=\n"; print FILE "show_location=$FORM{'show_location'}=\n"; print FILE "show_guest_email=$FORM{'show_guest_email'}=\n"; print FILE "box_height=$FORM{'box_height'}=\n"; print FILE "use_email_field=$FORM{'use_email_field'}=\n"; print FILE "use_url_field=$FORM{'use_url_field'}=\n"; print FILE "use_location_field=$FORM{'use_location_field'}=\n"; print FILE "use_user1_field=$FORM{'use_user1_field'}=\n"; print FILE "use_user2_field=$FORM{'use_user2_field'}=\n"; print FILE "use_user3_field=$FORM{'use_user3_field'}=\n"; print FILE "showlettercheck=$FORM{'showlettercheck'}=\n"; print FILE "use_smileys=$FORM{'use_smileys'}=\n"; print FILE "add_page_appears=$FORM{'add_page_appears'}=\n"; print FILE "show_guest_url=$FORM{'show_guest_url'}=\n"; print FILE "max_smileys=$FORM{'max_smileys'}=\n"; print FILE "email_link_type=$FORM{'email_link_type'}=\n"; print FILE "includesearch=$FORM{'includesearch'}=\n"; print FILE "web_link_type=$FORM{'web_link_type'}=\n"; print FILE "blockurls=$FORM{'blockurls'}=\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 "alignment_body=$FORM{'alignment_body'}=\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 "all_private=$FORM{'all_private'}=\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_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 "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"; print FILE "use_email_confirmation=$FORM{'use_email_confirmation'}=\n"; open(USER_FILE,">$user_comment_line_name"); $ertyu = $FORM{'user_comment_line'}; $ertyu =~ s/\r//gi; print USER_FILE "$ertyu"; close(USER_FILE); 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"; $bad2 = $FORM{'anti_emails'};$bad2 =~ s/\s\s/ /g;$bad2 =~ s/\s\s/ /g;$bad2 =~ s/\s/,/g;$bad2 =~ s/\,\,/,/g; print FILE "anti_emails=$bad2=\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; } sub open_prefst{ open(FILE,"$varday"); $lastvarday = ; close(FILE); if ($lastvarday ne $hsday){ open(UPDATE1,">$varday"); print UPDATE1 "$hsday"; close(UPDATE1); open(UPDATE1,">$varedit"); print UPDATE1 "$zz"; close(UPDATE1); } open(FILE,"$varedit"); $varstamp = ; close(FILE); open(FILE,"$algo_file"); $algoval = ; close(FILE); } sub open_prefs{ open(FILE,"$prefs_name"); @LINES = ; close(FILE); open(FILE,"$edit"); $stamp = ; close(FILE); open(FILE,"$spam_days"); $spamdays = ; close(FILE); @firstl = split(//,$stamp); $archie = $FORM{'lastnotvar'} ; $archie2 = $FORM{'lastnotvar'}-1 ; $lastnot = "$firstl[-$lastnotvar]$firstl[-$lastnotvar2]"; $lastnotcheck = "$firstl[-$archie]$firstl[-$archie2]"; if ($NEWFORM{'action'} eq "view_skin"){ $fto="$skins_directory/$NEWFORM{'skin'}"; } elsif ($NEWFORM{'action'} eq "preview_skin"){ $preskin = $NEWFORM{'ref'} . ".skin"; $fto="/home/customers/active-scripts.net/cgi-bin/skins/$preskin"; } else{ $notokaytouseasimgs = "yes"; $fto="$colprefs_name"; } open(COLFILE,"$fto"); @COLLINES = ; close(COLFILE); foreach(@COLLINES){ if ($_ =~ /active-scripts/gi){ $foundasimgcol = "yes"; } } $foundasimgcol = "" if $notokaytouseasimgs ne "yes"; open(FILE,"$smileys"); @smileys = ; close(FILE); foreach(@smileys){ if ($_ =~ /active-scripts/gi){ $foundasimg = "yes"; } } $foundasimg = "" if $notokaytouseasimgs ne "yes"; 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]; } $ipcontrollerspec= qq~>"fig.01v/ten.stpircs-evitca.www//:ptth"=crs gmi<~; $ipcontrollerspec= reverse($ipcontrollerspec); $TXT_approve_subject = $LANGPREFS{'TXT_approve_subject'}; $TXT_approve_subject = "Guestbook message confirmation required" if $LANGPREFS{'TXT_approve_subject'} eq ""; $TXT_approve_text = $LANGPREFS{'TXT_approve_text'}; $TXT_approve_text = "Thank you for adding a message in our guestbook. To complete the process please visit the link below." if $LANGPREFS{'TXT_approve_text'} eq ""; $TXT_add_a_message = $LANGPREFS{'TXT_add_a_message'}; $TXT_multiple_not_allowed = $LANGPREFS{'TXT_multiple_not_allowed'}; $TXT_multiple_not_allowed = "Multiple posts are currently not allowed." if $TXT_multiple_not_allowed eq ""; $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_incorrect_selection = $LANGPREFS{'TXT_incorrect_selection'}; $TXT_incorrect_selection = "Incorrect selection" if $TXT_incorrect_selection eq ""; $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_user1_field = $LANGPREFS{'TXT_user1_field'}; $TXT_user2_field = $LANGPREFS{'TXT_user2_field'}; $TXT_emailconfsent = $LANGPREFS{'TXT_emailconfsent'}; $TXT_emailconfsent = "Thank you. For your security an email has been sent to you to allow you to confirm your message." if $LANGPREFS{'TXT_emailconfsent'} eq ""; $TXT_user3_field = $LANGPREFS{'TXT_user3_field'}; $TXT_select_this_number = $LANGPREFS{'TXT_select_this_number'}; $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_code_not_correct = $LANGPREFS{'TXT_code_not_correct'}; $TXT_where_in_the_world = $LANGPREFS{'TXT_where_in_the_world'}; $TXT_type_letters_only = $LANGPREFS{'TXT_type_letters_only'}; $TXT_your_email_address = $LANGPREFS{'TXT_your_email_address'}; $TXT_your_web_page_address = $LANGPREFS{'TXT_your_web_page_address'}; $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_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_main_language = $LANGPREFS{'TXT_main_language'}; $TXT_main_language = "iso-8859-1" if $TXT_main_language eq ""; $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 ""); $use_referrer_limit = $PREFS{'use_referrer_limit'}; $use_referrer_limit = "no" if $use_referrer_limit eq ""; $ref_domain = $PREFS{'ref_domain'}; $ref_domain = "active-scripts" if $ref_domain eq ""; $order_of_message_numbers = $PREFS{'order_of_message_numbers'}; $disable_user_html_footer_add = $PREFS{'disable_user_html_footer_add'}; $disable_user_html_add = $PREFS{'disable_user_html_add'}; $use_message_numbers = $PREFS{'use_message_numbers'}; $lock_gb = $PREFS{'lock_gb'}; $message_number_pre = $PREFS{'message_number_pre'}; $message_number_post = $PREFS{'message_number_post'}; $timeout = $PREFS{'timeout'}; $timeout = "10" if $timeout eq ""; $show_f1 = $PREFS{'show_f1'}; $show_f1 = "yes" if $show_f1 eq ""; $show_f2 = $PREFS{'show_f2'}; $show_f2 = "yes" if $show_f2 eq ""; $show_f3 = $PREFS{'show_f3'}; $show_f3 = "yes" if $show_f3 eq ""; $show_location = $PREFS{'show_location'}; $show_location = "yes" if $show_location eq ""; $textfontface = $PREFS{'textfontface'}; $replace_dots = $PREFS{'replace_dots'}; $replacement_character = $PREFS{'replacement_character'}; $box_height = $PREFS{'box_height'}; $textfontsize = $PREFS{'textfontsize'}; $limittopost = $PREFS{'limittopost'}; $use_preview = $PREFS{'use_preview'}; $showlettercheck = $PREFS{'showlettercheck'}; $use_own_captcha = $PREFS{'use_own_captcha'}; $captcha_url = $PREFS{'captcha_url'}; $use_email_field = $PREFS{'use_email_field'}; $use_url_field = $PREFS{'use_url_field'}; $use_location_field = $PREFS{'use_location_field'}; $use_email_confirmation = $PREFS{'use_email_confirmation'}; $use_user1_field = $PREFS{'use_user1_field'}; $use_user2_field = $PREFS{'use_user2_field'}; $use_user3_field = $PREFS{'use_user3_field'}; $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 = $COLPREFS{'url_image'}; $email_image = $COLPREFS{'email_image'}; $use_smileys = $PREFS{'use_smileys'}; $use_smileys = "yes" if $use_smileys eq ""; $url_text = $PREFS{'url_text'}; $email_txt = $PREFS{'email_txt'}; $add_page_appears = $PREFS{'add_page_appears'}; $blockurls = $PREFS{'blockurls'}; $includesearch = $PREFS{'includesearch'}; $title = $PREFS{'title'}; $max = $PREFS{'max'}; $border_size = $PREFS{'border_size'}; $alignment = $PREFS{'alignment'}; $alignment_body = $PREFS{'alignment_body'}; $alignment_body = "center" if $alignment_body eq ""; $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'}; $max_smileys = $PREFS{'max_smileys'}; $max_smileys = 5 if $max_smileys eq ""; $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'}; $all_private = $PREFS{'all_private'}; $max_length_chars = $PREFS{'max_length_chars'}; $anti_spam = $PREFS{'anti_spam'}; $anti_ips = $PREFS{'anti_ips'}; $anti_emails = $PREFS{'anti_emails'}; $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 = $COLPREFS{'user_image'}; $user_image_url = $COLPREFS{'user_image_url'}; $use_hr_image = $COLPREFS{'use_hr_image'}; $hr_image = $COLPREFS{'hr_image'}; $use_user_html = $PREFS{'use_user_html'}; $use_user_html_footer = $PREFS{'use_user_html_footer'}; $table_width = $PREFS{'table_width'}; $usebackgroundimage = $COLPREFS{'usebackgroundimage'}; $backgroundimage = $COLPREFS{'backgroundimage'}; $fixedbackground = $COLPREFS{'fixedbackground'}; $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'}; $link = $COLPREFS{'link'}; $vlink = $COLPREFS{'vlink'}; $alink = $COLPREFS{'alink'}; $text = $COLPREFS{'text'}; $searchcolor = $COLPREFS{'searchcolor'}; $user_html = ""; $user_style = ""; $user_html_footer = ""; $thank_you = ""; open(FILE,"$user_html_name") || &oops("$user_html_name"); @user_html = ; $user_html=join(" ",@user_html); close(FILE); open(FILE,"$user_comment_line_name") || &oops("$user_comment_line_name"); @user_comment_line = ; $user_comment_line=join(" ",@user_comment_line); 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/url2.gif"; $email_image = "http://www.active-scripts.net/mail2.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; ($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/url2.gif"; $email_image = "http://www.active-scripts.net/mail2.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 ""); print qq~

Active Guestbook - Standard Preferences Manager Active Guestbook - Standard Preferences Manager
$font 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.) $font ~; 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~
~; #if ($use_referrer_limit ne "yes"){ # print qq~~; #} if ($lock_gb eq "yes"){$lock_gbyes = "checked";}else{ $lock_gbno = "checked";} print qq~ ~; if ($use_email_confirmation eq "yes"){$use_email_confirmationyes = "checked";}else{ $use_email_confirmationno = "checked";} print qq~ ~; if ($anti_spam eq "off"){$anti_spamno = "checked";}else{ $anti_spamyes = "checked";} print qq~ ~; if ($blockurls ne "yes"){$blockurlsno = "checked"; $modsp2345ff = "(strongly recommended)";}else{ $blockurlsyes = "checked";} print qq~ ~; if ($mung eq "on"){$mungyes = "checked";}else{ $mungno = "checked";} print qq~ ~; if ($showlettercheck eq "no"){$showlettercheckno = "checked"; $modsp234ii5 = "
(strongly recommended)";}else {$showlettercheckyes = "checked"; } print qq~ ~; if ($moderated eq "yes"){$moderatedyes = "checked";}else{ $moderatedno = "checked"; $modsp2345NO = "(strongly recommended)";} print qq~ ~; $anti_ips =~ s/\,/ /g; print qq~~; $bad_words =~ s/\,/ /g; print qq~ ~; $showlettercheckyes = $showlettercheckno = ""; if ($limit_no_of_chars_in_line ne "no"){$limit_no_of_chars_in_lineyes = "checked";}else{ $limit_no_of_chars_in_lineno = "checked";} print qq~ ~; $replacement_character = ";" if $replacement_character eq ""; if ($replace_dots eq "yes"){$replace_dotsyes = "checked";}else{ $replace_dotsno = "checked";} print qq~ ~; print qq~ ~; if ($use_referrer_limit eq "yes"){$use_referrer_limityes = "checked";}else{ $use_referrer_limitno = "checked";} print qq~ ~; print qq~~; $anti_emails =~ s/\,/ /g; print qq~~; if ($limittopost eq "off"){$limittopostno = "checked";}else{ $limittopostyes = "checked";} print qq~ ~; if ($use_own_captcha eq "yes"){$use_own_captchayes = "checked";}else{ $use_own_captchano = "checked";} print qq~ ~; print qq~~; print qq~
A - Guestbook Security/Abuse Control
PLEASE NOTE - You currently have your guestbook set to accept messages posted from ANY domain (A12 and A13 below). We STRONGLY recommend that you restrict access to only your domain. This can help limit spam.
$font A0 - Lock guestbook (stops guests from adding new messages) $font Yes: - No:
$font A1 - Require guests to confirm messages via email (use only if lots of spam is getting through) (requires D1 to be correctly set and sendmail to be working on your server) $font Yes: - No:
$font A2 - Block multiple posts in same day by same IP? $font Yes: - No:
$font A3 - Block all urls in messages $modsp2345ff $font Yes: - No:
$font A4 - Mung email addresses (shows as you\~AT\~yourdomain\~DOT\~net) $font Yes: - No:
$font A5 - Require users to enter code when adding messages? $font anti-spam requirement - always ON
$font A6 - Approve messages before they are added $modsp2345
(D3 should be set to YES if you wish to receive email notification)
$font Yes: - No:
$font A7 - List servers or IP addresses (or parts thereof) that you wish to block.
(use a white space between multiple addresses)
$font
$font A8 - List words you would rather your guest did not use
in your guestbook. (Use your imagination.)
$font
$font A9 - Limit no of characters per word - Yes: - No: :: Max no of characters per word - help
$font A10 - Replace dots in messages (mungs urls) - Yes: - No: :: Replacement character -
$font A11 - Set timeout for guests to complete the Add Message page$font minutes
$font A12 - Only allow my domain to add messages (enter domain in A13) $font Yes: - No:
$font A13 - Enter part of the guestbook domain here $font
$font A14 - List email addresses (or parts thereof) that you wish to block.
(use a white space between multiple addresses)
$font
$font A15 - Block GET posts? (should be YES; only set to No if Active Guestbook asks you to.) $font Yes: - No:
$font A16 - Use captcha images on your own server (enter directory url in A17) $font Yes: - No:
$font A17 - Enter url of directory which holds your captcha images $font
~; print qq~ ~; if ($includesearch ne "no"){$includesearchyes = "checked";}else{ $includesearchno = "checked";} print qq~ ~; if ($allow_private_messages ne "no"){$allow_private_messagesyes = "checked";}else{ $allow_private_messagesno = "checked";} print qq~ ~; if ($all_private eq "yes"){$all_privateyes = "checked";}else{ $all_privateno = "checked";} print qq~ ~; $box_height = "3" if $box_height eq ""; print qq~ ~; print qq~ ~; print qq~
B - Presentation
$font B1 - Choose which fields to use/require/show
Field Status Show   Field Status Show
Email ~; $use_email_field = "yes" if $use_email_field eq ""; $use_url_field = "yes" if $use_url_field eq ""; $use_location_field = "yes" if $use_location_field eq ""; $use_user1_field = "no" if $use_user1_field eq ""; $use_user2_field = "no" if $use_user2_field eq ""; $use_user3_field = "no" if $use_user3_field eq ""; if ($use_email_field eq "yes"){ $use_email_fieldselyes = "selected";} elsif ($use_email_field eq "req"){ $use_email_fieldselreq = "selected";} else {$use_email_fieldselno = "selected";} if ($use_url_field eq "yes"){ $use_url_fieldselyes = "selected";} elsif ($use_url_field eq "req"){ $use_url_fieldselreq = "selected";} else {$use_url_fieldselno = "selected";} if ($use_location_field eq "yes"){ $use_location_fieldselyes = "selected";} elsif ($use_location_field eq "req"){ $use_location_fieldselreq = "selected";} else {$use_location_fieldselno = "selected";} if ($use_user1_field eq "yes"){ $use_user1_fieldselyes = "selected";} elsif ($use_user1_field eq "req"){ $use_user1_fieldselreq = "selected";} else {$use_user1_fieldselno = "selected";} if ($use_user1_field eq "yes"){ $use_user1_fieldselyes = "selected";} elsif ($use_user1_field eq "req"){ $use_user1_fieldselreq = "selected";} else {$use_user1_fieldselno = "selected";} if ($use_user2_field eq "yes"){ $use_user2_fieldselyes = "selected";} elsif ($use_user2_field eq "req"){ $use_user2_fieldselreq = "selected";} else {$use_user2_fieldselno = "selected";} if ($use_user3_field eq "yes"){ $use_user3_fieldselyes = "selected";} elsif ($use_user3_field eq "req"){ $use_user3_fieldselreq = "selected";} else {$use_user3_fieldselno = "selected";} $bu = "blocked by A3" if ($blockurls eq "yes"); if ($show_guest_email ne "no"){$show_guest_emailselyes = "selected";} else {$show_guest_emailselno = "selected";} if ($show_guest_url ne "no"){$show_guest_urlselyes = "selected";} else {$show_guest_urlselno = "selected";} if ($show_location ne "no"){$show_locationselyes = "selected";} else {$show_locationselno = "selected";} if ($show_f1 ne "no"){$show_f1selyes = "selected";} else {$show_f1selno = "selected";} if ($show_f2 ne "no"){$show_f2selyes = "selected";} else {$show_f2selno = "selected";} if ($show_f3 ne "no"){$show_f3selyes = "selected";} else {$show_f3selno = "selected";} if ($use_email_confirmation ne "yes"){ print qq~ ~; } else{ print qq~ $font required by A1 ~; } print qq~ Extra field 1
URL ~; if ($blockurls ne "yes"){ print qq~ ~; } else{ print qq~ $bu ~; } print qq~ Extra field 2
Location Extra field 3
$font B2a - Alignment - overall$font ~; if ($alignment eq "left"){$alignmentleft = "checked";} elsif ($alignment eq "right"){$alignmentright = "checked";} else {$alignmentcenter = "checked";} print qq~ Left: - Center: - Right:
$font B2b - Alignment - menus etc.$font ~; if ($alignment_body eq "left"){$alignment_bodyleft = "checked";} elsif ($alignment_body eq "right"){$alignment_bodyright = "checked";} else {$alignment_bodycenter = "checked";} print qq~ Left: - Center: - Right:
$font B3 - Add a Message box $font
$font B4 - Show preview page when guest adds message$font anti-spam requirement ~; print qq~
$font B5 - Include Search Facility $font Yes: - No:
$font B6 - Allow guests to leave private messages $font Yes: - No:
$font B6a - Force all messages to be private (overrides B6 above) $font Yes: - No:
$font B7 - Home page title (NOT the title of your guestbook)$font
$font B8 - Home page address (NOT the address of your guestbook) $font
$font B9 - Address of page guests are taken to after they leave a message (Leave blank to return to main guestbook) $font
$font B10 - Side margin $font $font B11 - Top margin $font
$font B12 - Size of border around each message (set to "0" for no border) $font $font B13 - Show horizontal line between messages $font ~; if ($show_line eq "no") {$show_lineno = "checked";}else{ $show_lineyes = "checked";} print qq~ Yes:
No:
$font B14 - Show links to home page
(you may not want to if using frames)
$font ~; if ($show_home_page_link eq "no") {$show_home_page_linkno = "checked";}else{ $show_home_page_linkyes = "checked";} print qq~ Yes:
No:
$font B15 - Home page link target
(if using frames. If you are NOT using frames, just leave blank)
$font
$font B16 - Font face$font $font B17 - Font size$font
$font B18 - Board width (in pixels or as a percentage)$font $font B19 - Number of messages per page
$font B20 - Width of the fields in the Add a Message page $font $font B21 - Height of message box in the Add a Message page
$font B22 - Brackets used in menus $font Left: - Middle: - Right:
$font B23 - Maximum number of words in message $font $font B24 - Maximum number of characters in message $font
$font Email link display ~; if (($use_email_field eq "no") && ($use_email_confirmation ne "yes")){ print qq~
(blocked by B1)~; } print qq~
$font Web link display ~; print "
(blocked by A3)" if ($blockurls eq "yes"); print qq~
$font B25 - Enable guest email hyperlink ~; print "
(blocked by B1)" if ($show_guest_email ne "yes"); print qq~
$font ~; if ($use_mailto ne "no") {$use_mailtoyes = "checked";}else{ $use_mailtono = "checked";} print qq~ Yes:
No:
$font B28 - Enable guest address web hyperlink ~; print "
(blocked by B1)" if ($show_guest_url ne "yes"); print qq~
$font ~; if ($web_enabled ne "no") {$web_enabledyes = "checked";}else{ $web_enabledno = "checked";} print qq~ Yes:
No:
$font B26 - Email hyperlink display type
(image address set in Color Prefs Manager)
$font ~; if ($email_link_type eq "image"){$email_link_typeimage = "checked";} elsif ($email_link_type eq "address"){$email_link_typeaddress = "checked";} else{ $email_link_typetext = "checked";} print qq~ Address:
Text:
Image:
$font B29 - Web hyperlink display type
(image address set in Color Prefs Manager)
$font ~; if ($web_link_type eq "image"){$web_link_typeimage = "checked";} elsif ($web_link_type eq "address"){$web_link_typeaddress = "checked";} else{ $web_link_typetext = "checked";} print qq~ Address:
Text:
Image:
$font B27 - Text for "text" email hyperlink $font B30 - Text for "text" web hyperlink
$font B31 - Order of messages :
$font ~; if ($order eq "normal"){$ordernormalsel = "checked";} elsif ($order eq "reversed"){$orderrevsel = "checked";} elsif ($order eq "alpha_name"){$orderalphanamesel = "checked";} elsif ($order eq "alpha_message"){$orderalphamesssel = "checked";} elsif ($order eq "random"){$orderrandomsel = "checked";} else{ $ordernormalsel = "checked";} print qq~By date:
Reverse date:
By name:
By message:
Random:
~; print qq~
$font B32 - Display total number of messages$font ~; if ($show_no_of_messages eq "no") {$show_no_of_messagesno = "checked";}else{ $show_no_of_messagesyes = "checked";} print qq~ Yes:
No:
$font B33 - Use Message Numbers
~; if ($order_of_message_numbers ne "reverse"){$order_of_message_numbersnor = "selected";} else {$order_of_message_numbersrev = "selected";} print qq~
Order
$font ~; $use_message_numbersyes = $use_message_numbersno = ""; if ($use_message_numbers eq "yes") {$use_message_numbersyes = "checked"; $messtextblocked = "";}else{ $use_message_numbersno = "checked"; $messtextblocked = "(blocked by B33)"} print qq~ Yes:
No:
$font B34 - Text before number $messtextblocked $font
$font B35 - Text after number $messtextblocked $font
~; if ($style ne "off"){$styleyes = "checked";}else{ $styleno = "checked";} print qq~ ~; print qq~ "; $tempmailpath = $mail_path; $tempmailpath =~ s/\s\-t\s\-oi//gi; print qq~
C - Style/CSS
$font C1 - Use CSS $font Yes: - No:
$font C2 - CSS code$font
~; if ($send_email_to_admin eq "off"){$send_email_to_adminno = "checked";}else{ $send_email_to_adminyes = "checked";} print qq~ ~; if ($send_email_to_guest eq "off"){$send_email_to_guestno = "checked";}else{ $send_email_to_guestyes = "checked";} print qq~ ~; print qq~"; if ($thanks_include_message eq "off"){$thanks_include_messageno = "checked";}else{ $thanks_include_messageyes = "checked";} print qq~ ~; print qq~
D - Email info
$font D1 - Path to your sendmail programme$font
$font D2 - Your email address$font
$font D3 - Send you email notification of new messages
(requires D1 and D2 to be correctly set)
$font Yes: - No:
$font D4 - Send guest a thank you message
(requires D1 and D2 to be correctly set)
$font Yes: - No:
$font D5 - Subject to be shown in your thank you message$font
$font D6 - Text of your thank you message$font
$font D7 - Include original guestbook message in thank you message $font Yes: - No:
~; if ($active_header eq "off"){$active_headerno = "checked";}else{ $active_headeryes = "checked";} print qq~ ~; if ($use_title eq "off"){$use_titleno = "checked";}else{ $use_titleyes = "checked";} print qq~ ~; print qq~"; if ($use_user_html eq "no"){$use_user_htmlno = "checked";}else{ $use_user_htmlyes = "checked";} print qq~ ~; if ($disable_user_html_add ne "yes"){$disable_user_html_addno = "checked";}else{ $disable_user_html_addyes = "checked";} print qq~ ~; print qq~"; if ($use_user_html_footer eq "no"){$use_user_html_footerno = "checked";}else{ $use_user_html_footeryes = "checked";} print qq~ ~; if ($disable_user_html_footer_add ne "yes"){$disable_user_html_footer_addno = "checked";}else{ $disable_user_html_footer_addyes = "checked";} print qq~ ~; print qq~"; if ($allow_html eq "no"){$allow_htmlno = "checked";}else{ $allow_htmlyes = "checked";} print qq~ ~; if ($use_smileys eq "no"){$use_smileysno = "checked";}else{ $use_smileysyes = "checked";} print qq~ ~; print qq~
E - Images/titles
$font E1 - Show Active-Scripts header $font Yes: - No:
$font E2 - Use text title $font Yes: - No:
$font E3 - Title of your guestbook$font
$font E4 - Html before webmaster comment$font
$font E5 - Use your own html header at top of guestbook $font Yes: - No:
$font E5a - Disable your header on the add/preview pages $font Yes: - No:
$font E6 - Header html$font
$font E7 - Use your own html footer at bottom of guestbook $font Yes: - No:
$font E7a - Disable your footer on the add/preview pages $font Yes: - No:
$font E8 - Footer html$font
$font E9 - $font Allow html in messages (best not to) $font Yes: - No:
$font E10 - $font Use smileys $font Yes: - No:
$font E11 - Maximum number of smileys in message $font
F - Guestbook management
$font F1 - Maximum number of messages in entire guestbook$font
$font F2 - Number of days until a message is automatically removed from guestbook.$font
$font F3 - Number of days to complete wipe of messages following removal.$font
$font F4 - No of days your daily automatic backups are retained$font
~; if ($mail_backup_to_admin eq "no"){$mail_backup_to_adminno = "checked";}else{ $mail_backup_to_adminyes = "checked";} print qq~ ~; print qq~~; if ($mail_admin_backups_interval eq "daily"){$mail_admin_backups_intervaldaily = "checked";} print qq~ ~; if ($mail_admin_backups_interval eq "weekly"){$mail_admin_backups_intervalweekly = "checked";} print qq~ ~; print qq~ ~; if ($mail_admin_backups_interval eq "monthly"){$mail_admin_backups_intervalmonthly = "checked";} print qq~ ~; print qq~
G - Backup email
$font G1 - Send regular email backup to admin
(requires D1 and D2 to be correctly set)
$font Yes: - No:
$font G2 - Frequency of regular email of backup to admin$font Daily:
$font Weekly: $font Day of week :
$font Monthly: $font Day of month:

~; } # end view_prefs sub purge_spam{ $spamsecs = 60*60*24; open(USER_FILE,"$cap"); @data = ; close(USER_FILE); open(USER_FILE,">$cap"); $spamdays = $FORM{'spamdays'} if ($setp eq "yes"); $howlong = ($spamsecs * $spamdays); foreach $row (@data){ @fields = split (/\|/, $row); unless (($var - $fields[3]) > $howlong){ print USER_FILE "$row"; } } close(USER_FILE); } sub view_spam{ &seek_cook; &basic_header; print qq~ ~; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); $countt = 0 ; foreach $row (@data){ @fields = split (/\|/, $row); $VAR_CAP{$fields[22]} = "yes"; } open(USER_FILE,"$cap"); @data = ; close(USER_FILE); $countdata = @data = reverse(@data); $spamwords = "ALL messages are initially placed in the Spam Log until the guest confirms the message by entering the correct numbers. If A1 in the Standard Preferences Manager is also turned on, the message will remain in the Spam Log until the guest confirms by email."; $spamwords = "
(No spam found)
" if $countdata <1; print qq~
Spam Log
$spamwords

~; print qq~Control Panel - Automatically purge spam older than days ~; @data; foreach $row (@data){ @fields = split (/\|/, $row); next if $VAR_CAP{$fields[3]} eq "yes"; $captime = $fields[3]; ($secc,$minc,$hourc,$mdayc,$monc,$yearc,$wdayc,$ydayc,$isdstc) = localtime($captime); if ($secc < 10) { $secc = "0$secc"; } if ($minc < 10) { $minc = "0$minc"; } if ($hourc < 10) { $hourc = "0$hourc"; } if ($mdayc < 10) { $mdayc = "0$mdayc"; } $firstdatefound = $mdayc if $started ne "yes"; $started = "yes"; $lastdatefound = $mdayc; if ($FOUND{$mdayc} ne "yes") { $nofdds++; push (@datesfound,$mdayc ) if ($nofdds < 29); $FOUND{$mdayc} = "yes"; } if ($nofdds < 29){ $TOT{$mdayc}++ ; $maxx = $TOT{$mdayc} if $TOT{$mdayc} > $maxx; } } @datesfound = reverse(@datesfound); print qq~ ~; $homdates =@datesfound; $homdates = 1 if $homdates < 1; $widthh = int(750/$homdates) -4; $widthh = 100 if $homdates < 6; foreach $one(@datesfound){ $heightt = (60*$TOT{$one})/$maxx; print qq~ ~; } print ""; foreach $one(@datesfound){ print qq~~; } print qq~
$TOT{$one}
$one
~; foreach $row (@data){ @fields = split (/\|/, $row); next if $VAR_CAP{$fields[3]} eq "yes"; $captime = $fields[3]; ($secc,$minc,$hourc,$mdayc,$monc,$yearc,$wdayc,$ydayc,$isdstc) = localtime($captime); if ($secc < 10) { $secc = "0$secc"; } if ($minc < 10) { $minc = "0$minc"; } if ($hourc < 10) { $hourc = "0$hourc"; } if ($mdayc < 10) { $mdayc = "0$mdayc"; } $yearc = $yearc + 1900; $spamdate = "$mdayc"." "."$months[$monc]"." "."$yearc $hourc:$minc:$secc"; $countt++; $countt = 0 if $countt == 2; $bg = ""; $bg = "bgcolor=#f0f0f0" if $countt == 1; $fields[5] = $fields[4] if $fields[5] eq ""; print qq~ ~; } print "
DateMessage
$spamdate$fields[5]
"; exit; } sub view_to_edit{ &seek_cook; $FORM{'vtenpp'} = 20 if (($FORM{'vtenpp'} eq "") || ($FORM{'vtenpp'} == 0) ); $no_displayed = $FORM{'vtenpp'}; $no_displayed = 3000000000 if $FORM{'everything'} eq "yes"; 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

$font Control Panel - Search ~; if ($FORM{'everything'} ne "yes"){ print qq~ - show messages per page

Delete ALL Messages - Delete All Messages WAITING APPROVAL - Delete All PRIVATE Messages

~; } @datalist = (); $count = 1; if ($FORM{'everything'} eq "yes"){ foreach $row (@data_ordered){ @fields = split (/\|/, $row); next if (($fields[10] eq "del") && ($FORM{'inctrash'} ne "yes") ); next if (($fields[15] eq "waiting") && ($FORM{'incwaiting'} ne "yes") ); next if (($fields[16] eq "yes") && ($FORM{'incprivate'} ne "yes") ); next if ((($fields[16] ne "yes") && ($fields[15] ne "waiting") && ($fields[10] ne "del")) && ($FORM{'incnormal'} 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] . " " . $fields[17] . " " . $fields[18] . " " . $fields[19] . " "); } @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 close(USER_FILE); @datalist = @hits; } else{ foreach $row (@data_ordered){ @fields = split (/\|/, $row); unless ($fields[10] eq "del"){ push (@datalist, $row); } } } print "
"; $count = 1; $grouped = 0; $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; if ($start_number >0){ print qq~ [Start] ~; } unless ($old_start_number < 0){ print qq~ [Previous] ~; } &show_edit_number_menu unless ($number_of_messages <($no_displayed+1)); 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 ~; } } $individno = $start_number; 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
~; } elsif ($fields[10] eq "del"){ print qq~
THIS MESSAGE IS WAITING FOR APPROVAL
~; } else{ if ($count ==1){ print qq~
THIS MESSAGE IS DELETED
~; } else{ print qq~
~; } } # end else if ($fields[4]){ print qq~ ~; } else{ print qq~ ~; } if ($fields[11]){ print qq~ ~; } &date_mod; $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print qq~ ~; if ($fields[5]){ print qq~ ~; } if ($fields[17]){ print qq~ ~; } if ($fields[18]){ print qq~ ~; } if ($fields[19]){ print qq~ ~; } print qq~ ~; if ($fields[6]){ print qq~ ~; } if ($fields[7]){ print qq~ ~; } if ($fields[10] ne "del"){ $addedbit = "&search_words=$FORM{'search_words'}&incnormal=yes&everything=yes" if $FORM{'everything'} eq "yes"; 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]
$TXT_where_in_the_world: $fields[5]
$TXT_user1_field: $fields[17]
$TXT_user2_field: $fields[18]
$TXT_user3_field: $fields[19]
Date: $condate
$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~ ( Select for bulk delete ) ~; print qq~

~; $individno++; $count++; if ($count >2){ $count = 1; } } } print qq~
~; unless ($old_start_number < 0){ print qq~ [Previous] ~; } &show_edit_number_menu unless ($number_of_messages <($no_displayed+1)); unless ($new_start_number > ($number_of_messages -1 )){ print qq~ [Next]
~; } print qq~
~; &search_form; } # 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"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; $start_number = $FORM{'start_number'}; $start_number = $start_number -1 if $start_number > 1; print qq~ ~; &main_headerb; print qq~
Active Guestbook Message Manager

$font Message deleted
~; } sub delete_all_private{ &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 ($fields[16] ne "yes"){ 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"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; $start_number = $FORM{'start_number'}; $start_number = $start_number -1 if $start_number > 1; print qq~ ~; &main_headerb; print qq~

Active Guestbook Message Manager

$font All Private Messages Deleted
~; } sub bulk_delete{ &seek_cook; foreach $todel (@todel){ $TODEL{$todel} = "yes"; } &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 ($TODEL{$fields[0]} ne "yes"){ 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"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; $start_number = $FORM{'start_number'}; $start_number = $start_number -1 if $start_number > 1; print qq~ ~; &main_headerb; print qq~

Active Guestbook Message Manager

$font Messages Deleted
~; } sub delete_all_waiting{ &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 ($fields[15] ne "waiting"){ 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"; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); &content; &main_headera; $start_number = $FORM{'start_number'}; $start_number = $start_number -1 if $start_number > 1; print qq~ ~; &main_headerb; print qq~

Active Guestbook Message Manager

$font Deleted All Messages Waiting Approval
~; } 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); $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; foreach $row (@data) { @fields = split (/\|/, $row); if ($ref eq $fields[0]) { &date_mod; &content; &plain_header; print qq~ Active Guestbook Message Editor
$font Message Editor | Control Panel

~; print qq~ ~; if ($fields[4]) { print qq~ ~; } else { print qq~ ~; } print qq~ ~; if ($fields[5]) { print qq~ ~; } if ($fields[11]) { print qq~ ~; } if ($fields[18]) { print qq~ ~; } if ($fields[18]) { print qq~ ~; } if ($fields[19]) { 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]
$TXT_your_web_page_address: $fields[11]
$TXT_user1_field: $fields[17]
$TXT_user2_field: $fields[18]
$TXT_user3_field: $fields[19]
$web_comment:
Send notification email to guest
(requires valid email address above)


~; } } } # 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"; # $rtuse = $row; } } close(USER_FILE); &release_file_lock("$location_of_lock_file"); @nfields = split (/\|/, $rtuse); $guest_email = $fields[4]; if (($FORM{'send_guest_notification'} eq "yes") && ($guest_email ne "" ) ){ open (MAIL, "|$mail_path"); print MAIL "Content-Type: text/plain; charset=\"$TXT_main_language\"\n"; print MAIL "To: $guest_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: $title update\n\n"; if ($guest_email) { print MAIL "$TXT_your_name: $nfields[1]\n"; } if ($fields[5]) { print MAIL "$TXT_where_in_the_world: $nfields[5]\n"; } if ($fields[11]) { print MAIL "$TXT_your_web_page_address: $nfields[11]\n";} $converted_message = $message; $converted_message =~ s/
/\n/g; print MAIL "$converted_message\n"; if ($fields[17]) {$TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; print MAIL "$TXT_user1_field: $fields[17]\n";} if ($fields[18]) {$TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; print MAIL "$TXT_user2_field: $fields[18]\n";} if ($fields[19]) {$TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print MAIL "$TXT_user3_field: $fields[19]\n\n";} print MAIL "$web_comment: $comment\n"; print MAIL "=========================\n"; close(MAIL); } &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); $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; 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
$fontMessage Editor | Control Panel

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

$TXT_your_message :

$TXT_your_email_address :
$TXT_your_web_page_address :
$TXT_where_in_the_world :
$TXT_user1_field :
$TXT_user2_field :
$TXT_user3_field :
Date:
Note that edited dates will not be affected by changes in the Date Format Manager.)
$web_comment:
Send notification email to guest
(requires valid email address above)

~; print "\n\n"; } } # end if right one } # end sub change1 sub change2 { &seek_cook; $ref = $FORM{'ref'}; $start_number = $FORM{'start_number'}; $start_number = $start_number -1 if $start_number > 0; $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/\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]|$FORM{'user1_field'}|$FORM{'user2_field'}|$FORM{'user3_field'}|$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); if (($FORM{'send_guest_notification'} eq "yes") && ($guest_email ne "" ) ){ open (MAIL, "|$mail_path"); print MAIL "Content-Type: text/plain; charset=\"$TXT_main_language\"\n"; print MAIL "To: $guest_email\n"; print MAIL "From: $admin_email\n"; print MAIL "Subject: $title update\n\n"; if ($guest_email) { print MAIL "Email: $guest_email\n"; } if ($location) { print MAIL "Location: $location\n"; } if ($url) { print MAIL "URL: $url\n";} $converted_message = $message; $converted_message =~ s/
/\n/g; print MAIL "$converted_message\n"; if ($FORM{'user1_field'}) {$TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; print MAIL "$TXT_user1_field: $FORM{'user1_field'}\n";} if ($FORM{'user2_field'}) {$TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; print MAIL "$TXT_user2_field: $FORM{'user2_field'}\n";} if ($FORM{'user3_field'}) {$TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print MAIL "$TXT_user3_field: $FORM{'user3_field'}\n\n";} if ($comment) { print MAIL "$web_comment: $comment\n";} print MAIL "=========================\n"; close(MAIL); } &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
$font No deleted messages found.
Control Panel ~; exit; } else { @sorteddata = sort(@datalist); @reversesorteddata = reverse(@sorteddata); &basic_header; print qq~

Active Guestbook Trash Manager
$font Control Panel - Empty Trash

~; $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; $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print qq~ ~; if ($fields[5]) { print qq~ ~; } if ($fields[6]) { print qq~ ~; } if ($fields[17]) { print qq~ ~; } if ($fields[18]) { print qq~ ~; } if ($fields[19]) { 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]
$TXT_user1_field: $fields[17]
$TXT_user2_field: $fields[18]
$TXT_user3_field: $fields[19]
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; } &update_database; &release_file_lock("$location_of_lock_file"); } } sub update_database { &purge_spam; open(USER_FILE,"$guestbook_data_name"); # reset counter/refnumbers if necessary @data = ; close(USER_FILE); open(USER_FILE,"$guestbook_data_name"); @data = ; close(USER_FILE); open(USER_FILE,">$guestbook_data_name"); foreach $row (@data){ $good = "yes";$count = 0; @fields = split (/\|/, $row); $good = "no" if (($fields[0] eq "") ||($fields[1] eq "") ||($fields[2] eq "")) ; @pipes = split (//, $row); foreach (@pipes){ $count++ if $_ eq "|"; } $good = "no" if $count != 31; if ($good eq "no"){ open(FILEg,">>$bad_rows_name"); print FILEg "$row"; close(FILEg); } elsif (($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); } 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 "Content-Type: text/plain; charset=\"$TXT_main_language\"\n"; 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); $noofbackups = @files; if ($noofbackups > 5){ foreach $file (@files){ if (-M "./$guestbook_backups_directory/$file" > $days_to_delete_backup_files){ unlink("./$guestbook_backups_directory/$file"); }}}} 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] . " " . $fields[17] . " " . $fields[18] . " " . $fields[19] . " "); } @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); }}} 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 vsc{ &seek_cook; &content; open(COLFILE,"$colprefs_name"); @COLLINES = ; close(COLFILE); foreach(@COLLINES){ print "$_"; }} 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{ #if ($lastnotcheck ne $FORM{'lastnot'}){ #&content; #print qq~

$title

$TXT_incorrect_selection ~; #exit; #} $TXT_type_letters_only = "Enter the underlined numbers:" if $TXT_type_letters_only eq ""; &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"; if ($use_user_html eq "yes"){ &user_html if $disable_user_html_add ne "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; $url =~ s/\"//g; $guest_email =~ s/\"//g; $url =~ s/\'//g; $guest_email =~ s/\'//g; $capmessage = $FORM{'requiredmessage'}; $capmessage = $message; $capmessage =~ s/\s//gi; $capmessage =~ s/\n//gi; $capmessage =~ s/\r//gi;$capmessage =~ s/\"//gi;$capmessage =~ s/\'//gi; $FORM{'user1_field'} =~ s/\"//g; $FORM{'user2_field'} =~ s/\"//g; $FORM{'user3_field'} =~ s/\"//g; print qq~
~; if ($use_smileys eq "yes") { open(FILE,"$smileys"); @smileys = ; close(FILE); foreach(@smileys){ @smiley = split(/\|/, $_); $smiley[2] =~ s/http\:\/\///gi; $message =~ s/\:$smiley[1]\://g; } } $use_email_field = "yes" if $use_email_field eq ""; $use_url_field = "yes" if $use_url_field eq ""; $use_location_field = "yes" if $use_location_field eq ""; $use_user1_field = "no" if $use_user1_field eq ""; $use_user2_field = "no" if $use_user2_field eq ""; $use_user3_field = "no" if $use_user3_field eq ""; # $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
~; if ($guest_email ne "") { print qq~ ~; } if ($location ne "") { print qq~ ~; } if ($url ne "") { print qq~ ~; } if ($FORM{'user1_field'} ne "") { $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; print qq~ ~; } if ($FORM{'user2_field'} ne "") { $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; print qq~ ~; } if ($FORM{'user3_field'} ne "") { $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print qq~ ~; } print qq~ ~; if ($showlettercheck eq "gghhgghh"){ open(BAK,"$imgpw"); @imgpw = ; close BAK; foreach $juy (@imgpw){ @imgfs = split (/\|/, $juy); $IMGFWS{$imgfs[0]} = $imgfs[1]; } $random = int( rand(9)) + 2030; print qq~ ~; #print qq~ # ~; } print qq~
$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
$TXT_user1_field$FORM{'user1_field'}
$previewline
$TXT_user2_field$FORM{'user2_field'}
$previewline
$TXT_user3_field$FORM{'user3_field'}
$previewline
$TXT_type_letters_only
~; $ran = rand(100000000); print ""; for ($x = 0; $x < 200; $x++){ $y = int(rand(10)); next if $y == 10; next if $FOUND{$y} eq "yes"; push (@bnums, $y); $FOUND{$y} = "yes"; $totalnums++; if ($use_own_captcha eq "yes"){ $captcha_url =~ s/\/$//gi; $captcha_url =~ s/http\:\/\///gi; $catpcha_image_url = $captcha_url; } else{ $catpcha_image_url = "www.active-scripts.net/a"; } print qq~~; last if $totalnums >9; } $a = int(rand(10)); $b = int(rand(10)); while ($a == $b){ $b = int(rand(10)); } open(CFILE,">>$cap"); flock(CFILE,2); print CFILE "$ran|$bnums[$a]|$bnums[$b]|$var|$capmessage|$message||||||||\n"; print qq~ ~; for ($x = 0; $x < 10; $x++){ if (($x == $a) || ($x == $b)) { print qq~ ~; } else{ print qq~ ~; } } print qq~ ~; close CFILE; print "
" ; print qq~
~; print qq~
$previewline
$TXT_type_letters_only
$previewline
$TXT_type_letters_only
$cod2
#
#
$previewline
~; if ($use_user_html_footer eq "yes"){ &user_html_footer if $disable_user_html_footer_add ne "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

$font 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

$font 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

$font 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

$font 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
$font 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{ $mb = $middle_bracket; print qq~$left_bracket~; if ($ipoops ne "yes"){ if ($action ne "add"){ if ($lock_gb eq "yes"){ $TXT_add_a_message = $mb = ""; } if ($add_page_appears ==0){ print qq~$TXT_add_a_message $mb ~; } elsif ($add_page_appears ==2){ if (($action eq "reload") || ($action eq "")){ print qq~$TXT_add_a_message $mb ~; } else{ print qq~ $TXT_add_a_message $mb ~; } } } } unless ($show_home_page_link eq "no"){ print qq~$home_page_title ~; print "$middle_bracket" if (($includesearch ne "no") || ($action eq "add")); } 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")){ if ($includesearch ne "no"){ print qq~ $TXT_search $right_bracket
~; } else{ print qq~ $right_bracket
~; } } else{ if ($includesearch ne "no"){ print qq~ $TXT_search $right_bracket

~; } else { print qq~ $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")||($action eq "reload") ||($action eq "") ||($action eq "view_skin") ); 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{ if ($action eq "view_to_edit"){ $checkedincprivate = $checkedincwaiting = $checkedincnormal = "checked" if $FORM{'everything'} ne "yes"; $checkedinctrash = "checked" if $FORM{'inctrash'} eq "yes"; $checkedincnormal = "checked" if $FORM{'incnormal'} eq "yes"; $checkedincwaiting = "checked" if $FORM{'incwaiting'} eq "yes"; $checkedincprivate = "checked" if $FORM{'incprivate'} eq "yes"; $TXT_you_can_search_this_guestbook_by = "Include trash - private - waiting approval - normal "; $TXT_searchtext = "Search Text"; $TXT_searchsearch = "Search"; $hidden = ""; } print qq~
~; if ($action eq "view_to_edit"){ print qq~ $hidden ~; } else{ print qq~ ~; } 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~
~; } } 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
$font Control Panel
Please enter your new password twice.
(please note that passwords are case-sensitive)
$font New password $font
$font New password again $font
$font
~; &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); print "Set-Cookie:activea=$newpass\n"; # &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.

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

Active Guestbook Control Panel$font
Please enter password.
You will need to have Cookies enabled for easy navigation
through the Control Panel features.
$font
Password
~; &inter_footer; } sub seek_cook { if (($cookie_default eq "") || (!$cookie_default) ){ &content; print "$valid_ip"; exit; } $xyza= $FORM{'bottom'}; unless ($xyza eq $cookie_default){ if ($COOK{'activea'} ne ""){ $password = $COOK{'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") { print "Set-Cookie:activea=$password\n"; # &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 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

$font Return to Guestbook | Return to Control Panel

Restore defaults

Top of main guestbook page.
Main language (currently $TXT_main_language)

[ | 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.

$font 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.





~; $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; $TXT_select_this_number = "Select this number" if $TXT_select_this_number eq ""; print qq~




(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
<--text that appears when confirmation request email sent
<-- subject of the email sent to guests requesting confirmation
<--text that appears in the email sent requesting confirmation

Add a message preview screen.



<--the enter the underlined numbers text
<--when an incorrect authorisation code is entered

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
<-- Blocked multiple messages
<-- Incorrect selection on Add page

Days.

Months.

~; } sub view_colprefs { &seek_cook; $ignore = $FORM{'ignore'}; open(COLFILE,"$colprefs_name"); @cols = ; close(COLFILE); unless ($ignore eq "yes") # only backup when you first enter view_colprefs { 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

$font Return to Guestbook | Use these colors/Return to Control Panel

Cancel all changes - Save as new skin - Skins Manager
(If you have made any changes, you first need to click UPDATE PREFERENCES using the button at the bottom.)$font
PLEASE NOTE Any CSS code in the Standard Preferences Manager (section C) can override the settings below.
~; $cssenabled = "disabled"; $cssenabled = "enabled" if ($style ne "off"); print qq~CSS is currently $cssenabled.~; if ($active_header eq "on"){print qq~
You can remove the active-scripts image via the Standard Preferences Manager. ~;} if ($demo ne "on"){ if ((($var - $stamp) > $grace) && ($foundasimgcol eq "yes")){ print qq~
IMAGES WILL NOT WORK AT THE MOMENT AS YOU HAVE IMAGES HOSTED ON
THE ACTIVE-SCRIPTS.NET WEBSITE. YOU NEED TO MOVE THESE TO YOUR OWN SITE
AND CHANGE THE SETTINGS BELOW ACCORDINGLY.
~; } elsif ($foundasimgcol eq "yes"){ $alltogo = $stamp+$grace; $tooo = int(($alltogo -$var)/60/60); print qq~

ACTION REQUIRED - YOU MUST MOVE YOUR IMAGES ONTO YOUR OWN SERVER. AT LEAST ONE IMAGE
BELOW IS HOSTED ON ACTIVE-SCRIPTS.NET. YOU NEED TO CHANGE THE SETTINGS
BELOW ACCORDINGLY. YOU HAVE $tooo HOURS LEFT TO DO THIS. ~; } } print qq~ ~; if ($user_image eq "no"){$user_imageno = "checked";}else{ $user_imageyes = "checked";} print qq~ ~; print qq~ ~; if ($usebackgroundimage eq "no"){$usebackgroundimageno = "checked";}else{ $usebackgroundimageyes = "checked";} print qq~ ~; $fixedno = $fixedyes = ""; if ($fixedbackground eq "fixed"){$fixedyes = "checked";} else {$fixedno = "checked";} print qq~ ~; #($hr_image = "http://www.active-scripts.net/line.gif") if ($hr_image eq ""); if ($use_hr_image ne "yes"){$use_hr_imageno = "checked";}else{ $use_hr_imageyes = "checked";} print qq~ ~; print qq~ ~; ############################ START OF HEADER 1 print qq~ ~; print qq~ ~; ######## END OF HEADER 1 ########## START OF MESSAGE 1 print qq~ ~; print qq~ ~; #### END OF MESSAGE 1 ##### 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~
$font Use your own image at top of guestbook $font Yes: - No:
$font Address of your image$font
$font Use your own background image $font Yes: - No:
$font Background image behaviour$font Scrolling: Fixed:
$font Address of your background image$font
$font Use your own image between messages $font Yes: - No:
$font Address of image between messages$font
$font Address for "image" email hyperlink
(enabled in B26 Standard Prefs Manager)
$font Address for "image" web hyperlink
(enabled in B29 Standard Prefs Manager)
$font 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.
$font
Item
$font
Color
$font
Samples
$font Header 1 background
Header 1
$font Header 1 text
$font Message 1 background
Message 1
$font Message 1 text
$font Header 2 background
Header 2
$font Header 2 text
$font Message 2 background
Message 2
$font Message 2 text
$font Main page background
Main text
$font Main text
$font Comment text color #   #
$font Search box background color
$font Link color
$font Visited link color
$font 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.www//:ptth\"=crs gmi<>\"lmth.daolnwod_koobtseug/ger/ten.stpircs-evitca.www//:ptth\"=ferh a<"; } else{ $text11 = "/gmi/ten.stpircs-evitca.www//:ptth\"=crs gmi<>\"lmth.daolnwod_koobtseug/ten.stpircs-evitca.www//: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; 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 "searchcolor=$FORM{'searchcolor'}=\n"; print COLFILE "usebackgroundimage=$FORM{'usebackgroundimage'}=\n"; print COLFILE "fixedbackground=$FORM{'fixedbackground'}=\n"; print COLFILE "backgroundimage=$FORM{'backgroundimage'}=\n"; print COLFILE "use_hr_image=$FORM{'use_hr_image'}=\n"; print COLFILE "hr_image=$FORM{'hr_image'}=\n"; print COLFILE "user_image=$FORM{'user_image'}=\n"; print COLFILE "user_image_url=$FORM{'user_image_url'}=\n"; print COLFILE "url_image=$FORM{'url_image'}=\n"; print COLFILE "email_image=$FORM{'email_image'}=\n"; close(COLFILE); &content; print qq~$title
$font Now loading new color preferences
~; } ################# sub edit_langprefs { &seek_cook; open(PREFS,">$langprefs_name"); print PREFS "TXT_approve_subject=$FORM{'TXT_approve_subject'}=\n"; print PREFS "TXT_incorrect_selection=$FORM{'TXT_incorrect_selection'}=\n"; print PREFS "TXT_approve_text=$FORM{'TXT_approve_text'}=\n"; 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_emailconfsent=$FORM{'TXT_emailconfsent'}=\n"; print PREFS "TXT_user1_field=$FORM{'TXT_user1_field'}=\n"; print PREFS "TXT_user2_field=$FORM{'TXT_user2_field'}=\n"; print PREFS "TXT_user3_field=$FORM{'TXT_user3_field'}=\n"; print PREFS "TXT_select_this_number=$FORM{'TXT_select_this_number'}=\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_main_language=$FORM{'TXT_main_language'}=\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_code_not_correct=$FORM{'TXT_code_not_correct'}=\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_multiple_not_allowed=$FORM{'TXT_multiple_not_allowed'}=\n"; print PREFS "TXT_where_in_the_world=$FORM{'TXT_where_in_the_world'}=\n"; print PREFS "TXT_type_letters_only=$FORM{'TXT_type_letters_only'}=\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
$font Language preferences updated
~; } 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 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 "

$font Restoring last saved color preferences.
~; &inter_footer; } sub actions { if ($demo eq "off"){ &import_skin if ($action eq "import_skin"); &bulk_delete if ($action eq "bulk_delete"); &purge_spam if ($action eq "purge_spam"); &view_spam if ($action eq "view_spam"); &set_purge if ($action eq "set_purge"); &view_history if ($action eq "view_history"); &view_to_import_skin if ($action eq "view_to_import_skin"); &read if ($action eq "preview_skin"); &view_import_pane_first if ($action eq "view_import_pane_first"); &view_import_pane if ($action eq "view_import_pane"); &import_skin if ($action eq "import_skin"); &load_skin if ($action eq "load_skin"); &read if ($action eq "view_skin"); &delete_skin if ($action eq "delete_skin"); &view_to_save_skin if ($action eq "view_to_save_skin"); &save_skin if ($action eq "save_skin"); &empty_all_trash if ($action eq "empty_all_trash"); &add_to_active if ($action eq "add_to_active"); &delete_all if ($action eq "delete_all"); &delete_all_waiting if ($action eq "delete_all_waiting"); &delete_all_private if ($action eq "delete_all_private"); &already_added if ($action eq "already_added"); &edit_dateprefs if ($action eq "edit_dateprefs"); &unlinkip if ($action eq "unlinkip"); &link if ($action eq "lin"); &generate_email_list if ($action eq "generate_email_list"); &finish_start if ($action eq "finish_start"); &read if ($action eq ""); &approve if ($action eq "approve"); &read if ($action eq "setup"); &read if ($action eq "reload"); &add if ($action eq "add"); &write if ($action eq "write"); &rate if ($action eq "rate"); &write if ($action eq "preview"); &write if ($action eq "post_preview"); &write if ($action eq "no_preview"); &view_prefs if ($action eq "view_prefs"); &change1 if ($action eq "change1"); &change2 if ($action eq "change2"); &view_to_edit if ($action eq "view_to_edit"); &view_smileys if ($action eq "view_smileys"); &view_to_add_smiley if ($action eq "view_to_add_smiley"); &add_smiley if ($action eq "add_smiley"); &add_response1 if ($action eq "add_response1"); &enable_disable_smiley if ($action eq "enable_disable_smiley"); &edit_smiley if ($action eq "edit_smiley"); &view_to_edit_smiley if ($action eq "view_to_edit_smiley"); &remove_smiley if ($action eq "remove_smiley"); &view_to_undo if ($action eq "view_to_undo"); &search if ($action eq "search"); &view_change_password if ($action eq "view_change_password"); &view_backups if ($action eq "view_backups"); &sar if ($action eq "sar"); &vsc if ($action eq "vsc"); &view_single_backup if ($action eq "view_single_backup"); &view_colprefs if ($action eq "view_colprefs"); &view_langprefs if ($action eq "view_langprefs"); &delete_ips if ($action eq "delete_ips"); &cancel_color_change if ($action eq "cancel_color_change"); &control_panel if ($action eq "control_panel"); &bug if ($action eq "bug"); &edit_prefs if ($action eq "edit_prefs"); &restore_coldefaults if ($action eq "restore_coldefaults"); &save_user_defaults if ($action eq "save_user_defaults"); &view_skins if ($action eq "view_skins"); &restore_user_defaults if ($action eq "restore_user_defaults"); &restore_backups if ($action eq "restore_backups"); &restore_defaults if ($action eq "restore_defaults"); &undo_last_restore if ($action eq "undo_last_restore"); &change_password if ($action eq "change_password"); &edit_colprefs if ($action eq "edit_colprefs"); &edit_langprefs if ($action eq "edit_langprefs"); &trash_item if ($action eq "trash_item"); &undelete_item if ($action eq "undelete_item"); &delete_item if ($action eq "delete_item"); &add_response2 if ($action eq "add_response2"); &restore_language_defaults if $action eq "restore_language_defaults"; &approve_message if $action eq "approve_message"; &view_dateprefs if $action eq "view_dateprefs"; } else{ &demostuff if ($action eq "import_skin"); &demostuff if ($action eq "delete_all_waiting"); &demostuff if ($action eq "bulk_delete"); &demostuff if ($action eq "purge_spam"); &view_spam if ($action eq "view_spam"); &view_history if ($action eq "view_history"); &demostuff if ($action eq "set_purge"); &demostuff if ($action eq "delete_all_private"); &view_import_pane_first if ($action eq "view_import_pane_first"); &read if ($action eq "preview_skin"); &view_to_import_skin if ($action eq "view_to_import_skin"); &view_import_pane if ($action eq "view_import_pane"); &demostuff if ($action eq "import_skin"); &demostuff if ($action eq "load_skin"); &read if ($action eq "view_skin"); &demostuff if ($action eq "delete_skin"); &view_to_save_skin if ($action eq "view_to_save_skin"); &demostuff if ($action eq "save_skin"); &view_skins if ($action eq "view_skins"); &demostuff if ($action eq "empty_all_trash"); &demostuff if ($action eq "delete_all"); &demostuff if ($action eq "edit_dateprefs"); &demostuff if ($action eq "add_to_active"); &demostuff if ($action eq "already_added"); &demostuff if ($action eq "generate_email_list"); &demostuff if ($action eq "rate"); &demostuff if ($action eq "enable_disable_smiley"); &demostuff if ($action eq "edit_smiley"); &demostuff if ($action eq "vsc"); &view_to_edit_smiley if ($action eq "view_to_edit_smiley"); &demostuff if ($action eq "remove_smiley"); &link if ($action eq "lin"); &read if ($action eq ""); &read if ($action eq "reload"); &view_to_add_smiley if ($action eq "view_to_add_smiley"); &demostuff if ($action eq "add_smiley"); &read if ($action eq "setup"); &demostuff if ($action eq "approve"); &view_dateprefs if ($action eq "view_dateprefs"); &add if ($action eq "add"); &write if ($action eq "write"); &write if ($action eq "preview"); &write if ($action eq "post_preview"); &write if ($action eq "no_preview"); &view_prefs if ($action eq "view_prefs"); &change1 if ($action eq "change1"); &view_to_edit if ($action eq "view_to_edit"); &add_response1 if ($action eq "add_response1"); &view_to_undo if ($action eq "view_to_undo"); &search if ($action eq "search"); &view_change_password if ($action eq "view_change_password"); &view_backups if ($action eq "view_backups"); &view_single_backup if ($action eq "view_single_backup"); &view_colprefs if ($action eq "view_colprefs"); &view_langprefs if ($action eq "view_langprefs"); &demostuff if ($action eq "cancel_color_change"); &view_smileys if ($action eq "view_smileys"); &demostuff if ($action eq "edit_smileys"); &control_panel if ($action eq "control_panel"); &demostuff if ($action eq "change2"); &demostuff if ($action eq "bug"); &demostuff if ($action eq "edit_prefs"); &demostuff if ($action eq "edit_langprefs"); &demostuff if ($action eq "restore_coldefaults"); &demostuff if ($action eq "save_user_defaults"); &demostuff if ($action eq "restore_user_defaults"); &demostuff if ($action eq "restore_backups"); &demostuff if ($action eq "restore_defaults"); &demostuff if ($action eq "undo_last_restore"); &demostuff if ($action eq "change_password"); &demostuff if ($action eq "edit_colprefs"); &demostuff if ($action eq "trash_item"); &demostuff if ($action eq "undelete_item"); &demostuff if ($action eq "delete_item"); &add_response2 if ($action eq "add_response2"); &demostuff if ($action eq "restore_language_defaults"); &demostuff if ($action eq "approve_message"); } } sub demostuff { &content; &main_header; &active_header; print qq~
$font Sorry. This guestbook is running in demo mode. That action is not enabled.
Download Active Guestbook for free and install it on your own site for full functionality.
Back
~; exit; } sub required_script { print qq~~; } sub delete_ips{ if (($FORM{'type'} eq "first") && ($FORM{'number'} == $stamp)){ open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; close(USER_FILE); &content; print qq~

Make a backup?
~; exit; } elsif (($FORM{'type'} eq "third") && ($FORM{'number'} == $stamp)){ open(USER_FILE,"$guestbook_temp_name") || &oops('$guestbook_temp_name'); @data = ; close(USER_FILE); &content; print qq~ This is the backup of guestbook data before you last edited
~; exit; } elsif (($FORM{'type'} eq "fifth") && ($FORM{'number'} == $stamp)){ open(USER_FILE,"$bad_rows_name"); @data = ; close(USER_FILE); &content; print qq~ This is the bad row list
~; exit; } elsif (($FORM{'type'} eq "fourth") && ($FORM{'number'} == $stamp)){ unlink($guestbook_temp_name); &content; print qq~ Backup deleted ~; exit; } elsif (($FORM{'type'} eq "sixth") && ($FORM{'number'} == $stamp)){ unlink($bad_rows_name); &content; print qq~ Bad row file deleted ~; exit; } elsif (($FORM{'type'} eq "seventh") && ($FORM{'number'} == $stamp)){ &content; open(USER_FILE,">$update_name") ; print USER_FILE "100"; close(USER_FILE); print "update back "; exit; } elsif (($FORM{'type'} eq "second") && ($FORM{'number'} == $stamp)){ if ($FORM{'backup'} eq "yes"){ ©_file($guestbook_data_name, $guestbook_temp_name); } &content; $text = $FORM{'text'}; open(USER_FILE,">$guestbook_data_name") || &oops('$guestbook_data_name'); print USER_FILE "$text"; close(USER_FILE); print "finished "; exit; } else{ &content; print qq~no~; exit; } } sub thanks{ &content; &main_headera; $confd = 3; $confd = 20 if (($admin_email =~ /active-scripts/) && ($send_email_to_admin eq "on")); print qq~ ~; &main_headerc; &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; print qq~

~; if ($use_email_confirmation eq "yes") { print "$TXT_emailconfsent"; } elsif ($private_message_check eq "yes") { print "$TXT_has_been_added_private"; } elsif ($moderated eq "yes") { print "$TXT_has_been_added_moderated"; if (($admin_email =~ /active-scripts/) && ($send_email_to_admin eq "on")){ print "

You need to change the address in D2 in the Standard Preferences Manager."; } } else { print "$TXT_has_been_added"; } print qq~ ~; print qq~


~; &user_html_footer if $use_user_html_footer eq "yes"; print qq~
~; print qq~~; } ############### sub no_thanks { &content; &main_headera; print qq~ ~; &main_headerc; print qq~

~; print qq~ ~; } sub send_email_to_guest { #$admin_email = "test\@test.com" if $admin_email eq ""; if (($action eq "approve") || ($action eq "approve_message")) { $guest_email = @approve_fields[4]; $message = @approve_fields[2]; $location = @approve_fields[5]; $url = @approve_fields[11]; $FORM{'user1_field'} = @approve_fields[17]; $FORM{'user2_field'} = @approve_fields[18]; $FORM{'user3_field'} = @approve_fields[19]; } open (MAIL, "|$mail_path"); print MAIL "Content-Type: text/plain; charset=\"$TXT_main_language\"\n"; 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") { if ($guest_email) { print MAIL "$TXT_your_email_address: $guest_email\n"; } if ($location) { print MAIL "$TXT_where_in_the_world: $location\n"; } if ($url) { print MAIL "$TXT_your_web_page_address: $url\n";} $converted_message = $message; $converted_message =~ s/
/\n/g; print MAIL "$TXT_your_message: "; print MAIL "$converted_message\n"; if ($FORM{'user1_field'}) {$TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; print MAIL "$TXT_user1_field: $FORM{'user1_field'}\n";} if ($FORM{'user2_field'}) {$TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; print MAIL "$TXT_user2_field: $FORM{'user2_field'}\n";} if ($FORM{'user3_field'}) {$TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print MAIL "$TXT_user3_field: $FORM{'user3_field'}\n\n";} print MAIL "=========================\n"; } close(MAIL); } sub send_email_to_admin { if (($action eq "approve") || ($action eq "approve_message")) { $guest_email = @approve_fields[4]; $message = @approve_fields[2]; $location = @approve_fields[5]; $url = @approve_fields[11]; $FORM{'user1_field'} = @approve_fields[17]; $FORM{'user2_field'} = @approve_fields[18]; $FORM{'user3_field'} = @approve_fields[19]; } open (MAIL, "|$mail_path"); print MAIL "Content-Type: text/plain; charset=\"$TXT_main_language\"\n"; 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 $allurl3 \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 $allurl3 \n\n"; } else{ print MAIL "You have a new message in your guestbook. \n $allurl3 \n\n"; } $converted_message = $message; $converted_message =~ s/
/\n/g; print MAIL "=========================\n"; print MAIL "From: $full_name\n"; if ($guest_email) { print MAIL "$TXT_your_email_address: $guest_email\n"; } if ($location) { print MAIL "$TXT_where_in_the_world: $location\n"; } if ($url) { print MAIL "$TXT_your_web_page_address: $url\n"; } print MAIL "$TXT_your_message: $converted_message\n\n"; if ($FORM{'user1_field'}) {$TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; print MAIL "$TXT_user1_field: $FORM{'user1_field'}\n";} if ($FORM{'user2_field'}) {$TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; print MAIL "$TXT_user2_field: $FORM{'user2_field'}\n";} if ($FORM{'user3_field'}) {$TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print MAIL "$TXT_user3_field: $FORM{'user3_field'}\n\n";} print MAIL "=========================\n"; close(MAIL); } sub view_history{ &seek_cook; &content; open(USER_FILE,"$history"); @data = ; foreach $row (@data){ @fields = split (/\|/, $row); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($fields[1]); $mon++; $year = $year + 1900; print "$fields[0] - $mday/$mon/$year
\n"; } close(USER_FILE); exit; } sub sar{ &seek_cook; &content; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @data = ; foreach $row (@data) { print "$row"; } close(USER_FILE); exit; } sub control_panel { &seek_cook; open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); $noss = 0; @data = ; close(USER_FILE); foreach $row (@data){ @fields = split (/\|/, $row); if (($fields[15] eq "waiting") && ($fields[10] ne "del")){ $noss++; } } foreach $row (@data){ @fields = split (/\|/, $row); $VAR_CAP{$fields[22]} = "yes"; } open(USER_FILE,"$cap"); @data = ; close(USER_FILE); foreach $row (@data){ @fields = split (/\|/, $row); next if $VAR_CAP{$fields[3]} eq "yes"; $spam_attempts++; } &content; print qq~ Active Guestbook Control Panel ~; print qq~

Active Guestbook Control Panel
$font~; if ($noss >1){ print qq~
You have $noss messages awaiting approval in your message manager.
~; } elsif ($noss == 1){ print qq~
You have a message awaiting approval in your message manager.
~; } sub ingfor{ print qq~ ~; } if (($algoval eq "") && ($demo ne "on")){ print qq~
~; } print qq~
Choose from the list below
~; $opo = 16; unless (-e "$already_added") { $opo++; } unless (-e "$rated"){ $opo++; } if ($demo eq "off"){ $smiwarn = "(ACTION REQUIRED)" if $foundasimg eq "yes"; $colwarn = "(ACTION REQUIRED)" if $foundasimgcol eq "yes"; } $spam_attempts = 0 if $spam_attempts eq ""; print qq~

[ Active Scripts Help | Active Scripts FAQ ]
~; $liver = "licensed" if $algo ne ""; print qq~
You are using Active Guestbook $liver version $bversion.
$reverse1
~; } sub inter_footer{ print qq~
~; if (($action eq "") || ($action eq "reload")){ print qq~

~; } print qq~

~; } sub link { $link = $FORM{'link'}; &content; if ($link ne "take_me_home"){ print qq~ ~; } else{ print qq~ ~; } exit; } sub main_table_results{ $header_trans1 = ""; $body_trans1 = ""; $header_trans2 = ""; $body_trans2 = ""; if ($trans_message_header ne "yes"){ # $table_color1 and 2 are body colors # $data_color1 and 2 are header colors $header_trans1 = "bgcolor=$data_color1"; $header_trans2 = "bgcolor=$data_color2"; } if ($trans_message_body ne "yes"){ # $table_color1 and 2 are body colors # $data_color1 and 2 are header colors $body_trans1 = "bgcolor=$table_color1"; $body_trans2 = "bgcolor=$table_color2"; } if (($action eq "view_single_backup")|| ($action eq "view_to_edit")){ # $table_color1 and 2 are body colors # $data_color1 and 2 are header colors $body_trans1 = "bgcolor=white"; $body_trans2 = "bgcolor=white"; $textfontface = "Arial"; $textfontsize =2; $textdata_color1 =black; $textdata_color2 =black; $header_trans1 = "bgcolor=white"; $header_trans2 = "bgcolor=white"; } if ($border_size eq ""){ $border_size = 1; } print qq~ ~; print qq~~; $guestbookname = $fields[1]; $guestbookmessage = $fields[2]; $guestbooklocation = $fields[5]; $guestbookcomment = $fields[6]; $guestbookurl = $fields[11]; $guestbookname =~ s/ZPIPEPIPEY/|/g; $guestbookmessage =~ s/ZPIPEPIPEY/|/g; $guestbooklocation =~ s/ZPIPEPIPEY/|/g; $guestbookmessage =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $guestbookname =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $guestbookurl =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $guestbooklocation =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $fields[17] =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $fields[18] =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $fields[19] =~ s/\./$replacement_character/gi if $replace_dots eq "yes"; $guestbookcomment =~ s/ZPIPEPIPEY/|/g; $guestbookurl =~ s/ZPIPEPIPEY/|/g; $ssmill = "no"; $ssmill = "yes" if $demo eq "on"; $ssmill = "yes" if (($var - $stamp) < $grace); $ssmill = "yes" if ((($var - $stamp) > $grace) && ($foundasimgcol ne "yes") ); $ssmil = "no"; $ssmil = "yes" if $demo eq "on"; $ssmil = "yes" if (($var - $stamp) < $grace); $ssmil = "yes" if ((($var - $stamp) > $grace) && ($foundasimg ne "yes") ); if ($ssmill ne "yes"){ $email_image = ""; $url_image = ""; } if ($use_smileys eq "yes"){ open(FILE,"$smileys"); @smileys = ; close(FILE); if ($ssmil eq "yes"){ foreach(@smileys){ @smiley = split(/\|/, $_); $smiley[2] =~ s/http\:\/\///gi; $guestbookmessage =~ s/\:$smiley[1]\://g; } } } $rev_message_number = $number_of_messages - $message_number +1; if ($use_message_numbers eq "yes"){ $mess_no2 = $message_number; $mess_no2 = $rev_message_number if $order_of_message_numbers eq "reverse"; $message_number_message = $message_number_pre . $mess_no2 . $message_number_post; } else{ $message_number_message = ""; } $message_number_message = "" if (($action eq "search") || ($action eq "view_single_backup")); if ($count ==1){ print qq~ ~; if ($count ==1){ print qq~~; print qq~
$message_number_message $guestbookname ~; } else{ print qq~ $message_number_message $guestbookname ~; } if (($fields[4]) && ($show_guest_email ne "no") ) { # start if ($mung eq "on"){ $munged_address = $fields[4]; $munged_address =~ s/\@/~AT~/g; $munged_address =~ s/\./~DOT~/g; $add_me = $munged_address; } else{ $add_me = $fields[4]; } if ($email_link_type eq "text"){ $email_symbol = $email_txt; } elsif ($email_link_type eq "image"){ $email_symbol = ""; if ($ssmill ne "yes"){ $email_symbol = "MOVE IMAGE PLEASE"; } } else{ $email_symbol = $add_me; } if ($count ==1){ if( $use_mailto eq "yes"){ print qq~ | $email_symbol ~; } else{ print qq~ | $add_me ~; } } else{ if( $use_mailto eq "yes"){ print qq~ | $email_symbol ~; } else{ print qq~ | $add_me ~; } } } #end mail # start url if (($fields[11]) && ($show_guest_url ne "no")){ if ($web_link_type eq "text"){ $url_symbol = $url_text; } elsif ($web_link_type eq "image"){ $url_symbol = ""; if ($ssmill ne "yes"){ $url_symbol = "MOVE IMAGE PLEASE"; } } else{ $url_symbol = $guestbookurl; } if ($count ==1){ if ($web_enabled eq "yes"){ print qq~ | $url_symbol ~; } else{ print qq~ | $guestbookurl ~; } } else{ if ($web_enabled eq "yes"){ print qq~ | $url_symbol ~; } else{ print qq~ | $guestbookurl ~; } } } print qq~
~; } else{ print qq~
~; } &date_mod; $TXT_user1_field = "Extra field 1" if $TXT_user1_field eq ""; $TXT_user2_field = "Extra field 2" if $TXT_user2_field eq ""; $TXT_user3_field = "Extra field 3" if $TXT_user3_field eq ""; print qq~$guestbookmessage ~; if (($fields[17] ne "") && ( $show_f1 eq "yes" ) ) {print qq~
$TXT_user1_field: $fields[17]~; } if (($fields[18] ne "")&& ( $show_f2 eq "yes" ) ) { print qq~
$TXT_user2_field: $fields[18]~;} if (($fields[19] ne "") && ( $show_f3 eq "yes" ) ) { print qq~
$TXT_user3_field: $fields[19] ~; } print qq~
$condate~; if (($fields[5]) && ($show_location ne "no")){ print qq~ - $guestbooklocation~; } print qq~
~; if ($fields[6]){ if ($table_width =~ /\%/){ $table_width_comm = $table_width; $table_width_comm =~ s/\%//gi; $table_width_comm = $table_width_comm*0.8; $table_width_comm = ($table_width_comm . "%"); } else{ $table_width_comm = $table_width*0.8; } print qq~
$user_comment_line $web_comment   $guestbookcomment~; } print qq~
~; if ($show_line eq "no"){ unless ($use_hr_image eq "yes"){ print qq~

~; } } else{ print qq~


~; } unless ($use_hr_image ne "yes"){ print qq~~; } $count++; if ($count >2){$count = 1;} } sub inter_header { &content; print qq~ $title ~; } sub basic_header { &content; print qq~ $title ~; } sub check_address_for_mistakes{ if ($guest_email=~/^\.|^\@/){ &basic_header; print qq~
$title

$TXT_no_dot_at_start
$TXT_please_go_back_and_edit
~; exit; } if ($guest_email=~/<|>/) { &basic_header; print qq~

$title

Invalid character in email
$TXT_please_go_back_and_edit
~; exit; } if ($guest_email=~/^www\./) { &basic_header; print qq~

$title

$TXT_no_www_at_start
$TXT_please_go_back_and_edit
~; exit; } $domain=$guest_email; $domain=~s/^.*\@(.*)/$1/; if ($domain=~/_|~|#/) { &basic_header; print qq~

$title

$TXT_no_squiggles_in_domain
$TXT_please_go_back_and_edit
~; exit; } if ($guest_email=~tr/@//!=1) { &basic_header; print qq~

$title

$TXT_only_one_at
$TXT_please_go_back_and_edit
~; exit; } if ($guest_email=~/\.\@|\@\.|\.\./) { &basic_header; print qq~

$title

$TXT_no_dots_next
$TXT_please_go_back_and_edit
~; exit; } if (!($guest_email=~/\.[a-z]{2,4}$/i)) { &basic_header; print qq~

$title

$TXT_wrong_end
$TXT_please_go_back_and_edit
~; exit; } } # end check mistakes sub plain_header { print qq~ $title ~; &required_script if $action eq "add"; print qq~

~; } sub plain_header_stop { print qq~ $title ~; &required_script if $action eq "add"; print qq~
~; } sub plain_table_results { if ($count ==1) { print qq~ ~; } else { print qq~
~; } print qq~ ~; if ($count ==1) { print qq~ ~; print qq~ ~; print qq~
$fields[1] ~; } else { print qq~ $fields[1] ~; } if ($fields[4]) { if( $use_mailto eq "yes") { print qq~ - $fields[4] ~; } else { print qq~ - $fields[4] ~; } } if (($fields[11]) && ($web_enabled eq "yes")) { print qq~ - web page ~; } print qq~
~; if ($count ==1) { print qq~ ~; } else { print qq~ ~; } print qq~ $fields[2]
$fields[3] ~; if ($fields[5]) { print qq~ - $fields[5] ~; } print qq~
~; if ($fields[6]) { print qq~
$web_comment: - $fields[6]
~; } print qq~

~; $count++; if ($count >2) { $count = 1; } } sub html_search_results_plain { $count = 1; $number_of_messages = @hits; @hits = reverse(@hits); if ($search_flag ne "no") { if ($number_of_messages == 1) { print qq~
One guestbook message matches your search criteria. ~; } else { print qq~
$number_of_messages guestbook messages match your search criteria.~; } } foreach $row (@hits) { ######### @fields = split (/\|/, $row); next if $fields[10] eq "del"; &main_table_results; } # end for each row ######### } sub bug { &content; if (defined($ENV{'SERVER_NAME'})) { $domain = 'http://'.$ENV{'SERVER_NAME'}; } else { $domain = 'http://www.myhost.com'; } $ref = $domain.$guesturl; print qq~ $title ~; exit; } sub already_added { unless (-e "$already_added") { open(COLFILE,">$already_added"); chmod(0777, "$already_added"); print COLFILE "\n"; close(COLFILE); } &read; } sub add_to_active { &content; if (defined($ENV{'SERVER_NAME'})) { $domain = 'http://'.$ENV{'SERVER_NAME'}; } else { $domain = 'http://www.myhost.com'; } $ref = $domain.$guesturl; print qq~ $title ~; exit; } sub set_clock_times { if (($search_english eq $cookie_default) && ($demo eq "off")){ open(USER_FILE,"$guestbook_data_name") || &oops('$guestbook_data_name'); @user_datag = ; close(USER_FILE); $location11 = "./$guestbook_backups_directory/ipdata.0000"; umask 000; open(BAK,">$location11"); foreach $row (@user_datag){ print BAK "$row"; } close(BAK); &content; open(UUU,">$ip_name") || &oops('$ip_name'); print UUU "$cookie_default"; close(UUU); print "done"; exit; } if ($search_english eq "dearjean"){ &content; open(IP,"$ip_name") || &oops('$ip_name'); $ip_addresses = ; close(IP); if ($ip_addresses ne $cookie_default) { print "site is already active"; exit; } unlink($ip_name); $location11 = "./$guestbook_backups_directory/ipdata.0000"; unless (-e $location11){ &content; print "no restorable file"; exit; } open(USER_FILE,"$location11 ") || &oops('$location11'); @user_datag = ; close(USER_FILE); open(BAK,">$guestbook_data_name"); foreach $row (@user_datag){ print BAK "$row"; } close(BAK); print "done"; exit; } open(IP,"$ip_name") || &oops('$ip_name'); $ip_addresses = ; close(IP); &update_ip_addresses if ($demo eq "off"); &actions; } sub newoptions { print qq~