source: extensions/GuestBook/main.inc.php @ 26065

Revision 26065, 1.4 KB checked in by mistic100, 5 years ago (diff)

update for Piwigo 2.6 + code clean

Line 
1<?php
2/*
3Plugin Name: GuestBook
4Version: auto
5Description: Add a guestbook to the gallery
6Plugin URI: auto
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13// TODO akismet
14global $prefixeTable;
15
16
17define('GUESTBOOK_ID',      basename(dirname(__FILE__)));
18define('GUESTBOOK_PATH' ,   PHPWG_PLUGINS_PATH . GUESTBOOK_ID . '/');
19define('GUESTBOOK_TABLE' ,  $prefixeTable . 'guestbook');
20define('GUESTBOOK_ADMIN',   get_root_url().'admin.php?page=plugin-' . GUESTBOOK_ID);
21define('GUESTBOOK_URL',     get_absolute_root_url() . make_index_url(array('section' => 'guestbook')));
22define('GUESTBOOK_VERSION', 'auto');
23
24
25include_once(GUESTBOOK_PATH . 'include/events.inc.php');
26
27add_event_handler('init', 'guestbook_init');
28
29if (defined('IN_ADMIN'))
30{
31  add_event_handler('get_admin_plugin_menu_links', 'gb_admin_menu');
32}
33
34add_event_handler('blockmanager_apply', 'gb_menubar_apply', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
35
36add_event_handler('loc_end_section_init', 'gb_section_init');
37add_event_handler('loc_end_index', 'gb_index');
38
39
40function 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}
Note: See TracBrowser for help on using the repository browser.