1 | <?php |
---|
2 | /* |
---|
3 | Plugin Name: ConcoursPhoto |
---|
4 | Version: 11.0.3 |
---|
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 | |
---|
20 | define('CONCOURS_VERSION', '12.0.0'); // |
---|
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 ('loc_end_index', array(&$concours, 'add_contest_desc')); |
---|
81 | //, EVENT_HANDLER_PRIORITY_NEUTRAL, 2); |
---|
82 | |
---|
83 | |
---|
84 | |
---|
85 | /* +-----------------------------------------------------------------------+ |
---|
86 | * | CSS/JS Style | |
---|
87 | * +-----------------------------------------------------------------------+ */ |
---|
88 | add_event_handler('loc_end_page_header', 'ConcoursPhoto_css_js'); |
---|
89 | |
---|
90 | function ConcoursPhoto_css_js() { |
---|
91 | global $template; |
---|
92 | |
---|
93 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.CONCOURS_PATH . 'template/style.css">'); |
---|
94 | $template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.CONCOURS_PATH . 'template/style_podium_cat.css">'); |
---|
95 | } |
---|
96 | |
---|
97 | /* +-----------------------------------------------------------------------+ |
---|
98 | * | AJAX Methods | |
---|
99 | * +-----------------------------------------------------------------------+ */ |
---|
100 | /* |
---|
101 | add_event_handler('ws_add_methods', 'ConcoursPhoto_ws_add_methods'); |
---|
102 | |
---|
103 | function ConcoursPhoto_ws_add_methods($arr) { |
---|
104 | require_once('ws/ws_functions.inc.php'); |
---|
105 | } |
---|
106 | */ |
---|
107 | |
---|
108 | |
---|
109 | set_plugin_data($plugin['id'], $concours) |
---|
110 | |
---|
111 | ?> |
---|