diff options
Diffstat (limited to 'modules/akismet')
-rw-r--r-- | modules/akismet/helpers/akismet_event.php | 22 | ||||
-rw-r--r-- | modules/akismet/helpers/akismet_menu.php | 36 | ||||
-rw-r--r-- | modules/akismet/module.info | 2 | ||||
-rw-r--r-- | modules/akismet/views/admin_akismet.html.php | 4 |
4 files changed, 23 insertions, 41 deletions
diff --git a/modules/akismet/helpers/akismet_event.php b/modules/akismet/helpers/akismet_event.php index 80fe0127..cec6d95d 100644 --- a/modules/akismet/helpers/akismet_event.php +++ b/modules/akismet/helpers/akismet_event.php @@ -40,15 +40,31 @@ class akismet_event_Core { $comment->save(); } - static function comment_updated($old, $new) { + static function comment_updated($original, $new) { if (!module::get_var("akismet", "api_key")) { return; } - if ($old->state != "spam" && $new->state == "spam") { + if ($original->state != "spam" && $new->state == "spam") { akismet::submit_spam($new); - } else if ($old->state == "spam" && $new->state != "spam") { + } else if ($original->state == "spam" && $new->state != "spam") { akismet::submit_ham($new); } } + + static function admin_menu($menu, $theme) { + $menu->get("settings_menu") + ->append(Menu::factory("link") + ->id("akismet") + ->label(t("Akismet")) + ->url(url::site("admin/akismet"))); + + if (module::get_var("akismet", "api_key")) { + $menu->get("statistics_menu") + ->append(Menu::factory("link") + ->id("akismet") + ->label(t("Akismet")) + ->url(url::site("admin/akismet/stats"))); + } + } } diff --git a/modules/akismet/helpers/akismet_menu.php b/modules/akismet/helpers/akismet_menu.php deleted file mode 100644 index ebd948d6..00000000 --- a/modules/akismet/helpers/akismet_menu.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php defined("SYSPATH") or die("No direct script access."); -/** - * Gallery - a web based photo album viewer and editor - * Copyright (C) 2000-2009 Bharat Mediratta - * - * 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. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. - */ -class akismet_menu_Core { - static function admin($menu, $theme) { - $menu->get("settings_menu") - ->append(Menu::factory("link") - ->id("akismet") - ->label(t("Akismet")) - ->url(url::site("admin/akismet"))); - - if (module::get_var("akismet", "api_key")) { - $menu->get("statistics_menu") - ->append(Menu::factory("link") - ->id("akismet") - ->label(t("Akismet")) - ->url(url::site("admin/akismet/stats"))); - } - } -} diff --git a/modules/akismet/module.info b/modules/akismet/module.info index d45d8a7b..b61ed107 100644 --- a/modules/akismet/module.info +++ b/modules/akismet/module.info @@ -1,3 +1,3 @@ -name = Akismet +name = "Akismet" description = "Filter comments through the Akismet web service to detect and eliminate spam (http://akismet.com). You'll need a WordPress.com API key to use it." version = 1 diff --git a/modules/akismet/views/admin_akismet.html.php b/modules/akismet/views/admin_akismet.html.php index 9963f223..410902a5 100644 --- a/modules/akismet/views/admin_akismet.html.php +++ b/modules/akismet/views/admin_akismet.html.php @@ -2,7 +2,9 @@ <div id="gAdminAkismet"> <h1> <?= t("Akismet Spam Filtering") ?> </h1> <p> - <?= t("Akismet is a free, automated spam filtering service. In order to use it, you need to sign up for a <a href=\"http://wordpress.com/api-keys\">Wordpress.com API Key</a>, which is also free. Your comments will be automatically relayed to <a href=\"http://akismet.com\">Akismet.com</a> where they'll be scanned for spam. Spam messages will be flagged accordingly and hidden from your vistors until you approve or delete them.") ?> + <?= t("Akismet is a free, automated spam filtering service. In order to use it, you need to sign up for a <a href=\"%api_key_url\">Wordpress.com API Key</a>, which is also free. Your comments will be automatically relayed to <a href=\"%akismet_url\">Akismet.com</a> where they'll be scanned for spam. Spam messages will be flagged accordingly and hidden from your vistors until you approve or delete them.", + array("api_key_url" => "http://wordpress.com/api-keys", + "akismet_url" => "http://akismet.com")) ?> </p> <? if ($valid_key): ?> |