[9624] | 1 | <?php |
---|
| 2 | /* |
---|
[9641] | 3 | Plugin Name: Comments on Albums |
---|
| 4 | Version: 0.3 |
---|
| 5 | Description: Activate comments on albums pages |
---|
[9624] | 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=512 |
---|
| 7 | Author: Mistic |
---|
| 8 | Author URI: http://www.strangeplanet.fr |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 12 | |
---|
| 13 | global $prefixeTable; |
---|
| 14 | |
---|
| 15 | // +-----------------------------------------------------------------------+ |
---|
| 16 | // Global variables |
---|
| 17 | // +-----------------------------------------------------------------------+ |
---|
[9641] | 18 | define('COA_NAME' , 'Comments on Albums'); |
---|
| 19 | define('COA_VERSION', '0.3'); |
---|
[9624] | 20 | define('COA_DIR' , basename(dirname(__FILE__))); |
---|
| 21 | define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_DIR . '/'); |
---|
| 22 | define('COA_TABLE' , $prefixeTable . 'comments_categories'); |
---|
[9641] | 23 | define('COA_ADMIN', get_root_url().'admin.php?page=plugin-' . COA_DIR); |
---|
[9624] | 24 | |
---|
| 25 | |
---|
| 26 | // +-----------------------------------------------------------------------+ |
---|
| 27 | // Triggers |
---|
| 28 | // +-----------------------------------------------------------------------+ |
---|
| 29 | add_event_handler('loc_end_index', 'COA_index'); |
---|
[9634] | 30 | add_event_handler('loc_after_page_header', 'COA_comments_page'); |
---|
[9624] | 31 | add_event_handler('loc_end_admin', 'COA_admin'); |
---|
[9641] | 32 | add_event_handler('get_admin_plugin_menu_links', 'COA_admin_menu'); |
---|
[9624] | 33 | |
---|
| 34 | |
---|
| 35 | // +-----------------------------------------------------------------------+ |
---|
[9634] | 36 | // Functions |
---|
[9624] | 37 | // +-----------------------------------------------------------------------+ |
---|
| 38 | |
---|
| 39 | function COA_index() { |
---|
| 40 | global $template, $page, $conf; |
---|
| 41 | |
---|
| 42 | if ($page['section'] == 'categories' AND isset($page['category'])) { |
---|
| 43 | include(COA_PATH . 'include/coa_albums.php'); |
---|
| 44 | } |
---|
| 45 | } |
---|
| 46 | |
---|
[9634] | 47 | function COA_comments_page() { |
---|
| 48 | global $template, $page, $conf; |
---|
| 49 | |
---|
| 50 | if ($page['body_id'] == 'theCommentsPage') { |
---|
| 51 | include(COA_PATH . 'include/coa_comments_page.php'); |
---|
| 52 | } |
---|
| 53 | } |
---|
| 54 | |
---|
[9624] | 55 | function COA_admin() { |
---|
| 56 | global $template, $page, $conf; |
---|
| 57 | |
---|
| 58 | if ($page['page'] == 'comments') { |
---|
| 59 | include(COA_PATH . 'include/coa_admin_comments.php'); |
---|
| 60 | } else if ($page['page'] == 'intro') { |
---|
| 61 | include(COA_PATH . 'include/coa_admin_intro.php'); |
---|
| 62 | } |
---|
| 63 | } |
---|
| 64 | |
---|
[9641] | 65 | function COA_admin_menu($menu) { |
---|
| 66 | array_push($menu, array( |
---|
| 67 | 'NAME' => COA_NAME, |
---|
| 68 | 'URL' => COA_ADMIN |
---|
| 69 | )); |
---|
| 70 | return $menu; |
---|
| 71 | } |
---|
| 72 | |
---|
[9624] | 73 | ?> |
---|