Recent Entries





xoops [5]
FreeNX [1]
TinyMCE [3]
系統修改 [4]
LightBox [2]
XPress [1]
Lifetype系統更新 [10]
MySQL [4]
Windows相關 [5]
學用Blog [2]
有關模板 [5]
校務系統 [3]
站務公告 [7]
Plugins套用修改 [3]
IMageMagick [1]
設備使用 [1]
Moodle [1]
硬體相關 [2]
Ubuntu相關 [1]
CSS [1]
電腦教室管理 [0]


- LifeType 線上教學(官網)
- 部落格教室(怡杰老師)
- 阿欣部落
- 阿杰老師部落格教室


RSS 0.90
RSS 1.0
RSS 2.0
Atom 0.3


andreas01 v1.3


sirius | 23 四月, 2007 15:11




早前我提過以後留言時要輸入安全碼才成,而 Madthiu 問我為何會選擇 SecureImage 作為我的 Captcha plugin,雖然我在留言中回答了他,但我覺得有需要特地開一篇文章再作補充。

選擇 SecureImage 的原因

以我所知 Captcha plugin 起碼有以下 4 款:

我選擇 SecureImage 的原因是其他的 plugins 不是需要更改 WordPress core files,便是產生出來的 Captcha 比較容易被解碼,詳情可參考 PWNtcha, 而 SecureImage 除了不用更改 WordPress core files 外,在設定上很方便,在 Admin. Panel 就可以設定 Captcha 的長度、弧度、角度等,還有產生出來的 Captcha 以 PWNtcha 來說應該比較難以解碼,所以我便選擇了 SecureImage。

使用 SecureImage 的必需條件

大部份使用 UNIX 類 OS 的 web hosting 應該不用安裝便已經有 ImageMagick,而使用 Windows 平台的 web hosting 的話,就有需要下載了,整套 ImageMagick 軟件包括多套工具,但 SecureImage 只需要內裡的 convert(UNIX 版本)或 convert.exe(Windows 版本)工具而已。

使用 SecureImage 的注意事項

SecureImage 預設是會阻擋所有 pingback 及 trackback 的,大家可以使用這個 patch 去修改這個 plugin,或下載這個已修改的版本(下載後記著把 .txt 的 extension 轉成 .php)

SecureImage 產生出來的 Captcha 是包括大小寫英文字母及數字的,但因為弧度等問題,有時難以分辨,所以我便修改了只用小寫英文字母,方法如下:

首先在 secureimage.php 內搜尋 “// Generate the random string” 字串,在這句字串下面的數行正是 array 用來儲存 Captcha 使用的字符。

$chars = array("a","A","b","B","c","C","d","D","e","E","f","F","g","G",


$chars = array("a","b","c","d","e","f","g","h","i","j",

設定 SecureImage plugin

啟動 SecureImage 後,跟著便要做一些設定這個 plugin 才能正式生效,在文初提過使用 SecureImage 的必需條件是有 ImageMagick 及一個 TrueType font 的,在 SecureImage 的設定中要記下 convert / convert.exe 及 TrueType font 的路徑的,convert 的存放目錄路徑是以 UNIX 類 OS 預設的 /usr/bin/convert,如果使用 Windows 平台的話,記著路徑內的 要轉成 / 及整個路徑是不可含有空格的,例如 convert.exe 是存放在 c:imagemagick 內的話,路徑便是:


在 SecureImage 設定中隨了 convert 工具及 TrueType font 的路徑設定外,還可以選擇字型的大小、Captcha 的長度、弧度、角度等等,大家可以嘗試改變這些設定看看效果如何的。

最後使用這個 plugin 是不需要更改任何 theme file 的,因為 SecureImage 已經自動 register 在 comment_form 及 comment_post 內,所以只需啟動後及設定正確,Captcha 會自動顯示在留言面版中,如果沒有顯示出來的話可以檢查一下在你使用的 theme 內的 comments.php 內究竟有沒有以下這句:,如果沒有的話,這個 plugin 就不能用在你的 theme 了。

<?php do_action('comment_form', $post->ID); ?>

如果沒有的話可以自行將這句加在 comments.php 內 </form> 前,好像以下的做法:

<form .....>
<?php do_action('comment_form', $post->ID); ?>

之後 SecureImage 應該可以成功運行的了。 wink

Update (2005-09-17): 更正如果 comments.php 內沒有 do_action 這句是不能使用 SecureImage 這個說法,實則只需加進這句後 SecureImage 是可以成功運作的。


Posted in xoops . 迴響: (457). 引用:(0). 靜態連結網址
«Next post | Previous post»


  1. 1. women's salaries  |  02/20,2020 at 21:03

    Excellent article. Keep posting such kind of info on your page.
    Im really impressed by it.
    Hi there, You've performed an excellent job. I'll definitely digg it and personally suggest to my friends.
    I'm confident they'll be benefited from this website.

  2. 2. wedding and honeymoon travel  |  02/18,2020 at 11:13

    Touche. Outstanding arguments. Keep up the great work.

  3. 3. travel insurance  |  02/18,2020 at 08:24

    I know this web page offers quality depending posts and additional data, is there any
    other site which provides such stuff in quality?

  4. 4. work at home  |  02/12,2020 at 14:46

    This is very interesting, You're a very skilled blogger.
    I've joined your feed and look forward to seeking more of your fantastic post.
    Also, I've shared your website in my social networks!

  5. 5. amish sheds  |  02/12,2020 at 14:19

    I really like what you guys are up too. This sort of clever work and coverage!
    Keep up the excellent works guys I've incorporated
    you guys to my blogroll.

  6. 6. home and garden  |  02/12,2020 at 13:30

    Keep on writing, great job!

  7. 7. fat loss supplements  |  02/12,2020 at 12:47

    Greetings! Very useful advice in this particular post!

    It's the little changes that produce the most significant changes.
    Many thanks for sharing!

  8. 8. bankruptcy law  |  02/12,2020 at 11:33

    Greetings! This is my first visit to your blog!
    We are a team of volunteers and starting a new project in a
    community in the same niche. Your blog provided us valuable information to work on. You have done a wonderful job!

  9. 9. hotels in goa  |  02/12,2020 at 11:08

    I do not even understand how I stopped up here, however I believed this post was once good.
    I do not recognise who you are but definitely you are going to a famous blogger when you are not already.


  10. 10. worst stock investment  |  02/12,2020 at 11:01

    I think the admin of this web page is really working hard in support of his web site,
    for the reason that here every material is quality based material.

  11. 11. club tightly enough  |  02/12,2020 at 09:16

    I do agree with all of the concepts you've introduced for your post.
    They're very convincing and can certainly work.
    Still, the posts are very quick for starters. May just you please extend them a little
    from next time? Thank you for the post.

  12. 12. amish shed  |  02/12,2020 at 07:41

    It's awesome to pay a visit this site and reading the views of all mates about this article, while I am also eager of getting familiarity.

  13. 13. world news  |  02/12,2020 at 05:23

    Hello everyone, it's my first visit at this website, and post is in fact fruitful designed for me,
    keep up posting such content.

  14. 14. ways to help the homeless  |  02/11,2020 at 19:50

    I feel this is one of the most significant information for me.

    And i am satisfied reading your article. But should observation on some general issues, The web site style is ideal, the articles
    is actually nice : D. Good job, cheers

  15. 15. ford believes  |  02/11,2020 at 19:24

    This is a topic that's close to my heart... Take care!
    Exactly where are your contact details though?

  16. 16. real estate market  |  02/11,2020 at 17:30

    It's wonderful that you are getting thoughts from this paragraph as well as from
    our discussion made at this place.

  17. 17. jaguar body parts  |  02/10,2020 at 15:03

    I pay a visit daily some sites and blogs to read articles or reviews, except this blog gives
    feature based writing.

  18. 18. estate business  |  02/10,2020 at 14:44

    Hi there, just became alert to your blog through Google, and found that it's truly
    informative. I'm gonna watch out for brussels. I'll appreciate if you continue this in future.
    Many people will be benefited from your writing. Cheers!

  19. 19. cheap handbags  |  02/10,2020 at 13:37

    Asking questions are truly pleasant thing if you are not understanding anything
    totally, but this piece of writing gives pleasant understanding even.

  20. 20. women's golf  |  02/10,2020 at 11:47

    Excellent post. I used to be checking continuously this weblog and
    I am inspired! Extremely useful info particularly the closing section :) I maintain such information a lot.
    I used to be looking for this particular information for a long
    time. Thanks and best of luck.

Leave a Reply