38 if (!extension_loaded(
'gd')) {
39 trigger_error(
'GD library is not loaded', E_USER_WARNING);
42 $required_functions = array(
43 'imagecreatetruecolor' ,
44 'imagecolorallocate' ,
45 'imagefilledrectangle' ,
49 foreach ($required_functions as $func) {
50 if (!function_exists($func)) {
51 trigger_error(
'Function ' . $func .
' is not defined', E_USER_WARNING);
67 $js =
"<script type='text/javascript'>
68 function xoops_captcha_refresh(imgId)
70 xoopsGetElementById(imgId).src = '" .
$xoops_url .
"/class/captcha/image/scripts/image.php?refresh='+Math.random();
75 $input =
'<input type="text" name="' . $this->
config[
'name'] .
'" id="' . $this->
config[
'name'] .
'" size="' . $this->
config[
'num_chars'] .
'" maxlength="' . $this->
config[
'num_chars'] .
'" value="" required>';
78 if (!empty($this->
config[
'maxattempts'])) {
81 return $js .
$image .
'<br /><br />' . $input .
'<br />' . $rule;
92 return '<img id="' . ($this->
config[
"name"]) .
'" src="' .
$xoops_url .
'/class/captcha/image/scripts/image.php" onclick=\'this.src="' .
$xoops_url .
'/class/captcha/image/scripts/image.php?refresh="+Math.random()' .
'\' style=
"cursor: pointer; vertical-align: middle;" alt=
"" />
';
if(empty($image_id)) $image
const CODE_IS_CASE_SENSITIVE
const INPUT_LETTERS_IN_THE_IMAGE
const CLICK_TO_REFRESH_IMAGE_IF_NOT_CLEAR
const CODE_IS_CASE_INSENSITIVE