1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: GuestBook |
---|
4 | Version: auto |
---|
5 | Description: Add a guestbook to the gallery |
---|
6 | Plugin URI: auto |
---|
7 | Author: Mistic |
---|
8 | Author URI: http://www.strangeplanet.fr |
---|
9 | */ |
---|
10 | |
---|
11 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
12 | |
---|
13 | // TODO akismet |
---|
14 | global $prefixeTable; |
---|
15 | |
---|
16 | |
---|
17 | define('GUESTBOOK_ID', basename(dirname(__FILE__))); |
---|
18 | define('GUESTBOOK_PATH' , PHPWG_PLUGINS_PATH . GUESTBOOK_ID . '/'); |
---|
19 | define('GUESTBOOK_TABLE' , $prefixeTable . 'guestbook'); |
---|
20 | define('GUESTBOOK_ADMIN', get_root_url().'admin.php?page=plugin-' . GUESTBOOK_ID); |
---|
21 | define('GUESTBOOK_URL', get_absolute_root_url() . make_index_url(array('section' => 'guestbook'))); |
---|
22 | define('GUESTBOOK_VERSION', 'auto'); |
---|
23 | |
---|
24 | |
---|
25 | include_once(GUESTBOOK_PATH . 'include/events.inc.php'); |
---|
26 | |
---|
27 | add_event_handler('init', 'guestbook_init'); |
---|
28 | |
---|
29 | if (defined('IN_ADMIN')) |
---|
30 | { |
---|
31 | add_event_handler('get_admin_plugin_menu_links', 'gb_admin_menu'); |
---|
32 | } |
---|
33 | |
---|
34 | add_event_handler('blockmanager_apply', 'gb_menubar_apply', EVENT_HANDLER_PRIORITY_NEUTRAL+10); |
---|
35 | |
---|
36 | add_event_handler('loc_end_section_init', 'gb_section_init'); |
---|
37 | add_event_handler('loc_end_index', 'gb_index'); |
---|
38 | |
---|
39 | |
---|
40 | function guestbook_init() |
---|
41 | { |
---|
42 | global $conf; |
---|
43 | |
---|
44 | include_once(GUESTBOOK_PATH . 'maintain.inc.php'); |
---|
45 | $maintain = new GuestBook_maintain(GUESTBOOK_ID); |
---|
46 | $maintain->autoUpdate(GUESTBOOK_VERSION, 'install'); |
---|
47 | |
---|
48 | load_language('plugin.lang', GUESTBOOK_PATH); |
---|
49 | |
---|
50 | $conf['guestbook'] = unserialize($conf['guestbook']); |
---|
51 | } |
---|