' _ ', 1 => ' / /', 2 => ' /_/ ')); SDVA($TextCaptchaAscii[1], array( 0 => ' ', 1 => ' /', 2 => ' / ')); SDVA($TextCaptchaAscii[2], array( 0 => ' _', 1 => ' _/', 2 => ' /_ ')); SDVA($TextCaptchaAscii[3], array( 0 => ' _', 1 => ' _/', 2 => ' _/ ')); SDVA($TextCaptchaAscii[4], array( 0 => ' ', 1 => ' /_/', 2 => ' / ')); SDVA($TextCaptchaAscii[5], array( 0 => ' _ ', 1 => ' /_ ', 2 => ' _ / ')); SDVA($TextCaptchaAscii[6], array( 0 => ' _', 1 => ' /_', 2 => ' /_/')); SDVA($TextCaptchaAscii[7], array( 0 => ' __', 1 => ' /', 2 => ' / ')); SDVA($TextCaptchaAscii[8], array( 0 => ' _ ', 1 => ' /_/', 2 => ' /_/ ')); SDVA($TextCaptchaAscii[9], array( 0 => ' _', 1 => ' /_/', 2 => ' / ')); //format the numbers above in one line SDV($TextCaptchaAsciiFmt, "\n ".$TextCaptchaAscii[substr($TextCaptchaValue,0,1)][0] .$TextCaptchaAscii[substr($TextCaptchaValue,1,1)][0] .$TextCaptchaAscii[substr($TextCaptchaValue,2,1)][0] .$TextCaptchaAscii[substr($TextCaptchaValue,3,1)][0]."\n" ." ".$TextCaptchaAscii[substr($TextCaptchaValue,0,1)][1] .$TextCaptchaAscii[substr($TextCaptchaValue,1,1)][1] .$TextCaptchaAscii[substr($TextCaptchaValue,2,1)][1] .$TextCaptchaAscii[substr($TextCaptchaValue,3,1)][1]."\n" ." ".$TextCaptchaAscii[substr($TextCaptchaValue,0,1)][2] .$TextCaptchaAscii[substr($TextCaptchaValue,1,1)][2] .$TextCaptchaAscii[substr($TextCaptchaValue,2,1)][2] .$TextCaptchaAscii[substr($TextCaptchaValue,3,1)][2] ); // Put RequireTextCaptcha first // on EditFunctions array array_unshift($EditFunctions, 'RequireTextCaptcha'); $TextCaptchaCryptPass = TextCaptchaCrypt($TextCaptchaValue); $TextCaptchaAsciiFmt = '
'.$TextCaptchaAsciiFmt.'
'; // Make some variables accessible with FmtPV $FmtPV['$TextCaptchaPass'] = "'".$TextCaptchaCryptPass."'"; $FmtPV['$TextCaptchaClue'] = 'Keep("'.$TextCaptchaAsciiFmt.'")'; // Check the captcha sent by user function RequireTextCaptcha(){ global $MessagesFmt, $EnablePost, $TextCaptchaRequiredFmt; $resp = $_POST['captcharesp']; $pass = $_POST['captchapass']; if( $pass == TextCaptchaCrypt($resp)) return; SDV($TextCaptchaRequiredFmt, "
$[You must enter valid code]
"); $MessagesFmt[] = $TextCaptchaRequiredFmt; $EnablePost = 0; } // really simple encryption // that you can expand function TextCaptchaCrypt($x){ $x = strrev($x); $x = strtr($x,'0123456789','7231894650'); $x = base64_encode($x); return $x; }