[9624] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: Comment on Albums |
---|
| 4 | Version: 0.1.a |
---|
| 5 | Description: Allows users to comment albums |
---|
| 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 | // +-----------------------------------------------------------------------+ |
---|
| 18 | define('COA_NAME' , 'Comment on Albums'); |
---|
| 19 | define('COA_VERSION', '0.1.a'); |
---|
| 20 | define('COA_DIR' , basename(dirname(__FILE__))); |
---|
| 21 | define('COA_PATH' , PHPWG_PLUGINS_PATH . COA_DIR . '/'); |
---|
| 22 | define('COA_TABLE' , $prefixeTable . 'comments_categories'); |
---|
| 23 | |
---|
| 24 | |
---|
| 25 | // +-----------------------------------------------------------------------+ |
---|
| 26 | // Triggers |
---|
| 27 | // +-----------------------------------------------------------------------+ |
---|
| 28 | add_event_handler('loc_end_index', 'COA_index'); |
---|
| 29 | add_event_handler('loc_end_admin', 'COA_admin'); |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | // +-----------------------------------------------------------------------+ |
---|
| 33 | // Fonctions |
---|
| 34 | // +-----------------------------------------------------------------------+ |
---|
| 35 | |
---|
| 36 | function COA_index() { |
---|
| 37 | global $template, $page, $conf; |
---|
| 38 | |
---|
| 39 | if ($page['section'] == 'categories' AND isset($page['category'])) { |
---|
| 40 | include(COA_PATH . 'include/coa_albums.php'); |
---|
| 41 | } |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | function COA_admin() { |
---|
| 45 | global $template, $page, $conf; |
---|
| 46 | |
---|
| 47 | if ($page['page'] == 'comments') { |
---|
| 48 | include(COA_PATH . 'include/coa_admin_comments.php'); |
---|
| 49 | } else if ($page['page'] == 'intro') { |
---|
| 50 | include(COA_PATH . 'include/coa_admin_intro.php'); |
---|
| 51 | } |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | ?> |
---|