Maian Script World on Facebook Maian Script World on Twitter Maian Script World - Latest News Maian Script World on YouTube Maian Script World on LinkedIn


Please Read

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.

#1 26-04-2012 16:48:34

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

HELP!!!! Hijack!!!!!!!!!

It seems like the spammers have found their way onto my blog.
Every day i get quite a few stupid posts which donot make any sense, posted by "people???" with strange names.

I have the blog installed twice on my site, once in English, once in Dutch, and so far it only seems to happen on the Dutch page.

The Captcha is required, but they seem to get past it.

While I am at it, it is a bit annoying that, when i read a comment, I cannot remove it from that particular place (that is, after I have clicked on the pencil icon), it seems I can only alter comments there, but I have to go back to the admin page and go through the whole lookup again and then select the comment(s) in question for deletion.

Anyway, is there any kind of protection that could be added to avoid this (at least as much as possible)/

Thanks.

Offline

#2 26-04-2012 18:37:11

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Sorry to hear about the attack. sad

While I am at it, it is a bit annoying that, when i read a comment, I cannot remove it from that particular place (that is, after I have clicked on the pencil icon), it seems I can only alter comments there, but I have to go back to the admin page and go through the whole lookup again and then select the comment(s) in question for deletion.

Something I`ll update in a future version when I get to it.

Anyway, is there any kind of protection that could be added to avoid this (at least as much as possible)/

This is possibly the best option:
http://akismet.com/

I will integrate this in the next version, but again, its a long way off at the moment. If you feel adventurous, you could give it a go yourself?


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#3 26-04-2012 20:51:33

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

OK, wouldn't mind giving it a go, but how do I slot it into the blog?
It seems to be made for Wordpress and as far as I know the Maian blog does not support plugins.

Will the PHP5 class help?

Thanks.

Last edited by Klauwaart (26-04-2012 21:05:13)

Offline

#4 27-04-2012 06:19:49

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Klauwaart wrote:

OK, wouldn't mind giving it a go, but how do I slot it into the blog?
It seems to be made for Wordpress and as far as I know the Maian blog does not support plugins.

Will the PHP5 class help?

Thanks.

Its not just for wordpress, it can be plugged into anything. I haven`t looked at it in too much detail at the moment.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#5 27-04-2012 08:10:06

duceduc
Members
From: Japan
Registered: 25-05-2010
Posts: 359

Re: HELP!!!! Hijack!!!!!!!!!

I was having the same issue before. I get these comments that doesn't make sense. The maian gallery script has an email validation that works pretty good for added spam control. It sends an email validation link to the posters after they submit their comment before it is posted on the site.  You can implement that into your blog site.

If you are getting these comments that just don't make sense, it is probably a script generated posters that got pass the captcha. Mine is setup now to have their email confirm. If it gets too heavy, I also have a table setup for blacklisting emails and ip addresses. All these are in the gallery script. So far it has been working.

Offline

#6 27-04-2012 09:27:05

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

msworld wrote:
Klauwaart wrote:

OK, wouldn't mind giving it a go, but how do I slot it into the blog?
It seems to be made for Wordpress and as far as I know the Maian blog does not support plugins.

Will the PHP5 class help?

Thanks.

Its not just for wordpress, it can be plugged into anything. I haven`t looked at it in too much detail at the moment.

Yes, I know it works in others blogs and forms and things like that too, but in Wordpress, for example, you can just slot it in via a plugin, while in the Maian blog, it is obviously more difficult to implement it.
(Haven't really got a clue how to do it).

A pity there is no "approval before publication" feature for the posts.

Offline

#7 27-04-2012 13:12:00

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

The PHP5 class option looks fairly easy to implement?


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#8 27-04-2012 13:18:29

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

Thank you.
I'll give that a try.

Offline

#9 27-04-2012 14:05:36

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Klauwaart wrote:

Thank you.
I'll give that a try.

The code that adds the comment is:
$MW_COMMENT->add_comment_sql($_POST,$name,$comments,$email);

Around line 397. So, validate the comments via Aksimet and then either allow or disallow based on the response.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#10 27-04-2012 18:53:00

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

OK, and in which file do I add that line?
And does the classfile go into classes?

Thanks.

Offline

#11 27-04-2012 21:03:48

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Its in the main index file. The class file can go anywhere.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#12 27-04-2012 22:43:26

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

I slotted that line in.

I also have the following:


<?php

/**
* Akismet anti-comment spam service
*
* The class in this package allows use of the {@link http://akismet.com Akismet} anti-comment spam service in any PHP5 application.
*
* This service performs a number of checks on submitted data and returns whether or not the data is likely to be spam.
*
* Please note that in order to use this class, you must have a vaild {@link http://wordpress.com/api-keys/ WordPress API key}.  They are free for non/small-profit types and getting one will only take a couple of minutes.
*
* For commercial use, please {@link http://akismet.com/commercial/ visit the Akismet commercial licensing page}.
*
* Please be aware that this class is PHP5 only.  Attempts to run it under PHP4 will most likely fail.
*
* See the Akismet class documentation page linked to below for usage information.
*
* @package        akismet
* @author        Alex Potsides, {@link http://www.achingbrain.net http://www.achingbrain.net}
* @version        0.5
* @copyright    Alex Potsides, {@link http://www.achingbrain.net http://www.achingbrain.net}
* @license        http://www.opensource.org/licenses/bsd-license.php BSD License
*/

/**
* The Akismet PHP5 Class
*
* This class takes the functionality from the Akismet WordPress plugin written by {@link http://photomatt.net/ Matt Mullenweg} and allows it to be integrated into any PHP5 application or website.
*
* The original plugin is {@link http://akismet.com/download/ available on the Akismet website}.
*
* <code>
* $akismet = new Akismet('http://www.example.com/blog/', 'aoeu1aoue');
* $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
* </code>
*
* Optionally you may wish to check if your WordPress API key is valid as in the example below.
*
* <code>
* $akismet = new Akismet('http://www.example.com/blog/', 'aoeu1aoue');
*
* if($akismet->isKeyValid()) {
*   // api key is okay
* } else {
*   // api key is invalid
* }
* </code>
*
* @package    akismet
* @name    Akismet
* @version    0.5
* @author    Alex Potsides
* @link    http://www.achingbrain.net/
*/
class Akismet {
    private $version = '0.5';
    private $wordPressAPIKey;
    private $blogURL;
    private $comment;
    private $apiPort;
    private $akismetServer;
    private $akismetVersion;
    private $requestFactory;

    // This prevents some potentially sensitive information from being sent accross the wire.
    private $ignore = array('HTTP_COOKIE',
                            'HTTP_X_FORWARDED_FOR',
                            'HTTP_X_FORWARDED_HOST',
                            'HTTP_MAX_FORWARDS',
                            'HTTP_X_FORWARDED_SERVER',
                            'REDIRECT_STATUS',
                            'SERVER_PORT',
                            'PATH',
                            'DOCUMENT_ROOT',
                            'SERVER_ADMIN',
                            'QUERY_STRING',
                            'PHP_SELF' );

    /**
     * @param    string    $blogURL            The URL of your blog.
     * @param    string    $wordPressAPIKey    WordPress API key.
     */
    public function __construct($blogURL, $wordPressAPIKey) {
        $this->blogURL = $blogURL;
        $this->wordPressAPIKey = $wordPressAPIKey;

        // Set some default values
        $this->apiPort = 80;
        $this->akismetServer = 'rest.akismet.com';
        $this->akismetVersion = '1.1';
        $this->requestFactory = new SocketWriteReadFactory();

        // Start to populate the comment data
        $this->comment['blog'] = $blogURL;

        if(isset($_SERVER['HTTP_USER_AGENT'])) {
            $this->comment['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
        }

        if(isset($_SERVER['HTTP_REFERER'])) {
            $this->comment['referrer'] = $_SERVER['HTTP_REFERER'];
        }

        /*
         * This is necessary if the server PHP5 is running on has been set up to run PHP4 and
         * PHP5 concurently and is actually running through a separate proxy al a these instructions:
         * http://www.schlitt.info/applications/blog/archives/83_How_to_run_PHP4_and_PHP_5_parallel.html
         * and http://wiki.coggeshall.org/37.html
         * Otherwise the user_ip appears as the IP address of the PHP4 server passing the requests to the
         * PHP5 one...
         */
        if(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] != getenv('SERVER_ADDR')) {
            $this->comment['user_ip'] = $_SERVER['REMOTE_ADDR'];
        } else {
            $this->comment['user_ip'] = getenv('HTTP_X_FORWARDED_FOR');
        }
    }

    /**
     * Makes a request to the Akismet service to see if the API key passed to the constructor is valid.
     *
     * Use this method if you suspect your API key is invalid.
     *
     * @return bool    True is if the key is valid, false if not.
     */
    public function isKeyValid() {
        // Check to see if the key is valid
        $response = $this->sendRequest('key=' . $this->wordPressAPIKey . '&blog=' . $this->blogURL, $this->akismetServer, '/' . $this->akismetVersion . '/verify-key');
        return $response[1] == 'valid';
    }

    // makes a request to the Akismet service
    private function sendRequest($request, $host, $path) {
        $http_request  = "POST " . $path . " HTTP/1.0\r\n";
        $http_request .= "Host: " . $host . "\r\n";
        $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=utf-8\r\n";
        $http_request .= "Content-Length: " . strlen($request) . "\r\n";
        $http_request .= "User-Agent: Akismet PHP5 Class " . $this->version . " | Akismet/1.11\r\n";
        $http_request .= "\r\n";
        $http_request .= $request;

        $requestSender = $this->requestFactory->createRequestSender();
        $response = $requestSender->send($host, $this->apiPort, $http_request);

        return explode("\r\n\r\n", $response, 2);
    }

    // Formats the data for transmission
    private function getQueryString() {
        foreach($_SERVER as $key => $value) {
            if(!in_array($key, $this->ignore)) {
                if($key == 'REMOTE_ADDR') {
                    $this->comment[$key] = $this->comment['user_ip'];
                } else {
                    $this->comment[$key] = $value;
                }
            }
        }

        $query_string = '';

        foreach($this->comment as $key => $data) {
            if(!is_array($data)) {
                $query_string .= $key . '=' . urlencode(stripslashes($data)) . '&';
            }
        }

        return $query_string;
    }

    /**
     * Tests for spam.
     *
     * Uses the web service provided by {@link http://www.akismet.com Akismet} to see whether or not the submitted comment is spam.  Returns a boolean value.
     *
     * @return    bool    True if the comment is spam, false if not
     * @throws    Will throw an exception if the API key passed to the constructor is invalid.
     */
    public function isCommentSpam() {
        $response = $this->sendRequest($this->getQueryString(), $this->wordPressAPIKey . '.rest.akismet.com', '/' . $this->akismetVersion . '/comment-check');

        if($response[1] == 'invalid' && !$this->isKeyValid()) {
            throw new exception('The Wordpress API key passed to the Akismet constructor is invalid.  Please obtain a valid one from http://wordpress.com/api-keys/');
        }

        return ($response[1] == 'true');
    }

    /**
     * Submit spam that is incorrectly tagged as ham.
     *
     * Using this function will make you a good citizen as it helps Akismet to learn from its mistakes.  This will improve the service for everybody.
     */
    public function submitSpam() {
        $this->sendRequest($this->getQueryString(), $this->wordPressAPIKey . '.' . $this->akismetServer, '/' . $this->akismetVersion . '/submit-spam');
    }

    /**
     * Submit ham that is incorrectly tagged as spam.
     *
     * Using this function will make you a good citizen as it helps Akismet to learn from its mistakes.  This will improve the service for everybody.
     */
    public function submitHam() {
        $this->sendRequest($this->getQueryString(), $this->wordPressAPIKey . '.' . $this->akismetServer, '/' . $this->akismetVersion . '/submit-ham');
    }

    /**
     * To override the user IP address when submitting spam/ham later on
     *
     * @param string $userip    An IP address.  Optional.
     */
    public function setUserIP($userip) {
        $this->comment['user_ip'] = $userip;
    }

    /**
     * To override the referring page when submitting spam/ham later on
     *
     * @param string $referrer    The referring page.  Optional.
     */
    public function setReferrer($referrer) {
        $this->comment['referrer'] = $referrer;
    }

    /**
     * A permanent URL referencing the blog post the comment was submitted to.
     *
     * @param string $permalink    The URL.  Optional.
     */
    public function setPermalink($permalink) {
        $this->comment['permalink'] = $permalink;
    }

    /**
     * The type of comment being submitted.
     *
     * May be blank, comment, trackback, pingback, or a made up value like "registration" or "wiki".
     */
    public function setCommentType($commentType) {
        $this->comment['comment_type'] = $commentType;
    }

    /**
     *    The name that the author submitted with the comment.
     */
    public function setCommentAuthor($commentAuthor) {
        $this->comment['comment_author'] = $commentAuthor;
    }

    /**
     * The email address that the author submitted with the comment.
     *
     * The address is assumed to be valid.
     */
    public function setCommentAuthorEmail($authorEmail) {
        $this->comment['comment_author_email'] = $authorEmail;
    }

    /**
     * The URL that the author submitted with the comment.
     */
    public function setCommentAuthorURL($authorURL) {
        $this->comment['comment_author_url'] = $authorURL;
    }

    /**
     * The comment's body text.
     */
    public function setCommentContent($commentBody) {
        $this->comment['comment_content'] = $commentBody;
    }

    /**
     * Lets you override the user agent used to submit the comment.
     * you may wish to do this when submitting ham/spam.
     * Defaults to $_SERVER['HTTP_USER_AGENT']
     */
    public function setCommentUserAgent($userAgent) {
        $this->comment['user_agent'] = $userAgent;
    }

    /**
     * Defaults to 80
     */
    public function setAPIPort($apiPort) {
        $this->apiPort = $apiPort;
    }

    /**
     * Defaults to rest.akismet.com
     */
    public function setAkismetServer($akismetServer) {
        $this->akismetServer = $akismetServer;
    }

    /**
     * Defaults to '1.1'
     *
     * @param string $akismetVersion
     */
    public function setAkismetVersion($akismetVersion) {
        $this->akismetVersion = $akismetVersion;
    }

    /**
     * Used by unit tests to mock transport layer
     *
     * @param AkismetRequestFactory $requestFactory
     */
    public function setRequestFactory($requestFactory) {
        $this->requestFactory = $requestFactory;
    }
}

/**
* Used internally by Akismet
*
* This class is used by Akismet to do the actual sending and receiving of data.  It opens a connection to a remote host, sends some data and the reads the response and makes it available to the calling program.
*
* The code that makes up this class originates in the Akismet WordPress plugin, which is {@link http://akismet.com/download/ available on the Akismet website}.
*
* N.B. It is not necessary to call this class directly to use the Akismet class.
*
* @package    akismet
* @name    SocketWriteRead
* @version    0.5
* @author    Alex Potsides
* @link    http://www.achingbrain.net/
*/
class SocketWriteRead implements AkismetRequestSender {
    private $response;
    private $errorNumber;
    private $errorString;

    public function __construct() {
        $this->errorNumber = 0;
        $this->errorString = '';
    }

    /**
     *  Sends the data to the remote host.
     *
     * @param    string    $host            The host to send/receive data.
     * @param    int        $port            The port on the remote host.
     * @param    string    $request        The data to send.
     * @param    int        $responseLength    The amount of data to read.  Defaults to 1160 bytes.
     * @throws    An exception is thrown if a connection cannot be made to the remote host.
     * @returns    The server response
     */
    public function send($host, $port, $request, $responseLength = 1160) {
        $response = '';

        $fs = fsockopen($host, $port, $this->errorNumber, $this->errorString, 3);

        if($this->errorNumber != 0) {
            throw new Exception('Error connecting to host: ' . $host . ' Error number: ' . $this->errorNumber . ' Error message: ' . $this->errorString);
        }

        if($fs !== false) {
            @fwrite($fs, $request);

            while(!feof($fs)) {
                $response .= fgets($fs, $responseLength);
            }

            fclose($fs);
        }

        return $response;
    }

    /**
     * Returns the server response text
     *
     * @return    string
     */
    public function getResponse() {
        return $this->response;
    }

    /**
     * Returns the error number
     *
     * If there was no error, 0 will be returned.
     *
     * @return int
     */
    public function getErrorNumner() {
        return $this->errorNumber;
    }

    /**
     * Returns the error string
     *
     * If there was no error, an empty string will be returned.
     *
     * @return string
     */
    public function getErrorString() {
        return $this->errorString;
    }
}

/**
* Used internally by the Akismet class and to mock the Akismet anti spam service in
* the unit tests.
*
* N.B. It is not necessary to call this class directly to use the Akismet class.
*
* @package    akismet
* @name    SocketWriteReadFactory
* @version    0.5
* @author    Alex Potsides
* @link    http://www.achingbrain.net/
*/
class SocketWriteReadFactory implements AkismetRequestFactory {

    public function createRequestSender() {
        return new SocketWriteRead();
    }
}

/**
* Used internally by the Akismet class and to mock the Akismet anti spam service in
* the unit tests.
*
* N.B. It is not necessary to implement this class to use the Akismet class.
*
* @package    akismet
* @name    AkismetRequestSender
* @version    0.5
* @author    Alex Potsides
* @link    http://www.achingbrain.net/
*/
interface AkismetRequestSender {

    /**
     *  Sends the data to the remote host.
     *
     * @param    string    $host            The host to send/receive data.
     * @param    int        $port            The port on the remote host.
     * @param    string    $request        The data to send.
     * @param    int        $responseLength    The amount of data to read.  Defaults to 1160 bytes.
     * @throws    An exception is thrown if a connection cannot be made to the remote host.
     * @returns    The server response
     */
    public function send($host, $port, $request, $responseLength = 1160);
}

/**
* Used internally by the Akismet class and to mock the Akismet anti spam service in
* the unit tests.
*
* N.B. It is not necessary to implement this class to use the Akismet class.
*
* @package    akismet
* @name    AkismetRequestFactory
* @version    0.5
* @author    Alex Potsides
* @link    http://www.achingbrain.net/
*/
interface AkismetRequestFactory {

    public function createRequestSender();
}

?>

Is that the class file?
If it is, where do i enter my Askimet key?

Can't really make heads or tails of it.

Offline

#13 28-04-2012 05:39:43

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

It shows you how to use the class when you click on the link:
http://www.achingbrain.net/akismet

1. Pop that code into a file and save it in the 'classes' folder. Lets say you`ve called it 'akismet.php':

2. Open index file, find line 397. Change this block of code:

$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')
                            );
       }

to:

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())
       
       // 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')
                            );
       }
       
       }

Make sure you enter your correct API key.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#14 28-04-2012 10:54:03

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

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.

Offline

#15 28-04-2012 12:31:38

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

You don`t set anything in the class file, I already posted the code you need, so that should work. All that needs to be in the class file is the class itself:

class Akismet {
}


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#16 28-04-2012 12:52:25

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

OK,
but (forgive my ignorance, as you know i am a complete PHP novice), what I have given in the previous post (in code tags), is that the actual correct class file?

And do I have to set the "http://www.vlaanderen-flanders.org.uk/webblog/index.php" back to the value that was there, as well as the API Key value?

And finally, what you show about class.Akismet followed by the curly brackets, what do I do with that?

I know, some of my questions might look nothing short of stupid, but my PHP knowledge is very limited.

Thanks.

Offline

#17 28-04-2012 13:50:22

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

No problem. Email me your index.php file and the class file you have done so far.
support@maianscriptworld.co.uk


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#18 28-04-2012 13:54:52

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

Thanks David.
Files sent.

Offline

#19 28-04-2012 17:08:44

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Good luck, lets hope it works. smile


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#20 28-04-2012 17:55:58

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

David, IT HAS WORKED. smile

I just received 6 messages about spam attack that have been blocked.

Thank you so much for your help.

Offline

#21 29-04-2012 07:54:57

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Klauwaart wrote:

David, IT HAS WORKED. smile

I just received 6 messages about spam attack that have been blocked.

Thank you so much for your help.

Superb. smile

Glad it worked.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#22 12-05-2012 10:44:53

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

Hello again,
As I said, Akismet seems to do the job brilliantly, although no system is perfect.

Seems like the spammers have been on holiday, I received nothing at all for a few weeks, but now, they seem to be back, all refreshed and full of energy (probably sun tanned too smile ).

I had lots of notifications in today, telling me Akismet blocked messages, however, 2 slipped through.
On the page http://akismet.com/development/api/#submit-spam there is a whole explanation on what to do when that happens, but it is a bit beyond me, especially since those articles mostly focus on Wordpress plugins (which is the original aim of Akismet).

If any specialists out here can make any sense of the article and explain in human language how to help Akismet not to miss spam, I'd be glad to hear it.

Nevertheless, I still say Akismet is a significant improvement.

Thanks.

Offline

#23 12-05-2012 18:07:56

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

Klauwaart wrote:

Hello again,
As I said, Akismet seems to do the job brilliantly, although no system is perfect.

Seems like the spammers have been on holiday, I received nothing at all for a few weeks, but now, they seem to be back, all refreshed and full of energy (probably sun tanned too smile ).

I had lots of notifications in today, telling me Akismet blocked messages, however, 2 slipped through.
On the page [url]http://akismet.com/development/api/#submit-spam[/url] there is a whole explanation on what to do when that happens, but it is a bit beyond me, especially since those articles mostly focus on Wordpress plugins (which is the original aim of Akismet).

If any specialists out here can make any sense of the article and explain in human language how to help Akismet not to miss spam, I'd be glad to hear it.

Nevertheless, I still say Akismet is a significant improvement.

Thanks.

At least it works for some spam, which is good.


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

#24 12-05-2012 18:11:12

Klauwaart
Members
From: United Kingdom (Great Britain)
Registered: 22-10-2007
Posts: 184

Re: HELP!!!! Hijack!!!!!!!!!

msworld wrote:

At least it works for some spam, which is good.

I would even say "it works for most of the spam".

Offline

#25 13-05-2012 07:14:09

msworld
Administrator
From: United Kingdom (Great Britain)
Registered: 09-05-2006
Posts: 7,062

Re: HELP!!!! Hijack!!!!!!!!!

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?


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
David Ian Bennett - Lead Developer
www.maianscriptworld.co.uk

Offline

Board footer

2Checkout.com is an authorized reseller of goods and services provided by Maian Script World.© 2003-2013 David Ian Bennett. All Rights Reserved | Forum: FluxBB

Privacy Policy | Refund Policy