2007-07-19 12:40:05 +02:00
|
|
|
<?php
|
2008-01-08 07:41:55 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @package cms
|
2008-01-10 01:33:49 +01:00
|
|
|
* @subpackage comments
|
2008-01-08 07:41:55 +01:00
|
|
|
*/
|
|
|
|
|
2008-01-10 01:33:49 +01:00
|
|
|
/**
|
|
|
|
* @package cms
|
|
|
|
* @subpackage comments
|
|
|
|
*/
|
2007-07-19 12:40:05 +02:00
|
|
|
class SSAkismet extends Akismet {
|
|
|
|
private static $apiKey;
|
2007-08-10 04:14:56 +02:00
|
|
|
private static $saveSpam = true;
|
2007-07-19 12:40:05 +02:00
|
|
|
|
|
|
|
static function setAPIKey($key) {
|
|
|
|
self::$apiKey = $key;
|
|
|
|
}
|
|
|
|
|
|
|
|
static function isEnabled() {
|
|
|
|
return (self::$apiKey != null) ? true : false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static function setSaveSpam($save = true) {
|
|
|
|
SSAkismet::$saveSpam = $save;
|
|
|
|
}
|
|
|
|
|
|
|
|
static function getSaveSpam() {
|
|
|
|
return SSAkismet::$saveSpam;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
parent::__construct(Director::absoluteBaseURL(), self::$apiKey);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|