Pages (2): 1 2   
Member
Member
DarrellD   2007-01-19, 07:37
#1

This hack is an answer to lots of calls for a solution to comment spam for the ZenPhoto gallery. Download it now or read about it on my blog.

Member
Member
jayray999   2007-01-22, 14:40
#2

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?

Member
Member
DarrellD   2007-01-22, 19:12
#3

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.

Member
Member
jayray999   2007-01-22, 20:58
#4

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.

Member
Member
DarrellD   2007-01-23, 03:51
#5

You mean is there a way to test if it's really filtering spam? Yeah, make a comment where the user's name is 'viagra-test-123' (without the quotes).

Member
Member
jayray999   2007-01-23, 23:10
#6

Thanks i will report my results when i try.

Member
Member
thinkdreams   2007-06-10, 21:18
#7

@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.)

Member
Member
DarrellD   2007-06-11, 05:14
#8

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

Member
Member
thinkdreams   2007-06-11, 11:46
#9

Groovy. I'll have to let you know how it works. (Got 91 spam messages in my inbox this morning from a comment bot.)

Member
Member
thinkdreams   2007-06-11, 13:07
#10

Got it installed. Thanks. I'll let you know how it does....

Craig.

Member
Member
kifo   2007-06-21, 02:03
#11

I had problems getting it installed though. I swop to use a PHP5 Class for my server but I got a Invalid API Key error. I am using the same API key as for the blog.

Does anyone knows how to get this to work on a PHP5 server?

Member
Member
DarrellD   2007-06-21, 04:43
#12

Yeah, you should be using the same key that you use for your blog.

Member
Member
TheBLIONCorp   2007-06-21, 10:05
#13

I got this kind of error when website URL was not correct...

Member
Member
kifo   2007-06-21, 16:07
#14

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?

Member
Member
DarrellD   2007-06-22, 01:49
#15

Can't tell without seeing your code.

Member
Member
kifo   2007-06-22, 03:16
#16

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/

Member
Member
DarrellD   2007-06-22, 06:14
#17

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.

Member
Member
kifo   2007-06-23, 12:02
#18

Thanks! Do release soon!

Member
Member
dprior   2007-08-27, 20:20
#19

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.

Member
Member
thinkdreams   2007-08-27, 22:38
#20

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.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.