mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 21:38:54 +00:00
beautify q&a captcha a bit (only slightly)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10116 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
5f244f64c6
commit
02b2cced5a
4 changed files with 54 additions and 54 deletions
|
@ -27,12 +27,12 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<!-- BEGIN questions -->
|
||||
|
||||
|
||||
<!-- IF questions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
|
||||
|
||||
|
||||
<td style="text-align: left;">{questions.QUESTION_TEXT}</td>
|
||||
<td style="text-align: center;">{questions.QUESTION_LANG}</td>
|
||||
<td style="text-align: center;"><a href="{questions.U_EDIT}">{ICON_EDIT}</a><a href="{questions.U_DELETE}">{ICON_DELETE}</a></td>
|
||||
<td style="text-align: center;"><a href="{questions.U_EDIT}">{ICON_EDIT}</a> <a href="{questions.U_DELETE}">{ICON_DELETE}</a></td>
|
||||
</tr>
|
||||
<!-- END questions -->
|
||||
</tbody>
|
||||
|
@ -58,21 +58,21 @@
|
|||
<form id="captcha_qa" method="post" action="{U_ACTION}">
|
||||
<fieldset>
|
||||
<legend>{L_EDIT_QUESTION}</legend>
|
||||
<dl>
|
||||
<dl>
|
||||
<dt><label for="strict">{L_QUESTION_STRICT}:</label><br /><span>{L_QUESTION_STRICT_EXPLAIN}</span></dt>
|
||||
<dd><label><input type="radio" class="radio" name="strict" value="1"<!-- IF STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
|
||||
<label><input type="radio" class="radio" name="strict" value="0"<!-- IF not STRICT --> id="strict" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
|
||||
</dl>
|
||||
|
||||
<dl>
|
||||
|
||||
<dl>
|
||||
<dt><label for="lang_iso">{L_QUESTION_LANG}</label><br /><span>{L_QUESTION_LANG_EXPLAIN}</span></dt>
|
||||
<dd><select id="lang_iso" name="lang_iso"><!-- BEGIN langs --><option value="{langs.ISO}" <!-- IF langs.ISO == LANG_ISO --> selected="selected" <!-- ENDIF -->>{langs.NAME}</option><!-- END langs --></select></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dl>
|
||||
<dt><label for="question_text">{L_QUESTION_TEXT}</label><br /><span>{L_QUESTION_TEXT_EXPLAIN}</span></dt>
|
||||
<dd><input id="question_text" maxlength="255" size="60" name="question_text" type="text" value="{QUESTION_TEXT}" /></dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dl>
|
||||
<dt><label for="answers">{L_QUESTION_ANSWERS}</label><br /><span>{L_ANSWERS_EXPLAIN}</span></dt>
|
||||
<dd><textarea id="answers" style="word-wrap: normal; overflow-x: scroll;" name="answers" rows="15" cols="800" >{ANSWERS}</textarea></dd>
|
||||
</dl>
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<dt><label for="answer">{L_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
|
||||
|
||||
<dd>
|
||||
<input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />
|
||||
<input type="text" tabindex="10" name="answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />
|
||||
</dd>
|
||||
</dl>
|
||||
|
|
|
@ -48,7 +48,7 @@ class phpbb_captcha_qa
|
|||
{
|
||||
global $config, $db, $user;
|
||||
|
||||
// load our language file
|
||||
// load our language file
|
||||
$user->add_lang('captcha_qa');
|
||||
|
||||
// read input
|
||||
|
@ -62,7 +62,7 @@ class phpbb_captcha_qa
|
|||
// try the user's lang first
|
||||
$sql = 'SELECT question_id
|
||||
FROM ' . CAPTCHA_QUESTIONS_TABLE . "
|
||||
WHERE lang_iso = '" . $db->sql_escape($user->data['user_lang']) . "'";
|
||||
WHERE lang_iso = '" . $db->sql_escape($user->data['user_lang']) . "'";
|
||||
$result = $db->sql_query($sql, 3600);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
|
@ -78,7 +78,7 @@ class phpbb_captcha_qa
|
|||
|
||||
$sql = 'SELECT question_id
|
||||
FROM ' . CAPTCHA_QUESTIONS_TABLE . "
|
||||
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
|
||||
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
|
||||
$result = $db->sql_query($sql, 7200);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
|
@ -139,7 +139,7 @@ class phpbb_captcha_qa
|
|||
|
||||
$sql = 'SELECT COUNT(question_id) as count
|
||||
FROM ' . CAPTCHA_QUESTIONS_TABLE . "
|
||||
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
|
||||
WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -283,7 +283,7 @@ class phpbb_captcha_qa
|
|||
function install()
|
||||
{
|
||||
global $db, $phpbb_root_path, $phpEx;
|
||||
|
||||
|
||||
if (!class_exists('phpbb_db_tools'))
|
||||
{
|
||||
include("$phpbb_root_path/includes/db/db_tools.$phpEx");
|
||||
|
@ -294,41 +294,41 @@ class phpbb_captcha_qa
|
|||
|
||||
$schemas = array(
|
||||
CAPTCHA_QUESTIONS_TABLE => array (
|
||||
'COLUMNS' => array(
|
||||
'question_id' => array('UINT', Null, 'auto_increment'),
|
||||
'strict' => array('BOOL', 0),
|
||||
'lang_id' => array('UINT', 0),
|
||||
'lang_iso' => array('VCHAR:30', ''),
|
||||
'question_text' => array('TEXT_UNI', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'question_id',
|
||||
'KEYS' => array(
|
||||
'lang_iso' => array('INDEX', 'lang_iso'),
|
||||
),
|
||||
'COLUMNS' => array(
|
||||
'question_id' => array('UINT', Null, 'auto_increment'),
|
||||
'strict' => array('BOOL', 0),
|
||||
'lang_id' => array('UINT', 0),
|
||||
'lang_iso' => array('VCHAR:30', ''),
|
||||
'question_text' => array('TEXT_UNI', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'question_id',
|
||||
'KEYS' => array(
|
||||
'lang_iso' => array('INDEX', 'lang_iso'),
|
||||
),
|
||||
),
|
||||
CAPTCHA_ANSWERS_TABLE => array (
|
||||
'COLUMNS' => array(
|
||||
'question_id' => array('UINT', 0),
|
||||
'answer_text' => array('STEXT_UNI', ''),
|
||||
),
|
||||
'KEYS' => array(
|
||||
'question_id' => array('INDEX', 'question_id'),
|
||||
),
|
||||
'COLUMNS' => array(
|
||||
'question_id' => array('UINT', 0),
|
||||
'answer_text' => array('STEXT_UNI', ''),
|
||||
),
|
||||
'KEYS' => array(
|
||||
'question_id' => array('INDEX', 'question_id'),
|
||||
),
|
||||
),
|
||||
CAPTCHA_QA_CONFIRM_TABLE => array (
|
||||
'COLUMNS' => array(
|
||||
'session_id' => array('CHAR:32', ''),
|
||||
'confirm_id' => array('CHAR:32', ''),
|
||||
'lang_iso' => array('VCHAR:30', ''),
|
||||
'question_id' => array('UINT', 0),
|
||||
'attempts' => array('UINT', 0),
|
||||
'confirm_type' => array('USINT', 0),
|
||||
),
|
||||
'KEYS' => array(
|
||||
'session_id' => array('INDEX', 'session_id'),
|
||||
'lookup' => array('INDEX', array('confirm_id', 'session_id', 'lang_iso')),
|
||||
),
|
||||
'PRIMARY_KEY' => 'confirm_id',
|
||||
'COLUMNS' => array(
|
||||
'session_id' => array('CHAR:32', ''),
|
||||
'confirm_id' => array('CHAR:32', ''),
|
||||
'lang_iso' => array('VCHAR:30', ''),
|
||||
'question_id' => array('UINT', 0),
|
||||
'attempts' => array('UINT', 0),
|
||||
'confirm_type' => array('USINT', 0),
|
||||
),
|
||||
'KEYS' => array(
|
||||
'session_id' => array('INDEX', 'session_id'),
|
||||
'lookup' => array('INDEX', array('confirm_id', 'session_id', 'lang_iso')),
|
||||
),
|
||||
'PRIMARY_KEY' => 'confirm_id',
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -415,7 +415,7 @@ class phpbb_captcha_qa
|
|||
|
||||
$sql = 'UPDATE ' . CAPTCHA_QA_CONFIRM_TABLE . '
|
||||
SET question_id = ' . (int) $this->question . "
|
||||
WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
|
||||
WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
|
||||
AND session_id = '" . $db->sql_escape($user->session_id) . "'";
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
@ -436,7 +436,7 @@ class phpbb_captcha_qa
|
|||
$sql = 'UPDATE ' . CAPTCHA_QA_CONFIRM_TABLE . '
|
||||
SET question_id = ' . (int) $this->question . ",
|
||||
attempts = attempts + 1
|
||||
WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
|
||||
WHERE confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
|
||||
AND session_id = '" . $db->sql_escape($user->session_id) . "'";
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
@ -451,7 +451,7 @@ class phpbb_captcha_qa
|
|||
global $db, $user;
|
||||
|
||||
$sql = 'SELECT con.question_id, attempts, question_text, strict
|
||||
FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes
|
||||
FROM ' . CAPTCHA_QA_CONFIRM_TABLE . ' con, ' . CAPTCHA_QUESTIONS_TABLE . " qes
|
||||
WHERE con.question_id = qes.question_id
|
||||
AND confirm_id = '" . $db->sql_escape($this->confirm_id) . "'
|
||||
AND session_id = '" . $db->sql_escape($user->session_id) . "'
|
||||
|
@ -520,7 +520,7 @@ class phpbb_captcha_qa
|
|||
}
|
||||
|
||||
/**
|
||||
* API function
|
||||
* API function
|
||||
*/
|
||||
function get_attempt_count()
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ class phpbb_captcha_qa
|
|||
}
|
||||
|
||||
/**
|
||||
* API function
|
||||
* API function
|
||||
*/
|
||||
function reset()
|
||||
{
|
||||
|
@ -544,7 +544,7 @@ class phpbb_captcha_qa
|
|||
}
|
||||
|
||||
/**
|
||||
* API function
|
||||
* API function
|
||||
*/
|
||||
function is_solved()
|
||||
{
|
||||
|
@ -815,7 +815,7 @@ class phpbb_captcha_qa
|
|||
|
||||
$langs = $this->get_languages();
|
||||
$question_ary = $data;
|
||||
|
||||
|
||||
$question_ary['lang_id'] = $langs[$data['lang_iso']]['id'];
|
||||
unset($question_ary['answers']);
|
||||
|
||||
|
@ -862,7 +862,7 @@ class phpbb_captcha_qa
|
|||
|
||||
foreach ($tables as $table)
|
||||
{
|
||||
$sql = "DELETE FROM $table
|
||||
$sql = "DELETE FROM $table
|
||||
WHERE question_id = $question_id";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<!-- ENDIF -->
|
||||
|
||||
<dl>
|
||||
<dt><label>{QA_CONFIRM_QUESTION}</label>:<br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
|
||||
<dt><label>{QA_CONFIRM_QUESTION}:</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
|
||||
<dd>
|
||||
<input type="text" tabindex="{$CAPTCHA_TAB_INDEX}" name="qa_answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />
|
||||
<input type="hidden" name="qa_confirm_id" id="qa_confirm_id" value="{QA_CONFIRM_ID}" />
|
||||
|
|
Loading…
Add table
Reference in a new issue