You are required to register before you can post. This is via a custom verification system. Please post any problems you are encountering here and I`ll do my best to respond as soon as I can. Please note that a reply WILL be posted to all queries, so do not double post. There are no guarantees
when a reply will appear but I do my best to answer all within 3/4 days max. Bumping topics won`t make the slightest difference.
IMPORTANT: Posts in English ONLY please, thank you! Any other languages will be ignored and your message deleted.
SEARCH: Use the search option to see if your question has been answered on the forum before. Or check the relevant script docs.
CUSTOMER: If you have purchased a commercial version of any of my software, using the contact option at the licence centre ensures a faster response.
AUTO DELETION: Accounts older than 5 days, with no posts or topics, are automatically deleted. Only register if you are thinking of posting.
PRIVATE MESSAGES: Private messages are currently disabled.
LINKS: Any links posted are 'NOFOLLOW' and will not be picked up by search engines.
You are not logged in.
Klauwaart wrote:msworld wrote:At least it works for some spam, which is good.
I would even say "it works for most of the spam".
Which is great. I think if you combat most then thats possibly as good as it gets?
Well, according to Akismet it could get even better
There is a mention of using an API to report spam or missed spam
Apparently, when that is implemented, it "learns" even more what is spam and what is not
They explain it further here: http://akismet.com/development/api/
(although it might as well be Chinese to me).
Offline
I don`t think you`ll ever get rid of spam 100%.
Offline
OK,
did that,
but,in the class file:<?php $WordPressAPIKey = '*********'; $MyBlogURL = 'http://www.vlaanderen-flanders.org.uk/webblog/index.php'; $akismet = new Akismet($MyBlogURL ,$WordPressAPIKey); $akismet->setCommentAuthor($name); $akismet->setCommentAuthorEmail($email); $akismet->setCommentAuthorURL($url); $akismet->setCommentContent($comment); $akismet->setPermalink('http://www.example.com/blog/alex/someurl/'); if($akismet->isCommentSpam()) // store the comment but mark it as spam (in case of a mis-diagnosis) else // store the comment normally ?>What do I change the "Permalink" to, and, after the last IF->ELSE statement, it just gives comments, like " // store the comment but mark it as spam (in case of a mis-diagnosis)", does that have to be changed to anything?
As for the blog itself, when i run it, i get "Parse error: syntax error, unexpected T_CASE in /home/mrdee/public_html/weblog/index.php on line 519".
Thanks.
Klauwaart:
I know this post is old and David had fixed your issue. I know why you were getting a syntax error. The code David posted above was missing an opening '{'. I was implementing this and I was getting email from admin when the post was a spam. I had enclosed the admin notify code block in brackets, which David did but forgot to add the opening brackets.
Klauwaart, you mentioned that you get notifications of spam. Who is sending you these notifications? From akismet when you sign up for a key? I am not getting any notifications when spam is detected.
Here is the correct code if anyone wants to implement the spam control. Thanks David for the guide.
include(FOLDER_PATH.'classes/akismet.php');
$WordPressAPIKey = 'aoeu1aoue';
$MyBlogURL = $SETTINGS->w_path.'/blog';
$akismet = new Akismet($MyBlogURL ,$WordPressAPIKey);
$akismet->setCommentAuthor($name);
$akismet->setCommentAuthorEmail($email);
$akismet->setCommentAuthorURL(($SETTINGS->modR ? $SETTINGS->w_path.'/blog/'.$id.'/'.addTitleToUrl(cleanData($BLOG->title)).'.html' : $SETTINGS->w_path.'/index.php?cmd=blog&post='.$id));
$akismet->setCommentContent($comments);
$akismet->setPermalink($SETTINGS->w_path.'/blog/'.$id.'/'.addTitleToUrl(cleanData($BLOG->title)).'.html');
if(!$akismet->isCommentSpam())
{ // <---------- Forgot to added opening bracket
// Add comments..
$MW_COMMENT->add_comment_sql($_POST,$name,$comments,$email);
// Send notification to webmaster if enabled..
if ($BLOG->notify)
{
$MW_MAIL->addTag('{BLOGTITLE}',$BLOG->title);
$MW_MAIL->addTag('{BLOGURL}',($SETTINGS->modR ? $SETTINGS->w_path.'/blog/'.$id.'/'.addTitleToUrl(cleanData($BLOG->title)).'.html' : $SETTINGS->w_path.'/index.php?cmd=blog&post='.$id));
$MW_MAIL->addTag('{COMMENTS}',$comments);
$MW_MAIL->addTag('{VISITOR}',$name);
$MW_MAIL->addTag('{EMAIL}',$email);
$MW_MAIL->addTag('{IP}',$_SERVER['REMOTE_ADDR']);
$MW_MAIL->addTag('{DATE}',date($SETTINGS->dateformat,strtotime("".$SETTINGS->timeOffset." hours")));
$MW_MAIL->addTag('{SITEPATH}',$SETTINGS->w_path);
$MW_MAIL->sendMail($SETTINGS->name,
$SETTINGS->email,
$name,
$email,
'['.$SETTINGS->website.'] '.$msg_viewblog5,
$MW_MAIL->template('themes/email/notification.txt')
);
}
}Offline
Actually Duc, if you look at the code its correct.
if (XX) { } else { }Is the same as:
if (XX) elseOffline