Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: 1 [2] 3 4 5 6   Go Down

Author Topic: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting  (Read 229088 times)

0 Members and 2 Guests are viewing this topic.

soro

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #20 on: September 02, 2006, 08:21:40 pm »

same for me - I get only blank screen...

I also had the blank screen, until I realized I hadn't correctly entered my Akismet API key. :) Also, on my local sandbox install, it doesn't work. So I assume it's about the hack not interpreting the error Akismet probably returns if you're not authorized to use the service?

In any case, make sure you've dropped in your Akismet key, and your URL where it belongs. I believe also the Permalink URL some lines below. Finally, if your server is on PHP 5.+, from Prisoner_24601 above:

BTB, I have PHP5.  I'm usening the PHP5 class from http://www.achingbrain.net/stuff/akismet/

Hope that solves the issue. Plus, I have the serious impression that this hack seriously rrrrrrrocks. At least, I haven't seen any spam for a week or so. Eager to see the next version with the possibility to have a look into what's being filtered. :)
Logged

jasa

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #21 on: September 03, 2006, 05:12:49 pm »

It is definitely not the API key...
When I use wrog key than I get
Quote
Invalid API key. Please obtain one from http://wordpress.com/api-keys/
.

I also realized that I can add comment when I put out part of code after
Code: [Select]
$akismet = new Akismet($MyBlogURL, $WordPressAPIKey);or comment the rest after
Code: [Select]
/* $akismet->setCommentAuthor($name);
$akismet->setCommentAuthorEmail($email);
$akismet->setCommentAuthorURL($url);
$akismet->setCommentContent($comment);
$akismet->setPermalink('http://www.kjd-zagreb.hr/galerija');

if($akismet->isCommentSpam())
    // store the comment but mark it as spam (in case of a mis-diagnosis)
    cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
else */

I tried everything but I don't know how to debug this and what is wrong in this part...
When I put only one line more for example:
Quote
$akismet->setCommentAuthor($name);
I get again only blank screen...

When I use PHP5, it doesnt work from begining (include)...

SPAMers are killing me, and captcha also doesnt seem to work...

Any help?

Greetz
J.


Logged

soro

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #22 on: September 05, 2006, 04:12:41 am »

Hmm, different idea: May it be the include 'Akismet.class.php' statement has to come after you set the IN_COPPERMINE thingy to true? I remember I also played with the order of these statements between when I got a blank screen and when it started to pull. Just an idea, perhaps complete nonsense, for which case I do apologize.
Logged

soro

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 22
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #23 on: September 07, 2006, 05:54:11 pm »

My Akismet hack stopped filtering. :-( Only thing I did in the meantime was to upgrade my CPG installation form 1.4.8 to 1.4.9. I redeployed the hack afterward, of course.

Anyone with a similar experience? Or is it just my site? Is there a way to monitor the communication between my installation and Akismet? I don't have access to server logs.
Logged

ernst34

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #24 on: September 10, 2006, 10:29:20 pm »

I move this ost to this thjread as per suggestion of one of the Administrators:

Gau Gau
Thanks for your answer. Sorry to react late to it.
I was following your advise, got an API key and followed the procedures described in post
http://forum.coppermine-gallery.net/index.php?topic=33827.0 of Pharaoweb.

I must have done something wrong, when I did this:
------------------------------------------
<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2006 Coppermine Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.
  ********************************************
  Coppermine version: 1.4.4
  $Source: /cvsroot/coppermine/stable/db_input.php,v $
  $Revision: 1.18 $
  $Author: gaugau $
  $Date: 2006/02/24 13:30:07 $
**********************************************/

include 'Akismet.class.php';
define('IN_COPPERMINE', true);
define('DB_INPUT_PHP', true);[/size][/size]
---------------------------------------------------

I tested my new configuration in the gallery, and when I posted a test comment as a guest I only got an empty page, the route was http://www.ecolyma/galeria/db_input.php, and the page froze

I am confused now as to what the correct procedures would be.

Again, help from the forum will be much appreciated
Regards
Ernst
Logged

vody

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #25 on: September 16, 2006, 08:45:47 pm »

Dear,

I think I have the solution for the "blank page" problem. I'm a newbie in programming and bad in English, so I will try to explain the little modifications I made...

The matter comes that the functions called in "db_input.php" haven't the same name in the "Akismet.class.php" document. You have to change the code that you input in "db_input.php" :

Code: [Select]
        $WordPressAPIKey =  'your Akismet API key goes here';
$MyBlogURL = 'http://www.example.com/coppermine_root_dir/';
$name = $msg_author;
$comment = $msg_body;

$akismet = new Akismet($MyBlogURL ,$WordPressAPIKey);
$akismet->setAuthor($name);
$akismet->setAuthorEmail($email);
$akismet->setAuthorURL($url);
$akismet->setContent($comment);
$akismet->setPermalink('http://www.example.com/blog/alex/someurl/');

if($akismet->isSpam())
    // store the comment but mark it as spam (in case of a mis-diagnosis)
    cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
else
    // store the comment normally
    $insert = cpg_db_query("INSERT INTO {$CONFIG['TABLE_COMMENTS']} (pid, msg_author, msg_body, msg_date, author_md5_id, author_id, msg_raw_ip, msg_hdr_ip) VALUES ('$pid', '{$CONFIG['comments_anon_pfx']}$msg_author', '$msg_body', NOW(), '{$USER['ID']}', '0', '$raw_ip', '$hdr_ip')");

As you can see, the functions are no more called "setCommentAuthor(); setCommentAuthorEmail(); setCommentAuthorURL(); setCommentContent() and isCommentSpam()". I give them the same name as in the "Akismet.class.php" I found.

Logged

freesouljah

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 116
  • Can you feel the Love?
    • freesouljah.com
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #26 on: September 18, 2006, 07:19:07 am »

your english is fine and your fix worked great...thanks a bunch for figuring this out...

peace
 ;D


Dear,

I think I have the solution for the "blank page" problem. I'm a newbie in programming and bad in English, so I will try to explain the little modifications I made...

The matter comes that the functions called in "db_input.php" haven't the same name in the "Akismet.class.php" document. You have to change the code that you input in "db_input.php" :

Code: [Select]
        $WordPressAPIKey =  'your Akismet API key goes here';
$MyBlogURL = 'http://www.example.com/coppermine_root_dir/';
$name = $msg_author;
$comment = $msg_body;

$akismet = new Akismet($MyBlogURL ,$WordPressAPIKey);
$akismet->setAuthor($name);
$akismet->setAuthorEmail($email);
$akismet->setAuthorURL($url);
$akismet->setContent($comment);
$akismet->setPermalink('http://www.example.com/blog/alex/someurl/');

if($akismet->isSpam())
    // store the comment but mark it as spam (in case of a mis-diagnosis)
    cpg_die(ERROR, $lang_errors['perm_denied'], __FILE__, __LINE__);
else
    // store the comment normally
    $insert = cpg_db_query("INSERT INTO {$CONFIG['TABLE_COMMENTS']} (pid, msg_author, msg_body, msg_date, author_md5_id, author_id, msg_raw_ip, msg_hdr_ip) VALUES ('$pid', '{$CONFIG['comments_anon_pfx']}$msg_author', '$msg_body', NOW(), '{$USER['ID']}', '0', '$raw_ip', '$hdr_ip')");

As you can see, the functions are no more called "setCommentAuthor(); setCommentAuthorEmail(); setCommentAuthorURL(); setCommentContent() and isCommentSpam()". I give them the same name as in the "Akismet.class.php" I found.


ckroell

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #27 on: September 25, 2006, 03:48:15 pm »

5000 times thank you very much - your description solved my blank page issue and comments are now stored again caoorectly - waiting for the spamers now :-)
Logged

jasa

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #28 on: September 28, 2006, 12:54:06 am »

finally...  ;D work for me also fine! No blank screen any more...
TNX vody!
Logged

ckroell

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #29 on: September 29, 2006, 06:02:00 pm »

Hi,

I have successfully implemented this SPAM thing but do still suffer from these kind of entries:

http://tennotr.ifrance.com http://novieludi.blogspot.com/ (...) http://voyagithochu.blogspot.com/ (...) http://blditedor.blogspot.com/


I have just received more than 200 comments in a row with these links.

I do not want to force my guests to register so guests are allowed to enter comments.

Is there a chance to avoid these http comments? Maybe using this SPAM thing?

Thank you in advance.

Christian
Logged

ckroell

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 4
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #30 on: September 29, 2006, 09:33:59 pm »

Please disregard my last comment - I found the solution - I hope - in a different threat and I will go on implementing the captcha thing.

Thank you,

Christian
Logged

Thorsten

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
    • dampftraktion.de
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #31 on: October 23, 2006, 12:07:22 am »

Hello

to the first post: there are 2 identical lines that match the one to replace! Which one is to replace? I replaced the first one.
It seems to work, no errors but I don't know if spammers still can spam.
what to enter in $MyBlogURL and $akismet->setPermalink ? I entered the url to the cpg root in the first and my domain in the second field. correct? the whole rest has been untouched by me.

my gallery: http://bilder.dampftraktion.de
Logged
Thorsten

To see my gallery go to the website link in my profile

Thorsten

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 16
    • dampftraktion.de
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #32 on: October 23, 2006, 11:14:00 pm »

adding Askimet to the gallery brought me this error:
Parse error: parse error, unexpected T_IF, expecting T_CASE or T_DEFAULT or '}' in /[...]/coppermine/db_input.php on line 40
so, commenting is not possible at the moment.....
I only edited what waswritten above.
Logged
Thorsten

To see my gallery go to the website link in my profile

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #33 on: October 24, 2006, 07:37:00 am »

See my reply to your identical posting on the German support board: http://forum.coppermine-gallery.net/index.php?topic=37632.msg177659#msg177659
Please don't double-post your issues on several threads - decide for one, then stick to it.
Logged

osh

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #34 on: November 10, 2006, 11:08:47 pm »

Vody - thank you!!!   Your changes fix it correctly, and yes.  Your English is excellent, I was able to follow along what was going on.

This hack works great, so far.  I tested it as being logged in, not logged in with a legit anonymous comment, and with a proven spam comment (user "viagra-test-123" will always provide a true spam, based on akismet web site http://akismet.com/development/api/)

Now I wait patiently for pharaohweb's updates.  Being able to submit spam and ham back will allow us to help keep that database up to date and keep those evil bastard spammers at bay!!!
Logged

Sosha

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #35 on: November 21, 2006, 05:21:48 pm »

There seems to be a server error causing the captcha plugin/mod to not work on my host so I tried this instead and, after using the fix, it works great

hopefully the gallery will still be spam free in a few days

thanks
Logged

osh

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #36 on: November 27, 2006, 08:07:07 pm »

I have currently turned off anonymous comments, there were still spam comments getting through.  I believe this is the better method, it requires less overhead from the end user to worry about.  Having to try and decipher text in an image box is not something I enjoy, so don't want to inflict that on my visitors.

I eagerly await the additional changes to get the spam/ham submissions working...
Logged

Sosha

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #37 on: November 28, 2006, 01:54:31 pm »

ditto, the mod seems to work well but akismet aren't stopping the type of spam that goes through.
I honestly think that if i could just block any messages that contained urls or (...) then it would be spam free
Logged

bllamasy@gmail.com

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #38 on: December 10, 2006, 10:27:40 pm »

I am sorry I am new at this! I have installed akismet and done all modifications, how do I know that it is working???
Thanks in advance
Logged

Nibbler

  • Guest
Re: Mod/Hack: Adding Akismet spam-checking to Coppermine commenting
« Reply #39 on: December 10, 2006, 11:36:49 pm »

Already discussed, please read the thread before replying to it.

http://forum.coppermine-gallery.net/index.php?topic=33827.msg166277#msg166277
Logged
Pages: 1 [2] 3 4 5 6   Go Up
 

Page created in 0.039 seconds with 20 queries.