{"id":31,"date":"2004-11-07T14:28:36","date_gmt":"2004-11-07T21:28:36","guid":{"rendered":"http:\/\/www.stevenbrown.ca\/blog\/?p=31"},"modified":"2004-11-07T17:08:02","modified_gmt":"2004-11-08T00:08:02","slug":"authimage-finally-working","status":"publish","type":"post","link":"https:\/\/www.stevenbrown.ca\/blog\/archives\/31","title":{"rendered":"Authimage finally working!"},"content":{"rendered":"<div class=\"paragraph\">Big thanks to <a href=\"http:\/\/www.gudlyf.com\/\">Gudlyf<\/a> for his WordPress hack <em>Authimage<\/em>! 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&#8217;re having a similar problem, read on.<\/div>\n<ul>My directory structure and relevant files, for reference:<\/p>\n<li>\/  <em>(Root\/Top-level directory of website.) <\/em>\n<ul>\n<li>authimage.php<\/li>\n<li>atomicclockradio.ttf<\/li>\n<\/ul>\n<\/li>\n<li>\/tmp\/  <em>(This is where authimage creates temporary images.)<\/em><\/li>\n<li>\/blog\/wordpress\/\n<ul>\n<li>my-hacks.php<\/li>\n<li>wp-comments.php<\/li>\n<li>wp-comments-post.php<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<div class=\"paragraph\">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 &#8220;authimage-hacks.php&#8221; to your &#8220;my-hacks.php&#8221; file, but it does not mention anything about modifying any of those functions.  In the function checkAICode, I had to change<\/div>\n<div class=\"code\">$tmp_code_loc = getcwd() . $tmp_code_loc;<\/div>\n<p> to<\/p>\n<div class=\"code\">$tmp_code_loc = getcwd() . <u>&#8220;\/..\/..&#8221; .<\/u> $tmp_code_loc;<\/div>\n<div class=\"paragraph\">This is because the &#8220;my-hacks.php&#8221; file must be in the wordpress directory, and the temporary image files are created in the \/tmp\/ directory.  The functions in &#8220;my-hacks.php&#8221; must be able to access the image files to compare the filenames with the entered code.  I also had to modify &#8220;authimage.php&#8221; to point to the correct &#8220;my-hacks.php&#8221; file.  I changed<\/div>\n<div class=\"code\">require_once(ABSPATH . &#8216;my-hacks.php&#8217;);<\/div>\n<p> to <\/p>\n<div class=\"code\">require_once(ABSPATH . &#8216;<u>blog\/wordpress\/<\/u>my-hacks.php&#8217;);<\/div>\n<div class=\"paragraph\">That was basically it!  Everything else was according to the README file.  Hope that helps someone.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;re having a similar problem,&hellip; <a class=\"more-link\" href=\"https:\/\/www.stevenbrown.ca\/blog\/archives\/31\">Continue reading <span class=\"screen-reader-text\">Authimage finally working!<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3,7],"tags":[],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-geek","category-website","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4jEMb-v","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/comments?post=31"}],"version-history":[{"count":0,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/posts\/31\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/media?parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/categories?post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.stevenbrown.ca\/blog\/wp-json\/wp\/v2\/tags?post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}