[wordpress插件] WP AuthImage Plugin (v3.0)WP AuthImage插件(v3.0)

wordpress 插件 文章 2020-02-23 10:10 500 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

written by Keith McDuffee (2004-6-7)

由基思·麦克杜菲(Keith McDuffee)撰写(2004-6-7)

http://www.gudlyf.com

http://www.gudlyf.com

gudlyf@realistek.com

gudlyf@realistek.com

CHANGELOG:

CHANGELOG:

3.0 — Much more effective (too much?) captcha generation, thanks to the
       

3.0-多亏了
,验证码的产生更加有效(太多了?)       

freely available VeriWord PHP class package
       

免费提供的VeriWord PHP类包
       

(http://www.phpclasses.org/browse/package/1768.html).

(http://www.phpclasses.org/browse/package/1768.html)。

In this release,
       

在此版本中,
       

I’ve decided to forget about the phoenetic text option.

我决定忘了“文本”选项。

If you want
       

如果你想
       

that option, just continue to use version 2.1.1.
       

该选项,只需继续使用2.1.1。版本即可。
       

Note that quite a bit has changed in this README, so if you want to
       

请注意,此自述文件已进行了很多更改,因此如果您想
       

upgrade, read this document fully.

升级,请完整阅读本文档。

REQUIREMENTS:

要求:

This hack assumes the following for your blog.

此hack假设您的博客具有以下特征。

Anything else is up to

其他一切取决于

the user to hack for their own use.

用户自行入侵。

These are the only reqs that have been

这些是唯一的要求

fully tested up to this point.

到目前为止已经过全面测试。

    • WordPress (https://wordpress.org/) version 1.2 or above (includes 1.5).
    • WordPress(https://wordpress.org/)1.2或更高版本(包括1.5)。

    • Apache 1.3 or above running on Linux.
    • 在Linux上运行的Apache 1.3或更高版本。

    • PHP 4 or above.
    • PHP 4或更高版本。

    • GD library (http://www.boutell.com/gd/) and Freetype library

    • GD库(http://www.boutell.com/gd/)和Freetype库

      (http://www.freetype.org/) for PHP.

      (http://www.freetype.org/)for PHP。

      See http://us2.php.net/gd for more

      有关更多信息,请参见http://us2.php.net/gd

      information.

    • 信息。

    • Some sort of shell access to your web server.
    • 对您的Web服务器的某种Shell访问。

    You can test your version of PHP for GD and Freetype with the following

    您可以使用以下命令测试GD和Freetype的PHP版本

    commands “from a shell”:

    “从外壳”命令:

    php -i |

      php -i | 

    grep "GD Support"

    grep“ GD支持”

    should return:

    应返回:

    GD Support enabled

    已启用GD支持

    and:

    和:

    php -i |

      php -i | 

    grep "FreeType Support"

    grep“ FreeType支持”

    should return:

    应返回:

    FreeType Support enabled

    启用了FreeType支持

    INSTALLATION:

    安装:

    Following the directions below with the included files should allow you to

    按照以下说明操作,随附的文件应允许您

    add authorization image checking for comments posted on your site.

    添加授权图片,检查发布在您网站上的评论。

    It displays

    它显示

    an image with a random word from a supplied list that the commenter has to enter in order for

    注释者必须输入的带有所提供列表中随机单词的图像,以便

    their comment to go through.

    他们的评论通过。

    This should cut down on any bots out there from

    这应该可以减少来自其中的任何机器人

    spamming your comments area and perhaps remove the need for comment moderation.

    向您的评论区域发送垃圾邮件,并可能消除对评论进行审核的需要。

    NOTE: It’s important to make the indicated changes to BOTH the regular AND the

    注意:重要的是对常规和“

    popup versions of the comment pages.

    评论页面的弹出版本。

    If you don’t do that, spammers may

    如果您不这样做,垃圾邮件发送者可能

    perhaps find a way to target the unedited version of the page.

    也许找到一种方法来定位页面的未编辑版本。

      1. Put the file “authimage.php” and the directory “authimage-inc” in your WP

        在WP中放置文件“ authimage.php”和目录“ authimage-inc”

        plugins directory.

        插件目录。

        Keep reading past step 7 if you want to use the

        如果要使用
        ,请继续阅读第7步

        JavaScript form checking.

        JavaScript表单检查。

      2. FOR WORDPRESS VERSIONS < 1.5, look for this in ‘wp-comments.php’ AND ‘wp-comments-popup.php’.

        对于WordPress版本<1.5,请在“ wp-comments.php”和“ wp-comments-popup.php”中查找。

        FOR WORDPRESS VERSION 1.5, loog for this in your theme’s ‘comments.php’ and/or ‘comments-popup.php’:

        对于WORDPRESS 1.5版,请在您主题的“ comments.php”和/或“ comments-popup.php”中使用:

      < ?php _e("URI”); ?>

      <?php _e(“ URI”);?>

      and add this after it:

      并在其后添加:

                

                

      ”

        1. FOR WORDPRESS VERSIONS < 1.5: Look for this in ‘wp-comments-post.php’:
        2. 对于WordPress版本<1.5:在“ wp-comments-post.php”中查找以下内容:

        if (strlen($url) < 7)
                

        如果(strlen($ url)<7)
                

        $url = ”;

        $ url =”;

        and add this after it:

        并在其后添加:

        // authimage — Check for valid sized code

        // authimage —检查有效大小的代码

        $code = trim(strip_tags($_POST[‘code’]));

        $ code = trim(strip_tags($ _ POST [‘code’]));

        FOR WORDPRESS VERSION 1.5: Look for this in ‘wp-comments-post.php’:

        对于WORDPRESS版本1.5:在“ wp-comments-post.php”中查找:

        $comment_content = $_POST[‘comment’];

        $ comment_content = $ _POST [‘comment’];

        and add this after it:

        并在其后添加:

        $comment_code = $_POST[‘code’];

        $ comment_code = $ _POST [‘code’];

        // AuthImage

        // AuthImage

          1. FOR WORDPRESS VERSIONS < 1.5: You have two options next, both require editing ‘wp-comments-post.php’:

            对于WordPress版本<1.5:接下来有两个选项,都需要编辑“ wp-comments-post.php”:

            To allow comments to come into the moderation pool, look for the following

            要允许评论进入审核池,请查找以下内容

            lines in ‘wp-comments-post.php’:

            “ wp-comments-post.php”中的行:

          if(check_comment($author, $email, $url, $comment, $user_ip)) {
                  

          if(check_comment($ author,$ email,$ url,$ comment,$ user_ip)){
                  

          $approved = 1;

          $ approved = 1;

          } else {
                  

          } else {
                  

          $approved = 0;

          $ approved = 0;

          }

          }

          and add this afterwards:

          并随后添加:

          // authimage — Check if valid code.

          // authimage-检查代码是否有效。

          If not valid, send to moderation.

          如果无效,请进行审核。

          if ( !checkAICode($code) )
                  

          if(!checkAICode($ code))
                  

          $approved = 0;

          $ approved = 0;

          -or- if you want to dump the comment altogether and warn the commenter
            

          -或-如果您要完全转储评论并警告评论者
            

          that an invalid code was entered, look for the following lines in
            

          输入的代码无效,请在
          中查找以下行  

          ‘wp-comments-post.php’:

          ‘wp-comments-post.php’:

          if ( ” == $comment )
              

          if(” == $ comment)
              

          die( __(‘Error: please type a comment.’) );

          die(__('错误:请输入评论。'));

          and add this after it:

          并在其后添加:

          if ( !checkAICode($code) )
                  

          if(!checkAICode($ code))
                  

          die( __(‘Error: please enter the valid authorization code.’) );

          die(__('错误:请输入有效的授权码。'));

          FOR WORDPRESS VERSION 1.5:

          对于WORDPRESS版本1.5:

          Look for the following lines n ‘wp-comments-post.php’:

          在“ wp-comments-post.php”中查找以下几行:

          if ( ” == $comment_content )
                  

          if(” == $ comment_content)
                  

          die( __(‘Error: please type a comment.’) );

          die(__('错误:请输入评论。'));

          and add this after it:

          并在其后添加:

          // AuthImage

          // AuthImage

          if ( !checkAICode($comment_code) )
                  

          如果(!checkAICode($ comment_code))
                  

          die( __(‘Error: please enter the valid authorization code.’) );

          die(__('错误:请输入有效的授权码。'));

            1. Make sure you’ve activated the AuthImage plugin.

              确保您已激活AuthImage插件。

            2. Make sure your ‘my-hacks.php’ file contains what is in ‘authimage-hacks.php’.

              确保您的“ my-hacks.php”文件包含“ authimage-hacks.php”中的内容。

              THIS IS STILL REQUIRED!

              仍然需要!

            3. Enable the ‘my-hacks.php legacy support’ from your WP options.

              从您的WP选项中启用“ my-hacks.php旧版支持”。

            4. You can configure lots of how the captcha image appears by editing the

              您可以通过编辑
              来配置许多验证码图像的显示方式

              ‘authimage-inc/veriword.ini’ file.

              “ authimage-inc / veriword.ini”文件。

              Read the PDF documentation at

              阅读位于
              的PDF文档

              ‘authimage-inc/manualveriword.pdf’ for a list of options.

              “ authimage-inc / manualveriword.pdf”以获取选项列表。

              You can also

              您也可以

              alter the dictionary used to generate words as well as the length of

              更改用于生成单词的字典以及
              的长度

              the word generated.

              产生的词。

              1. FOR WORDPRESS VERSIONS < 1.5: Edit ‘wp-comments.php’ AND ‘wp-comments-popup.php’

              2. 对于WordPress版本<1.5:编辑“ wp-comments.php”和“ wp-comments-popup.php”

                and change the following line.

                并更改以下行。

                FOR WORDPRESS VERSION 1.5, this line is in

                对于WORDPRESS 1.5版,此行位于

                ‘comments.php’ AND ‘comments-popup.php’ in your theme’s directory:

              3. 主题目录中的“ comments.php”和“ comments-popup.php”:

              <

              << / p>

              form action=”/wp-comments-post.php”

              form action =” / wp-comments-post.php”

              method=”post” id=”commentform”>

              method =” post” id =“ commentform”>

              to read:

              阅读:

              <

              << / p>

              form action=”/wp-comments-post.php”

              form action =” / wp-comments-post.php”

              method=”post” id=”commentform” onSubmit=”return testValues(this)”>

              method =“ post” id =“ commentform” onSubmit =“返回testValues(this)”>

                1. If you want to validate the email address, edit the plugin and uncomment

                2. 如果要验证电子邮件地址,请编辑插件并取消注释

                  the code that checks for email.

                  检查电子邮件的代码。

                  That’s it!

                3. 就是这样!

下载地址
https://downloads.wordpress.org/plugin/authimage.zip
-EOF-

AI助手支持GPT4.0