source: extensions/Comments_on_Albums/main.inc.php @ 9752

Last change on this file since 9752 was 9641, checked in by mistic100, 13 years ago

[plugins] Comments on Albums

  • stable version
File size: 2.1 KB
Line 
1<?php
2/*
3Plugin Name: Comments on Albums
4Version: 0.3
5Description: Activate comments on albums pages
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=512
7Author: Mistic
8Author URI: http://www.strangeplanet.fr
9*/
10
11if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
12
13global $prefixeTable;
14
15// +-----------------------------------------------------------------------+
16//                                      Global variables
17// +-----------------------------------------------------------------------+
18define('COA_NAME' , 'Comments on Albums');
19define('COA_VERSION', '0.3');
20define('COA_DIR' , basename(dirname(__FILE__)));
21define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_DIR . '/');
22define('COA_TABLE' , $prefixeTable . 'comments_categories');
23define('COA_ADMIN', get_root_url().'admin.php?page=plugin-' . COA_DIR);
24
25
26// +-----------------------------------------------------------------------+
27//                                      Triggers
28// +-----------------------------------------------------------------------+
29add_event_handler('loc_end_index', 'COA_index');
30add_event_handler('loc_after_page_header', 'COA_comments_page');
31add_event_handler('loc_end_admin', 'COA_admin');
32add_event_handler('get_admin_plugin_menu_links', 'COA_admin_menu');
33
34
35// +-----------------------------------------------------------------------+
36//                                      Functions
37// +-----------------------------------------------------------------------+
38
39function 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
47function 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
55function 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
65function COA_admin_menu($menu) {
66        array_push($menu, array(
67                'NAME' => COA_NAME,
68                'URL' => COA_ADMIN
69        ));
70        return $menu;
71}
72
73?>
Note: See TracBrowser for help on using the repository browser.