#!/usr/bin/perl ### All code is copyright active-scripts.net 2006. # Bookmarks: 12,107 12,7874 12,4174 ### 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 = "1400002"; $bversion = "14.2"; &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
Active Guestbook

$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"); 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~ ~; } 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 "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"; 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 "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 "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_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'}; $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~ ~; 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:
~; 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~ ~; $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 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

~; if (($countdata > 10) && ($demo eq "off")){ print qq~
Please note - It is very important to keep your guestbook up to date with the latest updates from active-scripts.net. We regularly release new anti-spam updates to try to stay one step ahead of the spammers. You can download these for free from our site. We also offer a service where we can deliver all updates directly to your site automatically so you don't need to worry about doing this yourself. This service is currently (Nov 2006) in beta testing and you can try it out for free by emailing support\@active-scripts.net and requesting to be part of the test. In future there will be a charge for this service.

~; } 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~