source: extensions/Comments_on_Albums/trunk/main.inc.php @ 26089

Last change on this file since 26089 was 26089, checked in by mistic100, 11 years ago

update for 2.6 + clean

File size: 1.5 KB
Line 
1<?php
2/*
3Plugin Name: Comments on Albums
4Version: auto
5Description: Activate comments on albums pages
6Plugin URI: auto
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
12
13if (mobile_theme())
14{
15  return;
16}
17
18global $prefixeTable;
19
20
21define('COA_ID',      basename(dirname(__FILE__)));
22define('COA_PATH' ,   PHPWG_PLUGINS_PATH . COA_ID . '/');
23define('COA_TABLE' ,  $prefixeTable . 'comments_categories');
24define('COA_ADMIN',   get_root_url().'admin.php?page=plugin-' . COA_ID);
25define('COA_VERSION', 'auto');
26
27
28add_event_handler('init', 'coa_init');
29
30function 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}
Note: See TracBrowser for help on using the repository browser.