*keep reciprocal_url in input off add.php after submission with error
* prevent adding same submission on clicking reload page after a good submission
* prevent stupid submission by adding the url of your site on submission
add.php
in red i add or change :
replace :Code:// vars template global $error_msg, $title, $url, $description, $category, $contact_name, $email, $add_cat1, $add_cat2, $custom_field_form, $keywords, $reciprocal_url;
byCode:// additional category $add_cat1 = str_replace("<select name=cat>", "<select name=add_cat1>", $category_obj->DisplayCategoryListBox(-1)); $add_cat1 = str_replace("<OPTION VALUE=''>", "<OPTION VALUE='0'>", $add_cat1); $add_cat2 = str_replace("<select name=cat>", "<select name=add_cat2>", $category_obj->DisplayCategoryListBox(-1)); $add_cat2 = str_replace("<OPTION VALUE=''>", "<OPTION VALUE='0'>", $add_cat2);
------------------------------------------------------------Code:// additional category $replace_add_cat1 = $add_cat1; $replace_add_cat2 = $add_cat2; $add_cat1 = str_replace("<select name=cat>", "<select name=add_cat1>", $category_obj->DisplayCategoryListBox(-1)); $add_cat1 = str_replace("<OPTION VALUE=''>", "<OPTION VALUE='0'>", $add_cat1); $add_cat2 = str_replace("<select name=cat>", "<select name=add_cat2>", $category_obj->DisplayCategoryListBox(-1)); $add_cat2 = str_replace("<OPTION VALUE=''>", "<OPTION VALUE='0'>", $add_cat2); if (!empty($replace_add_cat1)) $add_cat1 = str_replace("<OPTION VALUE='$replace_add_cat1'", "<OPTION VALUE='$replace_add_cat1' selected", $add_cat1); if (!empty($replace_add_cat2)) $add_cat2 = str_replace("<OPTION VALUE='$replace_add_cat2'", "<OPTION VALUE='$replace_add_cat2' selected", $add_cat2);
------------------------------------------------------------Code:DisplayTemplate($theme_path . "add_form.html", "\$error_msg,\$title,\$url,\$description,\$category,\$contact_name,\$email,\$add_cat1,\$add_cat2,\$keywords,\$reciprocal_url,\$custom_field_form" . $custf);
add under // verify input
replace :Code://not the top beacause it depends on subdomain but works at 99% $parse_url_array = parse_url($url); $parse_uri_array = parse_url($_SERVER['SCRIPT_URI']) ; $parse_url = $parse_url_array['host']; $parse_uri = $parse_uri_array['host']; if (eregi("www.",$parse_uri)) $parse_uri=eregi_replace("www.","",$parse_uri); if (eregi("www.",$parse_url)) $parse_url=eregi_replace("www.","",$parse_url);
byCode:elseif (!empty($add_cat1) && !empty($add_cat1) && $add_cat1 == $add_cat2) $error_msg = "You can't select the same category twice"; elseif ($reciprocal_check) {
just after DisplayTemplate($theme_path . "add_ok.html", "\$novar");Code:elseif (!empty($add_cat1) && !empty($add_cat1) && $add_cat1 == $add_cat2) $error_msg = "You can't select the same category twice"; elseif ( ($parse_uri==$parse_url) or (eregi($parse_uri,$parse_url)) ) $error_msg = "The domain you entered is not valid"; elseif ($reciprocal_check) {
add:just after DisplayTemplate($theme_path . "add_pending.html", "\$novar");Code:unset($_SESSION['captcha_key']);
add:Code:unset($_SESSION['captcha_key']);


