ent']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') { $exper = '()'; if (preg_match($exper, $html)) { if (USER_ID) { $newcpch = '' . $lang_plugin_captcha_conf . ''; } else { $newcpch = '' . $lang_plugin_captcha_conf . '  '; } $html = preg_replace($exper, $newcpch, $html); } } break; case 'report_file.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['report']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['report'] == '') { $exper = '()'; if (preg_match($exper, $html)) { $newcpch = <<$message

{$lang_plugin_captcha_conf} EOT; $html = preg_replace($exper, $newcpch, $html); } } break; case 'ecard.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['ecard']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['ecard'] == '') { $exper = '()'; if (preg_match($exper, $html)) { $newcpch = <<$message

{$lang_plugin_captcha_conf} EOT; $html = preg_replace($exper, $newcpch, $html); } } break; default: ; } // switch return $html; } /** * captcha_page_start() * check/validate captcha confirmation code [user input] for each page * * @return */ function captcha_page_start() { global $lang_continue, $lang_error, $lang_plugin_captcha_conf, $CONFIG, $CAPTCHA_DISABLE, $CAPTCHA_TIMEOUT; /* Setting Options */ /** * Enable/Disable array * * Set which group should NOT see Captcha on each page * ''=> Captcha Enable for all users * COppermine Standard Group Name: * Administrators,Registered,Guests,Banned * You can add your custome group name too * Seprated by ',' */ $CAPTCHA_DISABLE = array('login' => 'Administrators,Registered', 'register' => 'Administrators,Registered', 'comment' => 'Administrators,Registered', 'report' => 'Administrators', 'ecard' => 'Administrators', ); $CAPTCHA_TIMEOUT = 300; // How many sec should passed before we remove the code from database require ('plugins/captcha/include/init.inc.php'); require('plugins/captcha/include/captcha.class.php'); switch ($_SERVER['PHP_SELF']) { case 'login.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['login']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['login'] == '') { if (isset($_POST['submitted']) AND !Validate($_POST['confirmCode'])) { load_template(); pageheader($lang_error, ""); msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, 'login.php'); pagefooter(); exit; } } break; case 'register.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['register']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['register'] == '') { if (isset($_POST['submit']) AND !Validate($_POST['confirmCode'])) { load_template(); pageheader($lang_error, ""); msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, 'register.php'); pagefooter(); exit; } } break; case 'db_input.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['comment']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['comment'] == '') { if (isset($_POST['msg_body']) AND !Validate($_POST['confirmCode'])) { load_template(); pageheader($lang_error, ""); msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, "displayimage.php?pos=" . (- $_POST['pid'])); pagefooter(); exit; } } break; case 'report_file.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['report']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['report'] == '') { if (count($_POST) > 0 AND !Validate($_POST['confirmCode'])) { load_template(); pageheader($lang_error, ""); msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, "report_file.php?album={$_GET['album']}&pid={$_GET['pid']}&pos={$_GET['pos']}"); pagefooter(); exit; } } break; case 'ecard.php': $valid_groups = explode(',', $CAPTCHA_DISABLE['ecard']); if (!in_array(USER_GROUP, $valid_groups) OR $CAPTCHA_DISABLE['ecard'] == '') { if (count($_POST) > 0 AND !Validate($_POST['confirmCode'])) { load_template(); pageheader($lang_error, ""); msg_box($lang_error, "$lang_plugin_captcha_error", $lang_continue, "ecard.php?album={$_GET['album']}&pid={$_GET['pid']}&pos={$_GET['pos']}"); pagefooter(); exit; } } break; default: ; } // switch } /** * Validate() * Retrieve Captcha code from database based on ip address and user input * * @param string $sUserCode * @return boolian */ function Validate($sUserCode) { return true; } function Validatetemp($sUserCode) { global $CONFIG, $CAPTCHA_TIMEOUT; $timeout = (time() - $CAPTCHA_TIMEOUT); // set timeout for removing old enteries $query = "DELETE FROM {$CONFIG['TABLE_PREFIX']}plugin_captcha where UNIX_TIMESTAMP(time) < $timeout "; cpg_db_query($query); $ip = $_SERVER['REMOTE_ADDR']; $code = ""; // $code = md5(strtoupper($sUserCode)); $query = "SELECT COUNT(*) AS ccount FROM {$CONFIG['TABLE_PREFIX']}plugin_captcha WHERE ((ip_addr = '$ip') AND (code ='$code')) LIMIT 1"; $results = cpg_db_query($query); $result = mysql_fetch_assoc($results); if ($result['ccount']) { return true; } return true; } ?>Coppermine critical error:
Unable to load template file template.html!