May I ask if this will work with URL cloaking e.g I have galleries set up like this.
http://gallery1.domain.com opens http://www.domain.com/clients/gallery1
http://gallery2.domain.com opens http://www.domain.com/clients/gallery2
and so on. Both versions of the URL work but I make the first version public.
Now what should I specify as my URL in the CONFIGURATION DATA section? I am thinking
http://www.domain.com/clients/ but will it work?
I'm really not sure. I've never tried URL cloaking. Are they two separate installations of zenphoto? If they are, you'd have to do the hack twice -- once for each installation. If not, I think http://www.domain.com/clients may work fine.
No, just one installation. The 'public' URL is a subdomain that redirects to the 'private' URL but in a way that the URL in the title bar only reflects the 'public' version.
Ok, so is there a way to test whether akismet is at work?
Thanks for all the work by the way.
@gamedudex-
I wanted to give your akismet hack a shot. Any chance you have the 0.6 zip? The link on your blog (and above) doesn't seem to point to anything.
(I seem to be getting larger amounts of spam lately.)
Sorry about that. I did some restructuring of my site. I've uploaded a copy of it to the Wiki.
You can get to it here:
http://www.zenphoto.org/trac/attachment/wiki/ZenphotoHacks/zp_akismet_hack.zip
Groovy. I'll have to let you know how it works. (Got 91 spam messages in my inbox this morning from a comment bot.)
Got it installed. Thanks. I'll let you know how it does....
Craig.
I got this kind of error when website URL was not correct...
Spot on TheBLIONCorp. Thanks!
Now I am stuck at the undefined method Akismet::isError() since the PHP5 class doesn't seem to define it.
Anyway I took the shortcut and commented out the lines with the isError() functions in my class-image.php and changing the isSpam() to isCommentSpam(). Now it seems it mark all comments as spam. Erm I am not an expert with PHP so what mistakes have I made?
Okay this is what I did. In class-image.php, I modified from line 164
`
// if($akismet->isError()) {
// echo'Couldn't connected to Akismet server!';
// // TODO: Add more precise error handling
// } else {
if($akismet->isCommentSpam()) {
// TODO: Add Spam Moderation Capabilities
echo 'Spam detected';
} else {
// echo 'Not Spam!';
`
I took the PHP5 Akismet Class from Alex here http://www.achingbrain.net/stuff/akismet/
I'm sorry kifo, but that php class is written by someone completely different. The two classes have two different architectures and so you can't just swap one for the other. If you want to use that class, you'll have to rewrite how you use it.
Supporting PHP5 is just one of the things I have planned for this hack, I just have to find the time to get around to doing it. Sorry.
I tried this hack and it didn't work. My gallery still works and I can view pictures. When I attempt to add comments, however, nothing happens. I tried the suggested test with the name "viagra-test-123" (without quotes) and the comment was not added and no error was returned. However, I also tried a legitimate comment and again nothing happened.
How is there not a simple "disable comments" option in the admin UI? I'd like to do that just to stem the tide for a bit. My only option to do that is to go hack the source and then unhack it when I want to turn comments on again.
dprior-
it seems to work for me ok. i even tested it with spam and it stops most of everything i have thrown at it. it does take about a day for new spam to be picked up by akismet, but it is using the api.
you may want to double check the pasted code (i had to do it a couple of times to get it right), and make sure your akismet key and paths are correct. I'll look at my code tonight and verify what needs to be changed, and I may want to take a peek at your modified files, if that's OK by you.
as for turning off the comments entirely, i think that's a planned feature for later versions, but as zenphoto is still in its infancy in terms of comparison with more mature commenting systems like wordpress, there are still a lot of features that need to be included. akismet and comment spam moderation is definitely one of them, it will just take time to get them in the code.
you can remove the commenting from your theme, and that should be sufficient to stop the comment spam if you want to go that route. i can assure you the akismet hack works that gamedudex devised though.