Authimage finally working!

Big thanks to Gudlyf for his WordPress hack Authimage! Initially, I had a bit of difficulty getting it to work. My biggest problem was that it would not recognize that I entered the correct code. I noticed other people had posted problems about this, but no solutions were proposed. If you’re having a similar problem, read on.
    My directory structure and relevant files, for reference:

  • / (Root/Top-level directory of website.)
    • authimage.php
    • atomicclockradio.ttf
  • /tmp/ (This is where authimage creates temporary images.)
  • /blog/wordpress/
    • my-hacks.php
    • wp-comments.php
    • wp-comments-post.php
Please note that my blog directory is not the default wordpress directory. In fact, my wordpress directory is within my blog directory. The README tells you to copy the functions in “authimage-hacks.php” to your “my-hacks.php” file, but it does not mention anything about modifying any of those functions. In the function checkAICode, I had to change
$tmp_code_loc = getcwd() . $tmp_code_loc;

to

$tmp_code_loc = getcwd() . “/../..” . $tmp_code_loc;
This is because the “my-hacks.php” file must be in the wordpress directory, and the temporary image files are created in the /tmp/ directory. The functions in “my-hacks.php” must be able to access the image files to compare the filenames with the entered code. I also had to modify “authimage.php” to point to the correct “my-hacks.php” file. I changed
require_once(ABSPATH . ‘my-hacks.php’);

to

require_once(ABSPATH . ‘blog/wordpress/my-hacks.php’);
That was basically it! Everything else was according to the README file. Hope that helps someone.

Information about this entry:

3 Comments on “Authimage finally working!”

  1. the salmon farm Says:

    Fight against spam
    Like many sites, I get the odd bit of spam commenting. Now, being the kind of lazy guy I am, instead of being content with deleting the 2 or 3 comments that appear every day, I’ve decided to throw software at the problem. I’ve just ‘hacked’ the s…

  2. Chris Says:

    Just to put the TrackBack in context (I just noticed I don’t mention your site anywhere in the post), I needed to add your modifications to get my site working too. Cheers, you saved me a lot of hair-pulling-out time!

  3. Steve Says:

    Awesome. Glad I could help. šŸ™‚

Leave a Comment

Allowed code: <a href="" title="">, <abbr title="">, <acronym title="">, <b>, <blockquote cite="">, <cite>, <code>, <del datetime="">, <em>, <i>, <q cite="">, <s>, <strike>, <strong>