示例#1
0
function psc_get_random_question()
{
    global $CONFIG;
    $psc_question_ids = psc_get_question_ids();
    $rand_id = $psc_question_ids[mt_rand() % count($psc_question_ids)];
    return array('id' => $rand_id, 'text' => $CONFIG[PSC_QUESTION_PREFIX . $rand_id]);
}
示例#2
0
EOT;
} else {
    echo <<<EOT
        <tr>
            <td class="tableb">
                <button type="submit" class="button" name="add"><img src="images/icons/add.png" /></button>
                <input type="hidden" name="form_token" value="{$form_token}" />
                <input type="hidden" name="timestamp" value="{$timestamp}" />
                <input type="text" class="textinput" name="question" value="" />
            </td>
            <td class="tableb">
                <input type="text" class="textinput" name="answer" value="" />
            </td>
        </tr>
EOT;
    foreach (psc_get_question_ids() as $id) {
        echo <<<EOT
            <tr>
                <td class="tableb">
                    <a href="index.php?file=problem_solving_captcha/admin&amp;delete&amp;id={$id}&amp;form_token={$form_token}&amp;timestamp={$timestamp}"><img src="images/icons/delete.png" border="0" /></a>
                    <a href="index.php?file=problem_solving_captcha/admin&amp;edit&amp;id={$id}"><img src="images/icons/edit.png" border="0" /></a>
                    {$CONFIG[PSC_QUESTION_PREFIX . $id]}
                </td>
                <td class="tableb">
                    {$CONFIG[PSC_ANSWER_PREFIX . $id]}
                </td>
            </tr>
EOT;
    }
}
endtable();