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

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

[plugins] Comments on Albums

  • compatible with BBCode Bar and/or Smilies Support
  • better css integration
File size: 2.3 KB
Line 
1<?php
2/*
3Plugin Name: Comments on Albums
4Version: 1.0
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', '1.0');
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, $pwg_loaded_plugins;
41       
42        if ($page['section'] == 'categories' AND isset($page['category'])) {   
43                if (isset($pwg_loaded_plugins['bbcode_bar'])) set_bbcode_bar();
44                else if (isset($pwg_loaded_plugins['SmiliesSupport']))set_smiliessupport_page();
45               
46                include(COA_PATH . 'include/coa_albums.php');
47        }
48}
49
50function COA_comments_page() {
51        global $template, $page, $conf;
52       
53        if ($page['body_id'] == 'theCommentsPage') {
54                include(COA_PATH . 'include/coa_comments_page.php');
55        }
56}
57
58function COA_admin() {
59        global $template, $page, $conf;
60       
61        if ($page['page'] == 'comments') {     
62                include(COA_PATH . 'include/coa_admin_comments.php');
63        } else if ($page['page'] == 'intro') { 
64                include(COA_PATH . 'include/coa_admin_intro.php');
65        } 
66}
67
68function COA_admin_menu($menu) {
69        array_push($menu, array(
70                'NAME' => COA_NAME,
71                'URL' => COA_ADMIN
72        ));
73        return $menu;
74}
75
76?>
Note: See TracBrowser for help on using the repository browser.