[21347] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Comments on Albums |
---|
| 4 | Version: auto |
---|
| 5 | Description: Activate comments on albums pages |
---|
[24545] | 6 | Plugin URI: auto |
---|
[21347] | 7 | Author: Mistic |
---|
| 8 | Author URI: http://www.strangeplanet.fr |
---|
| 9 | */ |
---|
| 10 | |
---|
[26089] | 11 | defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); |
---|
[21347] | 12 | |
---|
| 13 | if (mobile_theme()) |
---|
| 14 | { |
---|
| 15 | return; |
---|
| 16 | } |
---|
| 17 | |
---|
| 18 | global $prefixeTable; |
---|
| 19 | |
---|
[26089] | 20 | |
---|
| 21 | define('COA_ID', basename(dirname(__FILE__))); |
---|
[21347] | 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'); |
---|
[26089] | 29 | |
---|
[21347] | 30 | function coa_init() |
---|
| 31 | { |
---|
| 32 | global $user, $conf, $pwg_loaded_plugins; |
---|
[26089] | 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 | |
---|
[21347] | 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; |
---|
[26089] | 41 | |
---|
| 42 | include_once(COA_PATH . 'include/events.inc.php'); |
---|
| 43 | |
---|
[21347] | 44 | if (defined('IN_ADMIN')) |
---|
| 45 | { |
---|
[26089] | 46 | add_event_handler('tabsheet_before_select', 'coa_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
[21347] | 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'); |
---|
[26089] | 52 | add_event_handler('loc_end_comments', 'coa_comments'); |
---|
[21347] | 53 | } |
---|
| 54 | |
---|
[26089] | 55 | add_event_handler('get_stuffs_modules', 'coa_register_stuffs_module'); |
---|
[21347] | 56 | |
---|
| 57 | load_language('plugin.lang', COA_PATH); |
---|
| 58 | } |
---|