[32457] | 1 | <?php |
---|
| 2 | /* |
---|
| 3 | Plugin Name: ConcoursPhoto |
---|
[32471] | 4 | Version: 11.0.2 |
---|
[32457] | 5 | Description: Concours de photo paramétrable |
---|
| 6 | Plugin URI: http://piwigo.org/ext/extension_view.php?eid=323 |
---|
| 7 | Author: Tiico |
---|
| 8 | Author URI: |
---|
| 9 | Has Settings: true |
---|
| 10 | */ |
---|
| 11 | /********* Fichier main.inc.php *********/ |
---|
| 12 | |
---|
| 13 | /* See CHANGELOG for release informations */ |
---|
| 14 | |
---|
| 15 | |
---|
| 16 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 17 | |
---|
| 18 | global $prefixeTable; |
---|
| 19 | |
---|
[32471] | 20 | define('CONCOURS_VERSION', '11.0.2'); // |
---|
[32457] | 21 | |
---|
| 22 | |
---|
| 23 | define('CONCOURS_NAME', 'Concours Photo'); |
---|
| 24 | define('CONCOURS_ROOT', dirname(__FILE__)); |
---|
| 25 | define('CONCOURS_DIR' , basename(dirname(__FILE__))); |
---|
| 26 | define('CONCOURS_CFG_FILE' , CONCOURS_ROOT.'/'.CONCOURS_DIR.'.dat'); |
---|
| 27 | define('CONCOURS_CFG_FILE1' , PHPWG_PLUGINS_PATH.CONCOURS_DIR.'.dat'); |
---|
| 28 | define('CONCOURS_CFG_DB' , CONCOURS_DIR); |
---|
| 29 | define('CONCOURS_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/'); |
---|
| 30 | define('CONCOURS_INC_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/include/'); |
---|
| 31 | define('CONCOURS_IMG_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/img/'); |
---|
| 32 | define('CONCOURS_ADMIN_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/admin/'); |
---|
| 33 | define('CONCOURS_RESULT_FOLDER' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/result/'); |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | define('CONCOURS_TABLE' , $prefixeTable . 'concours'); |
---|
| 37 | define('CONCOURS_DETAIL_TABLE' , $prefixeTable . 'concours_detail'); |
---|
| 38 | define('CONCOURS_DATA_TABLE' , $prefixeTable . 'concours_data'); |
---|
| 39 | define('CONCOURS_RESULT_TABLE' , $prefixeTable . 'concours_result'); |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | |
---|
| 43 | load_language('plugin.lang', CONCOURS_PATH); |
---|
| 44 | |
---|
| 45 | include_once CONCOURS_INC_PATH.'Concours.class.php'; |
---|
| 46 | global $page, $template; |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | $concours = new Concours(); |
---|
| 50 | |
---|
| 51 | // disable meta to picture page (if param) |
---|
| 52 | add_event_handler('loc_begin_picture',array(&$concours, 'disable_meta_to_picture')); |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | // Add concours to picture page |
---|
| 56 | add_event_handler('loc_end_picture', array(&$concours, 'display_concours_to_picture')); |
---|
| 57 | // Add admin page - DEPRECATED |
---|
| 58 | //add_event_handler('get_admin_plugin_menu_links', array(&$concours, 'concours_admin_menu') ); |
---|
| 59 | |
---|
| 60 | // MenuBar |
---|
| 61 | add_event_handler('blockmanager_register_blocks', array(&$concours, 'register_blocks') ); |
---|
| 62 | add_event_handler('blockmanager_apply', array(&$concours, 'blockmanager_apply') ); |
---|
| 63 | |
---|
| 64 | add_event_handler('loc_end_section_init', array(&$concours, 'section_init_concours')); |
---|
| 65 | |
---|
| 66 | // Publish result page |
---|
| 67 | add_event_handler('loc_end_index', array(&$concours, 'index_concours')); |
---|
| 68 | |
---|
| 69 | // Global vote page (with all thumbnails) |
---|
| 70 | add_event_handler('loc_end_index', array(&$concours, 'index_vote_concours')); |
---|
| 71 | |
---|
| 72 | |
---|
| 73 | // Add Global note under thumbnail |
---|
| 74 | add_event_handler('loc_end_index_thumbnails', array(&$concours, 'thumbnail_note'), 50, 2); |
---|
| 75 | |
---|
| 76 | // Add PWG Stuffs |
---|
| 77 | add_event_handler('get_stuffs_modules', array(&$concours, 'concours_stuffs_module')); |
---|
| 78 | |
---|
| 79 | // Add description with contest informations on category |
---|
| 80 | add_event_handler ('render_category_description', array(&$concours, 'add_contest_desc'), EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | |
---|
| 84 | /* +-----------------------------------------------------------------------+ |
---|
| 85 | * | CSS/JS Style | |
---|
| 86 | * +-----------------------------------------------------------------------+ */ |
---|
| 87 | add_event_handler('loc_end_page_header', 'ConcoursPhoto_css_js'); |
---|
| 88 | |
---|
| 89 | function ConcoursPhoto_css_js() { |
---|
| 90 | global $template; |
---|
| 91 | |
---|
| 92 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.CONCOURS_PATH . 'template/style.css">'); |
---|
| 93 | } |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | set_plugin_data($plugin['id'], $concours) |
---|
| 99 | |
---|
| 100 | ?> |
---|