source: extensions/rv_akismet/main.inc.php @ 12365

Revision 12365, 1.2 KB checked in by rvelices, 8 years ago (diff)

rv_akismet version 2.3.a

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?php /*
2Plugin Name: RV Akismet
3Version: 2.3.a
4Description: Uses Akismet online service to check comments agains spam
5Plugin URI: http://piwigo.org/ext/extension_view.php?eid=192
6Author: rvelices
7Author URI: http://www.modusoptimus.com
8*/
9
10define('AKIS_DIR' , basename(dirname(__FILE__)));
11define('AKIS_PATH' , PHPWG_PLUGINS_PATH . AKIS_DIR . '/');
12
13add_event_handler('user_comment_check', 'akismet_user_comment_check_wrapper', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2);
14
15add_event_handler('get_admin_plugin_menu_links', 'akismet_plugin_admin_menu' );
16
17function akismet_plugin_admin_menu($menu)
18{
19        global $page,$conf;
20        if ( empty($conf['akismet_api_key']) and in_array($page['page'], array('intro','plugins_list')) )
21        {
22                load_language('plugin.lang', AKIS_PATH);
23                $page['errors'][] = l10n('You need to define the Akismet api key');
24        }
25        $admin_url = get_admin_plugin_menu_link(dirname(__FILE__).'/admin.php');
26        array_push($menu,
27                        array(
28                                'NAME' => 'Akismet',
29                                'URL' => $admin_url
30                        )
31                );
32        return $menu;
33}
34
35
36function akismet_user_comment_check_wrapper($action, $comment)
37{
38        include_once( dirname(__FILE__).'/check.inc.php' );
39        return akismet_user_comment_check($action, $comment);
40}
41?>
Note: See TracBrowser for help on using the repository browser.