当前位置: 首页>>代码示例>>PHP>>正文


PHP captcha::make_image方法代码示例

本文整理汇总了PHP中captcha::make_image方法的典型用法代码示例。如果您正苦于以下问题:PHP captcha::make_image方法的具体用法?PHP captcha::make_image怎么用?PHP captcha::make_image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在captcha的用法示例。


在下文中一共展示了captcha::make_image方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gettext

if (isset($user_agree_rules) && $user_agree_rules == 'Y') {
    echo "  ", form_input_hidden('webtag', htmlentities_array($webtag)), "\n";
    echo "  ", form_input_hidden('user_agree_rules', htmlentities_array($user_agree_rules)), "\n";
    echo "  <div class=\"register_username\"><span>", gettext("Username"), ":</span>", light_form_input_text("user_logon", null, 20, 15) . "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_password\"><span>", gettext("Confirm Password"), ":</span>", light_form_input_password("user_password", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_nickname\"><span>", gettext("Nickname"), ":</span>", light_form_input_text("nickname", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_email\"><span>", gettext("Email"), ":</span>", light_form_input_text("email", null, 20, 32), "</div>\n";
    echo "  <div class=\"register_dob\"><span>", gettext("Date of Birth"), ":</span>\n";
    echo "  ", light_form_dob_dropdowns(isset($new_user_prefs['DOB_YEAR']) ? htmlentities_array($new_user_prefs['DOB_YEAR']) : 0, isset($new_user_prefs['DOB_MONTH']) ? htmlentities_array($new_user_prefs['DOB_MONTH']) : 0, isset($new_user_prefs['DOB_DAY']) ? htmlentities_array($new_user_prefs['DOB_DAY']) : 0, true), "</div>\n";
    if (forum_get_setting('text_captcha_enabled', 'Y') && $text_captcha->generate_keys()) {
        if (strlen(trim($text_captcha_private_key)) > 0) {
            echo form_input_hidden("private_key", htmlentities_array($text_captcha_private_key));
            echo form_input_hidden("public_key", htmlentities_array($text_captcha->get_public_key()));
        } else {
            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";
开发者ID:DeannaG65,项目名称:BeehiveForum,代码行数:31,代码来源:lregister.php

示例2: gettext

echo "                </tr>\n";
echo "                <tr>\n";
echo "                  <td align=\"center\">\n";
echo "                    <table class=\"posthead\" width=\"95%\">\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" width=\"250\">", gettext("Use text-captcha"), ":</td>\n";
echo "                        <td align=\"left\">", form_radio("text_captcha_enabled", "Y", gettext("Yes"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'Y'), "&nbsp;", form_radio("text_captcha_enabled", "N", gettext("No"), isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == 'N' || !isset($forum_global_settings['text_captcha_enabled'])), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" width=\"270\">", gettext("Text-captcha Dir"), ":</td>\n";
echo "                        <td align=\"left\">", form_input_text("text_captcha_dir", isset($forum_global_settings['text_captcha_dir']) ? htmlentities_array($forum_global_settings['text_captcha_dir']) : "text_captcha", 35, 255), "</td>\n";
echo "                      </tr>\n";
echo "                      <tr>\n";
echo "                        <td align=\"left\" colspan=\"2\">\n";
if (isset($forum_global_settings['text_captcha_enabled']) && $forum_global_settings['text_captcha_enabled'] == "Y") {
    if (!$text_captcha->generate_keys() || !$text_captcha->make_image()) {
        if ($errno = $text_captcha->get_error()) {
            switch ($errno) {
                case TEXT_CAPTCHA_NO_FONTS:
                    html_display_error_msg(gettext("Text-captcha has been disabled automatically because there are no true type fonts available for it to use. Please upload some true type fonts to <b>text_captcha/fonts</b> on your server."), '95%', 'center');
                    break;
                case TEXT_CAPTCHA_DIR_ERROR:
                    html_display_error_msg(gettext("Text-captcha has been disabled because the text_captcha directory and it's sub-directories are not writable by the web server / PHP process."), '95%', 'center');
                    break;
                case TEXT_CAPTCHA_GD_ERROR:
                    html_display_error_msg(gettext("Text-captcha has been disabled because your server's PHP setup does not provide support for GD Image manipulation and / or TTF font support. Both are required for text-captcha support."), '95%', 'center');
                    break;
            }
        }
    }
}
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:admin_default_forum_settings.php

示例3: sprintf

 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";
 if (forum_get_setting('text_captcha_enabled', 'Y') && $text_captcha->generate_keys()) {
     if (strlen(trim($text_captcha_private_key)) > 0) {
         echo form_input_hidden("private_key", htmlentities_array($text_captcha_private_key));
         echo form_input_hidden("public_key", htmlentities_array($text_captcha->get_public_key()));
     } else {
         if ($text_captcha_image = $text_captcha->make_image()) {
             $forum_owner_email = forum_get_setting('forum_email', null, 'admin@beehiveforum.co.uk');
             $forum_owner_link = sprintf("<a href=\"mailto:%s\">%s</a>", $forum_owner_email, gettext("forum owner"));
             echo "  <br />\n";
             echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"600\">\n";
             echo "    <tr>\n";
             echo "      <td align=\"left\">\n";
             echo "        <table class=\"box\" width=\"100%\">\n";
             echo "          <tr>\n";
             echo "            <td align=\"left\" class=\"posthead\">\n";
             echo "              <table class=\"posthead\" width=\"100%\">\n";
             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";
开发者ID:richstokoe,项目名称:BeehiveForum,代码行数:31,代码来源:register.php


注:本文中的captcha::make_image方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。