-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmain.inc.php
64 lines (50 loc) · 1.57 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
59
60
61
62
63
64
<?php
/*
Plugin Name: Comments on Albums
Version: auto
Description: Activate comments on albums pages
Plugin URI: auto
Author: Mistic
Author URI: http://www.strangeplanet.fr
Has Settings: false
*/
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
if (basename(dirname(__FILE__)) != 'Comments_on_Albums')
{
add_event_handler('init', 'coa_error');
function coa_error()
{
global $page;
$page['errors'][] = 'Comments on Albums folder name is incorrect, uninstall the plugin and rename it to "Comments_on_Albums"';
}
return;
}
if (mobile_theme())
{
return;
}
global $prefixeTable;
define('COA_PATH' , PHPWG_PLUGINS_PATH . 'Comments_on_Albums/');
define('COA_TABLE' , $prefixeTable . 'comments_categories');
define('COA_ADMIN', get_root_url().'admin.php?page=plugin-Comments_on_Albums');
add_event_handler('init', 'coa_init');
function coa_init()
{
global $user, $conf;
// luciano doesn't use comments
// incompatible with dynamic display of Stripped & Collumns
if ($user['theme'] == 'luciano' or $user['theme'] == 'stripped_black_bloc') return;
include_once(COA_PATH . 'include/events.inc.php');
if (defined('IN_ADMIN'))
{
add_event_handler('tabsheet_before_select', 'coa_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
add_event_handler('loc_begin_admin_page', 'coa_admin_intro');
}
else
{
add_event_handler('loc_after_page_header', 'coa_albums');
add_event_handler('loc_end_comments', 'coa_comments');
}
add_event_handler('get_stuffs_modules', 'coa_register_stuffs_module');
load_language('plugin.lang', COA_PATH);
}