本文整理汇总了PHP中captcha::get_num_chars方法的典型用法代码示例。如果您正苦于以下问题:PHP captcha::get_num_chars方法的具体用法?PHP captcha::get_num_chars怎么用?PHP captcha::get_num_chars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类captcha
的用法示例。
在下文中一共展示了captcha::get_num_chars方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettext
echo " <tr>\n";
echo " <td align=\"left\" class=\"subhead\" colspan=\"2\">", gettext("Confirmation"), "</td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " <table class=\"posthead\" width=\"100%\">\n";
echo " <tr>\n";
echo " <td align=\"center\">\n";
echo " <table class=\"posthead\" width=\"95%\">\n";
echo " <tr>\n";
echo " <td align=\"left\" valign=\"top\" rowspan=\"2\">", sprintf(gettext("To prevent automated registrations this forum requires you enter a confirmation code. The code is displayed in the image to the right. If you are visually impaired or cannot otherwise read the code please contact the %s."), $forum_owner_link), "</td>\n";
echo " <td align=\"left\" valign=\"top\" rowspan=\"2\"> </td>\n";
echo " <td align=\"left\" valign=\"top\"><img src=\"data:image/jpeg;base64,", base64_encode(file_get_contents($text_captcha_image)), "\" alt=\"", gettext("This is a captcha-picture. It is used to prevent automatic registration"), "\" title=\"", gettext("This is a captcha-picture. It is used to prevent automatic registration"), "\" id=\"captcha_img\" /></td>\n";
echo " <td align=\"left\" valign=\"top\"><img src=\"", html_style_image('reload.png'), "\" border=\"0\" alt=\"\" class=\"text_captcha_reload\" id=\"text_captcha_reload\" /></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" colspan=\"2\">", form_input_text("private_key", "", 20, htmlentities_array($text_captcha->get_num_chars()), "", "text_captcha_input"), form_input_hidden("public_key", htmlentities_array($text_captcha->get_public_key())), "</td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td align=\"left\" colspan=\"2\"> </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
}
示例2: sprintf
if (($text_captcha_image = $text_captcha->make_image()) !== false) {
$forum_owner_email = forum_get_setting('forum_email', 'strlen', 'admin@beehiveforum.co.uk');
$forum_owner_link = sprintf("<a href=\"mailto:%s\">%s</a>", $forum_owner_email, gettext("forum owner"));
echo "</div>\n";
echo "</div>\n";
echo "<div class=\"register\">\n";
echo "<h3>", gettext("Confirmation"), "</h3>\n";
echo "<div class=\"register_inner\">\n";
//echo " <div class=\"register_confirmation\">\n";
echo " <div class=\"register_confirmation\">", sprintf(gettext("To prevent automated registrations this forum requires you enter a confirmation code. The code is displayed in the image below. If you are visually impaired or cannot otherwise read the code please contact the %s."), $forum_owner_link), "</div>\n";
echo " <div class=\"register_confirmation_image\">\n";
echo " ", html_style_image('text_captcha_image', gettext("This is a captcha-picture. It is used to prevent automatic registration"), 'text_captcha_image', array('background-image' => sprintf("url('data:image/jpeg;base64,%s')", base64_encode(file_get_contents($text_captcha_image))), 'width' => "{$text_captcha->get_width()}px", 'height' => "{$text_captcha->get_height()}px")), "\n";
echo " ", html_style_image('text_captcha_reload reload', null, 'text_captcha_reload'), "\n";
echo " </div>\n";
echo " <div class=\"register_confirmation_input\">\n";
echo " ", light_form_input_text("private_key", null, 20, htmlentities_array($text_captcha->get_num_chars())), "\n";
echo " </div>\n";
//echo " <div class=\"clearer\"></div>\n";
//echo "</div>\n";
}
}
}
echo " <div class=\"register_buttons\">\n";
echo " ", light_form_submit('register', gettext("Register"));
echo " <a href=\"llogon.php?webtag={$webtag}\" class=\"button\" target=\"_self\"><span>", gettext("Cancel"), "</span></a>\n";
echo " </div>\n";
} else {
$forum_name = forum_get_setting('forum_name', 'strlen', 'A Beehive Forum');
if (($forum_rules = forum_get_setting('forum_rules_message', 'strlen', false)) !== false) {
$forum_rules = sprintf(gettext("<p><b>Forum Rules</b></p><p>Registration to %1\$s is free! We do insist that you abide by the rules and policies detailed below. If you agree to the terms, please check the 'I agree' checkbox and press the 'Register' button below. If you would like to cancel the registration, click <a href=\"index.php?webtag=%2\$s\">here</a> to return to the forums index.</p><p>Although the administrators and moderators of %1\$s will attempt to keep all objectionable messages off this forum, it is impossible for us to review all messages. All messages express the views of the author, and neither the owners of %1\$s, nor Project Beehive Forum and its affiliates will be held responsible for the content of any message.</p><p>By agreeing to these rules, you warrant that you will not post any messages that are obscene, vulgar, sexually-orientated, hateful, threatening, or otherwise in violation of any laws.</p><p>The owners of %1\$s reserve the right to remove, edit, move or close any thread for any reason.</p>"), $forum_name, $webtag);
}
示例3: captcha
exit;
}
break;
case 'reload_captcha':
$text_captcha = new captcha(6, 15, 25, 9, 30);
if (!$text_captcha->generate_keys()) {
header_status(500, 'Internal Server Error');
exit;
}
if (!($text_captcha_image = $text_captcha->make_image())) {
header_status(500, 'Internal Server Error');
exit;
}
cache_disable();
header('Content-Type: application/json');
$content = json_encode(array('image' => sprintf("data:image/jpeg;base64,%s", base64_encode(file_get_contents($text_captcha_image))), 'chars' => $text_captcha->get_num_chars(), 'key' => $text_captcha->get_public_key()));
break;
case 'font_size_larger':
case 'font_size_smaller':
if (!session::logged_in()) {
break;
}
cache_disable();
if (!isset($_GET['msg']) || !validate_msg($_GET['msg'])) {
header_status(500, 'Internal Server Error');
exit;
}
list($tid, $pid) = explode('.', $_GET['msg']);
$user_prefs = user_get_prefs($uid);
switch ($_GET['action']) {
case 'font_size_smaller':