1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: Comments on Albums |
---|
4 | Version: auto |
---|
5 | Description: Activate comments on albums pages |
---|
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 | if (mobile_theme()) |
---|
14 | { |
---|
15 | return; |
---|
16 | } |
---|
17 | |
---|
18 | global $prefixeTable; |
---|
19 | |
---|
20 | |
---|
21 | define('COA_ID', basename(dirname(__FILE__))); |
---|
22 | define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_ID . '/'); |
---|
23 | define('COA_TABLE' , $prefixeTable . 'comments_categories'); |
---|
24 | define('COA_ADMIN', get_root_url().'admin.php?page=plugin-' . COA_ID); |
---|
25 | define('COA_VERSION', 'auto'); |
---|
26 | |
---|
27 | |
---|
28 | add_event_handler('init', 'coa_init'); |
---|
29 | |
---|
30 | function coa_init() |
---|
31 | { |
---|
32 | global $user, $conf, $pwg_loaded_plugins; |
---|
33 | |
---|
34 | include_once(COA_PATH . 'maintain.inc.php'); |
---|
35 | $maintain = new Comments_on_Albums_maintain(COA_ID); |
---|
36 | $maintain->autoUpdate(COA_VERSION, 'install'); |
---|
37 | |
---|
38 | // luciano doesn't use comments |
---|
39 | // incompatible with dynamic display of Stripped & Collumns |
---|
40 | if ($user['theme'] == 'luciano' or $user['theme'] == 'stripped_black_bloc') return; |
---|
41 | |
---|
42 | include_once(COA_PATH . 'include/events.inc.php'); |
---|
43 | |
---|
44 | if (defined('IN_ADMIN')) |
---|
45 | { |
---|
46 | add_event_handler('tabsheet_before_select', 'coa_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
47 | add_event_handler('loc_begin_admin_page', 'coa_admin_intro'); |
---|
48 | } |
---|
49 | else |
---|
50 | { |
---|
51 | add_event_handler('loc_after_page_header', 'coa_albums'); |
---|
52 | add_event_handler('loc_end_comments', 'coa_comments'); |
---|
53 | } |
---|
54 | |
---|
55 | add_event_handler('get_stuffs_modules', 'coa_register_stuffs_module'); |
---|
56 | |
---|
57 | load_language('plugin.lang', COA_PATH); |
---|
58 | } |
---|