-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.inc.php
58 lines (46 loc) · 1.45 KB
/
main.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/*
Plugin Name: GuestBook
Version: auto
Description: Add a guestbook to the gallery
Plugin URI: auto
Author: Mistic
Author URI: http://www.strangeplanet.fr
Has Settings: true
*/
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
if (basename(dirname(__FILE__)) != 'GuestBook')
{
add_event_handler('init', 'guestbook_error');
function guestbook_error()
{
global $page;
$page['errors'][] = 'GuestBook folder name is incorrect, uninstall the plugin and rename it to "GuestBook"';
}
return;
}
global $conf, $prefixeTable;
define('GUESTBOOK_PATH' , PHPWG_PLUGINS_PATH . 'GuestBook/');
define('GUESTBOOK_TABLE' , $prefixeTable . 'guestbook');
define('GUESTBOOK_ADMIN', get_root_url().'admin.php?page=plugin-GuestBook');
define('GUESTBOOK_URL', get_absolute_root_url() . make_index_url(array('section' => 'guestbook')));
$conf['guestbook'] = safe_unserialize($conf['guestbook']);
include_once(GUESTBOOK_PATH . 'include/events.inc.php');
add_event_handler('loading_lang', 'guestbook_loading_lang');
if (defined('IN_ADMIN'))
{
add_event_handler('get_admin_plugin_menu_links', 'gb_admin_menu');
}
else
{
add_event_handler('loc_end_section_init', 'gb_section_init');
add_event_handler('loc_end_index', 'gb_index');
}
if ($conf['guestbook']['menu_link'])
{
add_event_handler('blockmanager_apply', 'gb_menubar_apply', EVENT_HANDLER_PRIORITY_NEUTRAL+10);
}
function guestbook_loading_lang()
{
load_language('plugin.lang', GUESTBOOK_PATH);
}