XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
text.php
Go to the documentation of this file.
1
<?php
2
/*
3
You may not change or alter any portion of this comment or credits
4
of supporting developers from this source code or any supporting source code
5
which is considered copyrighted (c) material of the original comment or credit authors.
6
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
*/
11
26
class
XoopsCaptchaText
extends
XoopsCaptchaMethod
27
{
33
public
function
render
()
34
{
35
$form
= $this->
loadText
() .
' <input type="text" name="'
. $this->
config
[
'name'
]
36
.
'" id="'
. $this->
config
[
'name'
] .
'" size="'
. $this->
config
[
'num_chars'
]
37
.
'" maxlength="'
. $this->
config
[
'num_chars'
] .
'" value="" />'
;
38
$form
.=
'<br />'
.
XoopsLocale::INPUT_RESULT_FROM_EXPRESSION
;
39
if
(!empty($this->
config
[
'maxattempts'
])) {
40
$form
.=
'<br />'
. sprintf(
XoopsLocale::F_MAXIMUM_ATTEMPTS
, $this->
config
[
'maxattempts'
]);
41
}
42
return
$form
;
43
}
44
50
public
function
loadText
()
51
{
52
$val_a = rand(0, 9);
53
$val_b = rand(0, 9);
54
if
($val_a > $val_b) {
55
$expression =
"{$val_a} - {$val_b} = ?"
;
56
$this->code = $val_a - $val_b;
57
}
else
{
58
$expression =
"{$val_a} + {$val_b} = ?"
;
59
$this->code = $val_a + $val_b;
60
}
61
return
'<span style="font-style: normal; font-weight: bold; font-size: 100%; font-color: #333; border: 1px solid #333; padding: 1px 5px;">'
. $expression .
'</span>'
;
62
}
63
}
XoopsCaptchaText
Definition:
text.php:26
config
$form
$form
Definition:
xoops_code.php:21
XoopsCaptchaText\render
render()
Definition:
text.php:33
XoopsCaptchaMethod
Definition:
xoopscaptchamethod.php:32
XoopsLocaleEn_US\F_MAXIMUM_ATTEMPTS
const F_MAXIMUM_ATTEMPTS
Definition:
en_US.php:420
XoopsCaptchaText\loadText
loadText()
Definition:
text.php:50
XoopsLocaleEn_US\INPUT_RESULT_FROM_EXPRESSION
const INPUT_RESULT_FROM_EXPRESSION
Definition:
en_US.php:482
usr64
htdocs
class
captcha
text.php
Generated on Fri May 22 2015 03:06:59 for XOOPS by
1.8.9.1