#!/usr/bin/perl $| = 1; print "Content-type: text/html\n"; &require_supporting_libraries (__FILE__, __LINE__, "./Library/cgi-lib.pl", "./Library/cookies.lib", "./SetupFiles/domain.reg", "./SetupFiles/channels.reg"); &ReadParse(*form_data); print "\n"; #if($form_data{'setup_file'} !~ /ssnews/){$form_data{'test'} = "x";} # show most recent instead of search on frontpage #if($form_data{'setup_file'} !~ /ssgnews/){$form_data{'test'} = "x";} # show most recent instead of search on frontpage #if (($form_data{'show_article'} eq "")&&($form_data{'setup_file'} =~ /news2/)&&($form_data{'setup_file'} !~ /ssnews/)&&($form_data{'test'} ne "x")) #{ # print qq~The server is too busy right now for this request. Please try again in a few minutes.~; # exit; #} $uptime_str = `/usr/bin/uptime`; $valUT1 = (split(/\,/,$uptime_str))[3]; $valUT1 =~ s/load averages: //; if($valUT1 > 6) { print qq~The server is too busy to safely handle this request. ($valUT1) Please try again in a few moments.~; exit; } %current_guides = ( "fig","Figures.com","ss","SirStevesGuide.com", "wr","WrestlingGuide.com","mf","McFarlaneGuide.com","cjt","CoolJapaneseToys.com"); $form_data{'keywords'} =~ s/\^/ /g; $ad_pages_cgi = "./banners/ad-pages.cgi"; $sys_admin_cgi = "system_admin.cgi"; srand(time|$$); $page_NUM = int(rand 500) + 1; ############ SECURITY SCREEN ############ # &require_supporting_libraries (__FILE__, __LINE__, # "./Library/security-lib.pl"); # &security_check_1; ############ END SECURITY SCREEN ######## if ($form_data{'ad_pages_menu'} eq "show_list_of_advertisers") { $referrer2 = $ENV{'HTTP_REFERER'}; if($referrer2 =~ /figures|27/) { $domain = "fig"; $form_data{'category'} = "actionfigures"; } if($referrer2 =~ /steve|51/) { $domain = "ss"; $form_data{'category'} = "starwars"; } if($referrer2 =~ /farlane|75/) { $domain = "mf"; $form_data{'category'} = "mcfarlane"; } if($referrer2 =~ /wrest|119/) { $domain = "wr"; $form_data{'category'} = "wrestling"; } unless ($form_data{'setup_file'}) {$form_data{'setup_file'} = "news2.setup";} } if($form_data{'domain'} eq "") { SWITCH: { if ($form_data{'setup_file'} =~ /^fig/) {$domain = "fig"; last SWITCH;} if ($form_data{'setup_file'} =~ /^ss/) {$domain = "ss"; last SWITCH;} if ($form_data{'setup_file'} =~ /^tom/) {$domain = "tom"; last SWITCH;} if ($form_data{'setup_file'} =~ /^tt/) {$domain = "tt"; last SWITCH;} if ($form_data{'setup_file'} =~ /^wr/) {$domain = "wr"; last SWITCH;} if ($form_data{'setup_file'} =~ /^mf/) {$domain = "mf"; last SWITCH;} if ($form_data{'setup_file'} =~ /^pk/) {$domain = "pk"; last SWITCH;} if ($form_data{'setup_file'} =~ /^lotr/) {$domain = "lotr"; last SWITCH;} if ($form_data{'setup_file'} =~ /^mm/) {$domain = "mm"; last SWITCH;} if ($form_data{'setup_file'} =~ /^osw/) {$domain = "osw"; last SWITCH;} if ($form_data{'setup_file'} =~ /^sh/) {$domain = "sh"; last SWITCH;} if ($form_data{'setup_file'} =~ /^c/) {$domain = "cjt"; last SWITCH;} if ($form_data{'setup_file'} =~ /^nn/) {$domain = "nn"; last SWITCH;} } } SWITCH: { if ($form_data{'setup_file'} =~ /eds2/) {$setup_file = "classifieds2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /eds/) {$setup_file = "classifieds.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /rum2/) {$setup_file = "forum2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /rum/) {$setup_file = "forum.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /ews2/) {$setup_file = "news2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /ews/) {$setup_file = "news.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /ctions2/) {$setup_file = "collections2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /ctions/) {$setup_file = "collections.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /zations2/) {$setup_file = "customizations2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /zations/) {$setup_file = "customizations.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /cations2/) {$setup_file = "publications2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /cations/) {$setup_file = "publications.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /ures2/) {$setup_file = "features2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /ures/) {$setup_file = "features.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /nies2/) {$setup_file = "beanies2.setup"; last SWITCH;} if ($form_data{'setup_file'} =~ /nies/) {$setup_file = "beanies.setup"; last SWITCH;} } if ($form_data{'setup_file'} eq "") { $domain = "fig"; $setup_file = "news2.setup"; $form_data{'category'} = "actionfigures"; } if ($domain eq "") {$domain = "fig"; } if ($form_data{'category'} eq "") {$form_data{'category'} = "actionfigures";} $category = $form_data{'category'}; $domain_NAME = $domain_names{"$domain"}; $cat_NAME = $cat_names{"$category"}; if ($setup_file =~ /pub/) {$cat_NAME = "";} $keywords = $form_data{'keywords'}; if(($form_data{'topic'} eq "") && ($form_data{'default_topic'} ne "")) {$form_data{'topic'} = $form_data{'default_topic'};} if (($form_data{'setup_file'} =~ /classi|forum/) && ($domain ne "tom") && ($form_data{'ad_pages_menu'} eq "")) { if ($domain eq "ss") { } elsif ($domain eq "mf") { } elsif ($domain eq "hw") { } elsif ($domain eq "wr") { } elsif ($domain eq "pk") { } else { } print qq~
We've Updated our Forums and Classifieds
and ADDED a LINKS system!

Please click on the links below.
Your current logon will work on these new systems.
(with a few exceptions such as any duplicate usernames we found -
just re-register if that's the case and you want to post.)

Some of the categories have been combined.
Most of the recent posts from the old system
HAVE been transferred over

FORUMS
CLASSIFIEDS
LINKS


Please report any bugs to: ACTION ON-LINE

mdg~; exit; } if ($setup_file =~ /ions/) { &require_supporting_libraries (__FILE__, __LINE__, "./Library/db-lib-colls.pl", "./SetupFiles/$setup_file"); } else { &require_supporting_libraries (__FILE__, __LINE__, "./Library/db-lib.pl", "./SetupFiles/$setup_file"); } $REGION = $region_names{"$region"}; if (($setup_file eq "news.setup") || ($setup_file eq "publications.setup") || ($setup_file eq "features.setup")) { &require_supporting_libraries (__FILE__, __LINE__, "./Library/auth-lib-news.pl"); } else { &require_supporting_libraries (__FILE__, __LINE__, "./Library/auth-lib2.pl"); } if ($should_i_authenticate eq "yes") { &authentication; } if ($form_data{'ad_pages_menu'} ne "") { &require_supporting_libraries(__FILE__,__LINE__, "./Library/cgi-lib-ad-pages2.pl"); $sub_call = $form_data{'ad_pages_menu'}; &$sub_call; exit; } $form_data{'ions'} =~ tr/A-Z/a-z/; $form_data{'ions'} =~ tr/ /_/; if ($ENV{'CONTENT_LENGTH'} > 261000) { print qq~It appears that the total size in bytes of your image is greater than the max-allowed of 240K. Please use your back button and choose a smaller file.~; exit; } #### # $functionfile = "./counts/$category".".$setup_file"; # open(CNFL, ">>$functionfile") || open(CNFL, "+>$functionfile"); # print CNFL "1"; # close (CNFL); #### if ($form_data{'add_item_button'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &generic_header("Add an Item to the Database Form"); &generic_form_header; &add_form_header; &add_modify_data_entry_form; &add_form_footer; &generic_form_footer; exit; } elsif ($form_data{'submit_addition'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &submit_addition; exit; } elsif ($form_data{'modify_item_button'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &modify_search_form; exit; } elsif (($form_data{'search_and_display_for_modification_button'} ne "") && ($keywords eq "") && ($form_data{'search_and_display_db_button'} eq "")) { open(SESSION_FILE, "$auth_session_dir/$session_file.dat") || &file_open_error("$auth_session_dir/$session_file.dat", "Generic form header",__FILE__,__LINE__); chop($line = ); @fields = split(/\|/, $line); close(SESSION_FILE); $Email = $fields[4]; $Group = $fields[1]; $form_data{'email'} = $Email; $form_data{'group'} = $Group; if ($form_data{'reply_function'} ne "") {&reply_handler;} @db_query_criteria = ("email|1|=|string"); if ($form_data{'group'} eq "admin") {@db_query_criteria = ();} &search_and_display_for_modification; exit; } elsif ($form_data{'search_and_display_for_modification_button2'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &generic_header("Modify your post"); &generic_form_header; &modify_form_header; &add_modify_data_entry_form; &generic_form_footer; exit; } elsif ($form_data{'submit_modification_button'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &submit_modification; exit; } elsif ($form_data{'delete_item_button'} ne "") { &delete_search_form; exit; } elsif ($form_data{'search_and_display_for_deletion_button'} ne "") { @db_query_criteria = ("email|1|=|string"); if ($form_data{'group'} eq "admin") {@db_query_criteria = ();} &search_and_display_for_deletion; exit; } elsif ($form_data{'submit_deletion_button'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &submit_deletion; exit; } elsif ($form_data{'view_database_button'} ne "") { &view_database_form; exit; } elsif ($form_data{'search_and_display_db_button'} ne "") { if ($form_data{'reply_function'} ne "") {&reply_handler;} &search_and_display_db_for_view; exit; } elsif ($form_data{'get_single_reply_button'} ne "") { &generic_header("InterACTION Forum Replies"); &generic_form_header; &display_single_reply; &generic_form_footer; exit; } else { if ($form_data{'setup_file'} eq "figclassifieds.setup") { &generic_header("InterACTION System"); &generic_form_header; &display_frontpage; exit; } else { &generic_header("InterACTION System"); &generic_form_header; &display_frontpage; &generic_form_footer; exit; } } ####################################################### # Require Supporting Libraries. sub require_supporting_libraries { local ($file, $line, @require_files) = @_; local ($require_file); foreach $require_file (@require_files) { if (-e "$require_file" && -r "$require_file") {require "$require_file";} else { print "Content-type: text/html\n\n"; print "I am sorry but I was unable to require $require_file at line $line in $file. Would you please make sure that you have the path correct and that the permissions are set so that I have read access? Thank you."; exit; } } } ####################################################### # Perform Authentication sub authentication { $session_file = "$form_data{'session_file'}"; ($session_file, $session_username, $session_group,$session_first_name, $session_last_name, $session_email) = &GetSessionInfo($session_file, $this_script_url, *form_data); } ##################################################### # Submit an Addition sub submit_addition { if ($setup_file =~ /publications.setup/) { &special_handler; } ################ check length ################### if ($form_data{'setup_file'} =~ /clas|bean/i) { $Max_subject = 70; $Max_length = 1000; } elsif($form_data{'setup_file'} =~ /news|ures/i) { $Max_subject = 70; $Max_length = 12000; } elsif($form_data{'setup_file'} =~ /rum/i) { $Max_subject = 70; $Max_length = 2000; } elsif($form_data{'setup_file'} =~ /public/i) { $Max_subject = 70; $Max_length = 2000; } else { $Max_subject = 500; $Max_length = 500; } if ((length ($form_data{'subject'})) > $Max_subject) { $over_size = length ($form_data{'subject'}); $over_msg = "Max Subject Length of $Max_subject characters exceeded ($over_size chars)"; &post_size_limit_exceeded; &generic_form_footer; exit; } if ((length ($form_data{'message'})) > $Max_length) { $over_size = length ($form_data{'message'}); $over_msg = "Max Body Length of $Max_length characters exceeded ($over_size chars)"; &post_size_limit_exceeded; &generic_form_footer; exit; } if($category eq "starwars") { $form_data{'message'} =~ s/\n\n/

/g; $form_data{'message'} =~ s/\n\r\n/

/g; $form_data{'message'} =~ s/\n/
/g; $form_data{'message'} =~ s/\r//g; } ############# check for bad chars (\n,|) ##### foreach $field (@db_user_definable_field_order) { $form_data{$field} =~ s/\|//g; $form_data{$field} =~ s/\n|\r//g; $form_data{$field} =~ s/"/&\#034\;/g; } ############## bad_words_array filter ########## if ($setup_file !~ /news|ures/) { foreach $badword (@bad_words_array) { foreach $field (@db_user_definable_field_order) { $newrow = $form_data{$field}; if ($newrow =~ /$badword/i) { &unacceptable_word_error($badword); &generic_form_footer; exit; } } } } else { $newrow = $form_data{'subject'}; $badword = "<"; $badwordmsg = "< was in subject line"; if ($newrow =~ /$badword/) { &unacceptable_word_error($badwordmsg); &generic_form_footer; exit; } } if ($setup_file =~ /news|ures/) { &do_special_fields; } ####### check for multiple posts ######### if (($setup_file eq "classifieds.setup")||($setup_file eq "beanies.setup")) { open (DATABASE, "$data_file_path") || &file_open_error ("$data_file_path", "Submit Addition", __FILE__, __LINE__); @DBLS = ; close (DATABASE); $actual_count = @DBLS; $actual_count += 1; #for .count file foreach $db_ln(@DBLS) { @fieldsdb = split (/\|/, $db_ln); if (($fieldsdb[6] eq $session_username) && ($session_group ne "admin")) { &generic_header("User already has post in this Topic"); &generic_form_header; &over_post_limit; &generic_form_footer; exit; } } } if ($setup_file =~ /ions/) {&save_picture;} &get_file_lock("$location_of_lock_file"); open (COUNTER_FILE, "$location_of_counter_file") || open (COUNTER_FILE, "$+>location_of_counter_file"); while () { $current_counter = $_; if ($_ eq "") {$current_counter = 0;} } close (COUNTER_FILE); $current_counter++ ; $new_counter = $current_counter; open (COUNTER_FILE, ">$location_of_counter_file") || &file_open_error ("$location_of_counter_file", "Submit Addition", __FILE__, __LINE__); print COUNTER_FILE "$new_counter"; close (COUNTER_FILE); $when_modified = &get_date; $o_s_a = open (DATABASE, ">>$data_file_path") || &file_open_error ("$data_file_path", "Submit Addition", __FILE__, __LINE__); if ((length ($when_modified) < 10 ) || ($o_s_a != 1)) { close (DATABASE); &release_file_lock("$location_of_lock_file"); &variable_error ("when_modified - OSA", "Submit Addition", __FILE__, __LINE__); } foreach $field (@db_user_definable_field_order) {$new_row .= "$form_data{$field}\|";} $new_row .= "$when_modified\|$session_username\|$session_group\|$new_counter\n"; print DATABASE $new_row; close (DATABASE); if ($setup_file =~ /class|news|ures|bean/) { &backup_addition; open (REAL_COUNT, "+>$location_of_count_file")|| &file_open_error ("$location_of_count_file", "Submit Addition", __FILE__, __LINE__); print REAL_COUNT "$actual_count"; close (REAL_COUNT); } &release_file_lock("$location_of_lock_file"); open (MOD_FILE, ">$location_of_mod_file") || &file_open_error ("$location_of_mod_file", "Submit Addition", __FILE__, __LINE__); print MOD_FILE "$when_modified"; close (MOD_FILE); &successful_addition_message; } ############################################################## # Submit a Modification sub submit_modification { if ($form_data{'item_to_modify'} eq "") { &no_item_submitted_for_modification; exit; } if ($setup_file =~ /publications.setup/) { &special_handler; } ################### check length ############### if ($form_data{'setup_file'} =~ /clas|bean/i) { $Max_subject = 70; $Max_length = 1000; } elsif($form_data{'setup_file'} =~ /news|ures/i) { $Max_subject = 70; $Max_length = 12000; } elsif($form_data{'setup_file'} =~ /rum/i) { $Max_subject = 70; $Max_length = 2000; } elsif($form_data{'setup_file'} =~ /public/i) { $Max_subject = 70; $Max_length = 2000; } else { $Max_subject = 500; $Max_length = 500; } if ((length ($form_data{'subject'})) > $Max_subject) { $over_size = length ($form_data{'subject'}); $over_msg = "Max Subject Length of $Max_subject characters exceeded ($over_size chars)"; &post_size_limit_exceeded; &generic_form_footer; exit; } if ((length ($form_data{'message'})) > $Max_length) { $over_size = length ($form_data{'message'}); $over_msg = "Max Body Length of $Max_length characters exceeded ($over_size chars)"; &post_size_limit_exceeded; &generic_form_footer; exit; } ############## check for bad chars (\n,|,") ##### foreach $field (@db_user_definable_field_order) { $form_data{$field} =~ s/\|//g; $form_data{$field} =~ s/\n|\r//g; $form_data{$field} =~ s/"/&\#034\;/g; } ############# bad_words_array filter ################ foreach $badword (@bad_words_array) { foreach $field (@db_user_definable_field_order) { $newrow = $form_data{$field}; if ($newrow =~ /$badword/i) { &unacceptable_word_error($badword); &generic_form_footer; exit; } } } if ($setup_file =~ /news|ures/) { &do_special_fields; } if (($region eq "news")||($region eq "classifieds")||($region eq "features")||($region eq "beanies")) { open (DATABASE, "$data_file_path") || &file_open_error ("$data_file_path", "Modify item", __FILE__, __LINE__); @mdbls = ; close (DATABASE); $actual_count = @mdbls; for(@mdbls) { $line = $_; chop $line; @fields = split (/\|/, $line); if ($fields[$index_of_db_id_number] ne $form_data{'item_to_modify'}) { $new_data .= "$line\n"; } else { &interval_check($line); $old_row = "$line"; $length_old = 0; $length_old += int(length("$old_row")); ### for ($i=0; $i <= (@db_user_definable_field_order-1); $i++) { $index = @db_user_definable_field_order[$i]; if ($form_data{$index} ne "") { $new_row .= "$form_data{@db_user_definable_field_order[$i]}\|"; } else { $new_row .= "$fields[$i]\|"; } } $new_data .= "$new_row"; $length_new = 0; $length_new += int(length("$new_row")); $when_modified = &get_date; $who_modified = $session_username; if ($session_group =~ /admin|editor/) { $group = $fields[$index_of_group_who_modified]; $who_modified = $fields[$index_of_who_modified]; } else { $group = $session_group } $length_new += int(length("$when_modified")); $length_new += int(length("$who_modified")); $length_new += int(length("$group")); $length_new += int(length("$fields[$index_of_db_id_number]")); $length_new += 5; $resize_factor = $length_new - $length_old; $new_data .= "$when_modified|$who_modified|$group|$fields[$index_of_db_id_number]\n"; $new_row .= "$when_modified|$who_modified|$group|$fields[$index_of_db_id_number]"; } # End of else } # End of while () #### temp fix 4th line of code - should be "yes" if ((($session_username eq $fields[$index_of_who_modified]) || (($session_group eq $fields[$index_of_group_who_modified]) && ($session_group ne "user"))) || ($session_group =~ /admin|editor/) || ($should_i_authenticate ne "no")) { &get_file_lock("$location_of_lock_file"); &save_new_data($resize_factor); &release_file_lock("$location_of_lock_file"); open (MOD_FILE, ">$location_of_mod_file") || &file_open_error ("$location_of_mod_file", "Submit Modification", __FILE__, __LINE__); print MOD_FILE "$when_modified"; close (MOD_FILE); &successful_modification_message; } else {&unsuccessful_modification_message;} } else #### coll or cust #### { open (DATABASE, "$data_file_path") || &file_open_error ("$data_file_path", "Modify item", __FILE__, __LINE__); while () { $line = $_; chop $line; @fields = split (/\|/, $line); if ($fields[$index_of_db_id_number] ne $form_data{'item_to_modify'}) { $new_data .= "$line\n"; } else { # &interval_check($line); $old_row = "$line"; for ($i=0; $i <= (@db_user_definable_field_order-1); $i++) { $index = @db_user_definable_field_order[$i]; if ($form_data{$index} ne "") { $new_row .= "$form_data{@db_user_definable_field_order[$i]}\|"; } else { $new_row .= "$fields[$i]\|"; } } # End of for ($i=1; $i <= @db_user_definable_field_order; $i++); $new_data .= "$new_row"; $when_modified = &get_date; $who_modified = $session_username; if ($session_group =~ /admin|editor/) { $group = $fields[$index_of_group_who_modified]; $who_modified = $fields[$index_of_who_modified]; } else { $group = $session_group; } $new_data .= "$when_modified|$who_modified|$group|$fields[$index_of_db_id_number]\n"; $new_row .= "$when_modified|$who_modified|$group|$fields[$index_of_db_id_number]"; } } # End of while () close (DATABASE); if ((($session_username eq $fields[$index_of_who_modified]) || (($session_group eq $fields[$index_of_group_who_modified]) && ($session_group ne "user"))) || ($session_group =~ /admin|editor/) || ($should_i_authenticate ne "no")) { &get_file_lock("$location_of_lock_file"); open (DATABASE, ">$data_file_path") || &file_open_error ("$data_file_path", "Modify Item", __FILE__, __LINE__); if (( length ($when_modified) < 10 ) ||( length ($new_data) < 50 )) { close (DATABASE); &release_file_lock("$location_of_lock_file"); &variable_error ("when_modified or new_data", "Submit Modification", __FILE__, __LINE__); } print DATABASE "$new_data"; close (DATABASE); &release_file_lock("$location_of_lock_file"); open (MOD_FILE, ">$location_of_mod_file") || &file_open_error ("$location_of_mod_file", "Submit Modification", __FILE__, __LINE__); print MOD_FILE "$when_modified"; close (MOD_FILE); &successful_modification_message; } else { &unsuccessful_modification_message; } } } ####################################################### # Submit a Deletion sub submit_deletion { if ($form_data{'item_to_delete'} eq "") { &no_item_submitted_for_modification; exit; } @items_to_delete = &SplitParam($form_data{'item_to_delete'}); open (DATABASE, "$data_file_path") || &file_open_error ("$data_file_path", "Delete Item", __FILE__, __LINE__); @LinesDB = ; close (DATABASE); $actual_count = @LinesDB; $actual_count -= 1; foreach $line(@LinesDB) { chop $line; @fields = split (/\|/, $line); $already_deleted = "no"; foreach $item (@items_to_delete) { if ($fields[$index_of_db_id_number] eq $item) { if ($item ne "") { $deleted_item = $item; } &interval_check($line); $deleted_row = "$line"; $old_row = $deleted_row; $resize_factor = (int(length($line)) * -1); $already_deleted = "yes"; } } if ($already_deleted ne "yes") { $new_data .= "$line\n"; } } if ((($session_username eq $fields[$index_of_who_modified]) || (($session_group eq $fields[$index_of_group_who_modified]) && ($session_group ne "user"))) || ($session_group =~ /admin|editor/) || ($should_i_authenticate ne "no")) { &get_file_lock("$location_of_lock_file"); &save_new_data($resize_factor); &release_file_lock("$location_of_lock_file"); &successful_deletion_message; } else {&unsuccessful_modification_message;} } # end sub ############################################################# # Search and Display the Database sub search_and_display_db { if ($form_data{'sort_by'} ne "") {$index_of_field_to_be_sorted_by = $form_data{'sort_by'};} if (($form_data{'search_and_display_for_modification_button'} ne "") || ($form_data{'search_and_display_for_deletion_button'} ne "")) { open (TOPICLIST, "$category_data_file_path") || &file_open_error("$category_data_file_path", "topic_header",__FILE__,__LINE__); @dbr = ""; while (($line = )) { if (($total_row_count >= $max_search_results) && ($form_data{'keywords'})) {last;} unless (($line =~ /^COMMENT:/) || (length ($line) < 3)) { chop $line; @fields = split (/\|/, $line); $topicx = int ($fields[1]); unless ($topicx == 0) { $data_file_path = "./$region/$category/$topicx/$topicx.data"; $backup_file_path = "./$region/$category/$topicx/$topicx.bak"; if ($region eq "beanies") { $data_file_path = "./classifieds/$category/$topicx/$topicx.data"; $backup_file_path = "./classifieds/$category/$topicx/$topicx.bak"; } @database_rows = (); ($totalrowcount) = &submit_query(*database_rows); $total_row_count += $totalrowcount; foreach $row(@database_rows) { $row .= "|$topicx"; push(@dbr, $row); $row = ""; } #endforeach } #endunless } #endunless } #endwhile close (TOPICLIST); foreach $newrow(@dbr) { push (@database_rows, $newrow); } } #endif else { ($total_row_count) = &submit_query(*database_rows); } foreach $row (@database_rows) { $row =~ s/\|_@/\|@/g; ##################dont ask - y2k fix fix########################## @row = split (/\|/, $row); unless ($row[8] eq "") { $sortable_field = $row[$index_of_field_to_be_sorted_by]; unshift (@row, $sortable_field); $new_row = join ("\|", @row); push (@new_rows, $new_row); } } ############ to sort them. @database_rows = (); @sorted_rows = reverse sort (@new_rows); foreach $sorted_row (@sorted_rows) { @row = split (/\|/, $sorted_row); $sorted_field = shift (@row); $old_but_sorted_row = join ("\|", @row); push (@database_rows, $old_but_sorted_row); } if ($total_row_count < 1) { &no_hits_message; exit; } $hits_seen = $form_data{'new_hits_seen'}; for ($i = 1;$i <= $hits_seen;$i++) {$seen_row = shift (@database_rows);} $length_of_database_rows = @database_rows; for ($i = $length_of_database_rows-1;$i >= $max_rows_returned;$i--) {$extra_row = pop (@database_rows);} $new_hits_seen = $hits_seen + $max_rows_returned; &search_results_body; &search_results_footer; } ################################################## # get_date Subroutine sub get_date { if (($setup_file =~ /news|ures/)&&($form_data{'change_date'} eq "yes")) { &datefix; } else { local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst,$date); local (@days, @months); @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday', 'Friday','Saturday'); @months = ('January','February','March','April','May','June','July', 'August','September','October','November','December'); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); if ($hour < 10) {$hour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} if ($mday < 10) {$mday = "0$mday";} $mon++; if ($mon < 10) {$mon = "0$mon";} $mddd = "$mon $mday"; ############################# if($year < 50) {$current_century = 21;} else {$current_century = 20;} ############################# $year = 1900 + $year; if ($year == 2002) {$date = "c$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2003) {$date = "d$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2004) {$date = "e$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2005) {$date = "f$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2006) {$date = "g$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2007) {$date = "h$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2008) {$date = "i$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2009) {$date = "j$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2010) {$date = "k$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2011) {$date = "l$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2012) {$date = "m$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2013) {$date = "n$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2014) {$date = "o$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2015) {$date = "p$mon/$mday/$year at $hour\:$min\:$sec";} elsif ($year == 2016) {$date = "q$mon/$mday/$year at $hour\:$min\:$sec";} else {$date = "m$mon/$mday/$year at $hour\:$min\:$sec";} return $date; } } ####################################### # get_file_lock sub get_file_lock { local ($lock_file) = @_; local ($timeout); $timeout=20; while (-e $lock_file && (stat($lock_file))[9]+$timeout>time) { sleep(1); } open(LOCK_FILE, ">$lock_file") || &file_open_error ("$lock_file", "Lock File Routine", __FILE__, __LINE__); } sub release_file_lock { local ($lock_file) = @_; close(LOCK_FILE); unlink($lock_file); } ######################################### # file_open_error Subroutine sub file_open_error { local ($bad_file, $script_section, $this_file, $line_number) = @_; print "Content-type: text/html\n\n"; &CgiDie ("I am sorry, but I was not able to access $bad_file in the $script_section routine of $this_file at line number $line_number. Would you please make sure the path is correctly defined in InterACTION.setup and that the permissions are correct.") } sub variable_error { local ($bad_variable, $script_section, $this_file, $line_number) = @_; print "Content-type: text/html\n\n"; &CgiDie ("I am sorry, but an access error has occured. $bad_variable in the $script_section routine of $this_file at line number $line_number was null. In other words the server is probably too busy. Please use your back button, wait 20 seconds, and try again.") } sub get_banner {} sub get_banner2 {&get_banner;} sub use_template2 { local ($template_filename) = @_; open (TEMPLATE_FILE, "$template_filename") || &file_open_error("$filename", "use_template",__FILE__,__LINE__); if ($translate eq "yes") { while () { &translate($_); print qq~$_~; } } else { while () { if ($_ =~ /%%/g) { &translate; print qq~$_~; } else {print qq~$_~;} } } close (TEMPLATE_FILE); } sub use_template { $message =~ s/\\"/"/g; $message =~ s/\\'/'/g; $message =~ s/216.127.66.72/69.93.119.2/g; $message =~ s/207.44.204.78/69.93.119.2/g; # RS7->SM2 $message =~ s/207.44.182.109/69.93.119.2/g; # RS6->SM2 $message =~ s/69.93.35.18/69.93.119.2/g; # SM1->SM2 $message =~ s/209.197.117.27/www.figures.com/g; $subject =~ s/\\"/"/g; $subject =~ s/\\'/'/g; local ($template_filename) = @_; $xyz1 = $domain.$region.".setup"; $xyz2 = $domain.$region."2.setup"; open (TEMPLATE_FILE, "$template_filename") || &file_open_error("$template_filename", "use_templateQ",__FILE__,__LINE__); @this_template = ; close (TEMPLATE_FILE); for (@this_template) { if ($_ =~ /%%show/g) { study; &translateS; print qq~$_~; } elsif ($_ =~ /%%XX/g) { study; &translateXX; print qq~$_~; } elsif ($_ =~ /%%/g) { study; &translate; print qq~$_~; } elsif ($_ =~ / ";} elsif ($category eq "wrestling") {print " ";} elsif ($category eq "mcfarlane") {print " ";} elsif ($category eq "lotr") {print " ";} else {print " ";} #if(($domain eq "fig")&&($topic == 60000 )) # { # print qq~ #Sponsor - KidRobot - Click Here~; # } # else # { # print qq~Click Here~; # } } sub interval_check { local ($old_item) = @_; @fields_old = split (/\|/, $old_item); $old_mod = $fields_old[5]; @old_stuff = split (/ at /, $old_mod); $old_date = $old_stuff[0]; $new_mod = &get_date; @new_stuff = split (/ at /, $new_mod); $new_date = $new_stuff[0]; if (($old_date eq $new_date) && ($session_group !~ /admin|editor/) && ($region !~ /news|ures/)) { $xyz1 = $domain.$region.".setup"; $xyz2 = $domain.$region."2.setup"; $update_message = "

Your post has NOT been modified !
I am sorry, but the system only allows one modification or deletion per calendar day on each post.
This has been implemented in order to make the database more secure and protect your posts.
"; open(SESSION_FILE, "$auth_session_dir/$session_file.dat") || &file_open_error("$auth_session_dir/$session_file.dat", "Generic form header",__FILE__,__LINE__); chop($lined = ); @fi = split(/\|/, $lined); close(SESSION_FILE); $Email = $fi[4]; $form_data{'email'} = $Email; $form_data{'search_and_display_for_modification_button'} = "yes"; @db_query_criteria = ("email|1|=|string"); if ($form_data{'group'} eq "admin") { @db_query_criteria = (); } &search_and_display_for_modification; exit; } } sub save_new_data { local($resize_factor) = @_; $t_o_status = open (TEMP_DATA, ">$temp_file_path"); $t_p_status = print TEMP_DATA "$new_data"; close (TEMP_DATA); $t_c_status = chmod 0666, "$temp_file_path"; ($Tdev,$Tino,$Tmode,$Tnlink,$Tuid,$Tgid,$Trdev,$Tsize, $Tatime,$Tmtime,$Tctime,$Tblksize,$Tblocks) = stat ("$temp_file_path"); ($Ddev,$Dino,$Dmode,$Dnlink,$Duid,$Dgid,$Drdev,$Dsize, $Datime,$Dmtime,$Dctime,$Dblksize,$Dblocks) = stat ("$data_file_path"); if (-e "$backup_file_path") { ($Bdev,$Bino,$Bmode,$Bnlink,$Buid,$Bgid,$Brdev,$Bsize, $Batime,$Bmtime,$Bctime,$Bblksize,$Bblocks) = stat ("$backup_file_path"); } if (($t_o_status ==1) && ($t_c_status ==1) && ($t_p_status ==1) && ($Tsize > ($Dsize + $resize_factor - 15)) && ($Tsize < ($Dsize + $resize_factor + 15))) { $r_success = rename ("$temp_file_path", "$data_file_path"); if ($r_success) { $b_o_status = open (BAK_DATA, "+>$backup_file_path"); $b_p_status = print BAK_DATA "$new_data"; close (BAK_DATA); # $b_c_status = chmod 0666, "$backup_file_path"; # if (($b_o_status ==1) &&($b_p_status ==1) &&($b_c_status ==1)) if (($b_o_status ==1) &&($b_p_status ==1)) { $u_success = unlink "$temp_file_path"; open (REAL_COUNT, "+>$location_of_count_file"); print REAL_COUNT "$actual_count"; close (REAL_COUNT); } else { $erdat = " E2 $session_username $region $category $topic b_o_status=$b_o_status b_p_status=$b_p_status b_c_status=$b_c_status BFP=$backup_file_path TFP =$temp_file_path DFP=$data_file_path rs=$r_success $Bdev,$Bino,$Bmode,$Bnlink,$Buid,$Bgid,$Brdev, $Bsize,$Batime,$Bmtime,$Bctime,$Bblksize,$Bblocks"; $erdat_file = "./$region/error_data.txt"; open (ERDAT, ">>$erdat_file") || open (ERDAT, "+>$erdat_file"); print ERDAT "$erdat"; close (ERDAT); $E_email = "mdg\@bright.net"; $E_subject = "system error E2"; require "$auth_lib/mail-lib.pl"; &send_mail($auth_admin_from_address,$E_email,$E_subject,$erdat); return 0; } } } else { $erdat = "E1 $session_username $region $category $topic t_o_status=$t_o_status t_p_status=$t_p_status t_c_status=$t_c_status Tsize=$Tsize Dsize=$Dsize resize_factor=$resize_factor\n $old_row\n $new_row\n"; $erdat_file = "./$region/error_data.txt"; open (ERDAT, ">>$erdat_file") || open (ERDAT, "+>$erdat_file"); print ERDAT "$erdat"; close (ERDAT); &release_file_lock("$location_of_lock_file"); print qq~Operation not completed!
Due to heavy traffic.
Please try again in a few minutes.
~; $E_email = "mdg\@bright.net"; $E_subject = "system error E1"; require "$auth_lib/mail-lib.pl"; &send_mail($auth_admin_from_address,$E_email,$E_subject,$erdat); exit; } return 1; } sub backup_addition { $t_o_status = open (TEMP_DATA, ">$temp_file_path"); $d_o_status = open (DATA_FILE, "$data_file_path"); $t_p_status = print TEMP_DATA ; close (DATA_FILE); close (TEMP_DATA); $t_c_status = chmod 0666, "$temp_file_path"; ($Tdev,$Tino,$Tmode,$Tnlink,$Tuid,$Tgid,$Trdev,$Tsize, $Tatime,$Tmtime,$Tctime,$Tblksize,$Tblocks) = stat ("$temp_file_path"); ($Ddev,$Dino,$Dmode,$Dnlink,$Duid,$Dgid,$Drdev,$Dsize, $Datime,$Dmtime,$Dctime,$Dblksize,$Dblocks) = stat ("$data_file_path"); if (-e "$backup_file_path") { ($Bdev,$Bino,$Bmode,$Bnlink,$Buid,$Bgid,$Brdev,$Bsize, $Batime,$Bmtime,$Bctime,$Bblksize,$Bblocks) = stat ("$backup_file_path"); } else {$Bsize = 0;} if (($t_o_status ==1) && ($d_o_status ==1) && ($t_c_status ==1) && ($t_p_status ==1) && ($Tsize > $Bsize) && ($Tsize == $Dsize)) { $r_success = rename ("$temp_file_path", "$backup_file_path"); $b_c_status = chmod 0666, "$backup_file_path"; if (($r_success ==1) && ($b_c_status ==1)) { return 1; } else { $erdat = "E3(ADD) $session_username $region $category $topic b_o_status=$b_o_status b_p_status=$b_p_status b_c_status=$b_c_status\n"; $erdat_file = "./$region/error_data.txt"; open (ERDAT, ">>$erdat_file") || open (ERDAT, "+>$erdat_file"); print ERDAT "$erdat"; close (ERDAT); $E_email = "mdg\@bright.net"; $E_subject = "system error E3"; require "$auth_lib/mail-lib.pl"; &send_mail($auth_admin_from_address,$E_email,$E_subject,$erdat); return 0; } } else { $erdat = "E4 $session_username $region $category $topic t_o_status=$t_o_status t_p_status=$t_p_status t_c_status=$t_c_status Tsize=$Tsize Dsize=$Dsize\n"; $erdat_file = "./$region/error_data.txt"; open (ERDAT, ">>$erdat_file") || open (ERDAT, "+>$erdat_file"); print ERDAT "$erdat"; close (ERDAT); &release_file_lock("$location_of_lock_file"); print qq~Operation not completed!
Due to heavy traffic.
Please check to see if your post made it, and if not, try again in a few minutes.
~; $E_email = "mdg\@actionol.com"; $E_subject = "system error E4"; require "$auth_lib/mail-lib.pl"; &send_mail($auth_admin_from_address,$E_email,$E_subject,$erdat); exit; } } sub track_sponsor_icons2 {} sub track_sponsor_icons {} sub track_sponsor_icons7 { $list = $_; $list =~ s///; @sponsors = split(/\|/,$list); if(($category eq "actionfigures")&&($topic == 100)) {@sponsors = ("hasbrocollectors_sp_icon");} $sponsor_icon_count_path = "/usr/www/users/gandalf/figures.com/databases/counts_S"; local ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst,$date); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); if ($mday < 10) {$mday = "0$mday";} $mon++; if ($mon < 10) {$mon = "0$mon";} $year = 1900 + $year; $YMDdate = "$year$mon$mday"; unless (-d "$sponsor_icon_count_path/$year") {mkdir("$sponsor_icon_count_path/$year",0777);} unless (-d "$sponsor_icon_count_path/$year/$mon") {mkdir("$sponsor_icon_count_path/$year/$mon",0777);} unless (-d "$sponsor_icon_count_path/$year/$mon/$mday") {mkdir("$sponsor_icon_count_path/$year/$mon/$mday",0777);} if ($domain eq "fig") {$Dcode = "fig";} if ($domain eq "ss") {$Dcode = "ssg";} if ($domain eq "wr") {$Dcode = "wg";} if ($domain eq "mf") {$Dcode = "mf";} if ($domain eq "") {$Dcode = "fig";} foreach $sponsor (@sponsors) { if((length($sponsor) < 3) || (length($sponsor) > 40)) {next;} $sponsor =~ s/bige/hollywood/gi; $counterfile = ""; $counterfile = "$sponsor_icon_count_path/$year/$mon/$mday/$YMDdate.$Dcode.news.$sponsor"; &get_file_lock("$counterfile.lok"); unless (-e "$counterfile") { open (COUNTER, "+>$counterfile"); print COUNTER "0"; close (COUNTER); } open (COUNTER, "$counterfile"); $count = ; close (COUNTER); $count++; open (COUNTER, ">$counterfile"); print COUNTER "$count"; close (COUNTER); &release_file_lock("$counterfile.lok"); } }