source: extensions/ConcoursPhoto/main.inc.php @ 32553

Last change on this file since 32553 was 32546, checked in by tiico, 4 years ago

Correction + add podium on category (with param)

File size: 3.8 KB
Line 
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 
16if (!defined('PHPWG_ROOT_PATH'))  die('Hacking attempt!');
17
18global $prefixeTable;
19
20define('CONCOURS_VERSION', '11.0.3');       //
21
22
23define('CONCOURS_NAME', 'Concours Photo');
24define('CONCOURS_ROOT', dirname(__FILE__));
25define('CONCOURS_DIR' , basename(dirname(__FILE__)));
26define('CONCOURS_CFG_FILE' , CONCOURS_ROOT.'/'.CONCOURS_DIR.'.dat');
27define('CONCOURS_CFG_FILE1' , PHPWG_PLUGINS_PATH.CONCOURS_DIR.'.dat');
28define('CONCOURS_CFG_DB' , CONCOURS_DIR);
29define('CONCOURS_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/');
30define('CONCOURS_INC_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/include/');
31define('CONCOURS_IMG_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/img/');
32define('CONCOURS_ADMIN_PATH' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/admin/');
33define('CONCOURS_RESULT_FOLDER' , PHPWG_PLUGINS_PATH . CONCOURS_DIR . '/result/');
34
35
36define('CONCOURS_TABLE' , $prefixeTable . 'concours');
37define('CONCOURS_DETAIL_TABLE' , $prefixeTable . 'concours_detail');
38define('CONCOURS_DATA_TABLE' , $prefixeTable . 'concours_data');
39define('CONCOURS_RESULT_TABLE' , $prefixeTable . 'concours_result');
40
41
42
43load_language('plugin.lang', CONCOURS_PATH);
44
45include_once CONCOURS_INC_PATH.'Concours.class.php';
46global $page, $template;
47
48
49$concours = new Concours();
50
51// disable meta to picture page (if param)
52add_event_handler('loc_begin_picture',array(&$concours, 'disable_meta_to_picture'));
53
54
55// Add concours to picture page
56add_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
61add_event_handler('blockmanager_register_blocks', array(&$concours, 'register_blocks') );
62add_event_handler('blockmanager_apply', array(&$concours, 'blockmanager_apply') );
63
64add_event_handler('loc_end_section_init', array(&$concours, 'section_init_concours'));
65
66// Publish result page
67add_event_handler('loc_end_index', array(&$concours, 'index_concours'));
68
69// Global vote page (with all thumbnails)
70add_event_handler('loc_end_index', array(&$concours, 'index_vote_concours'));
71
72
73// Add Global note under thumbnail
74add_event_handler('loc_end_index_thumbnails', array(&$concours, 'thumbnail_note'), 50, 2);
75
76// Add PWG Stuffs
77add_event_handler('get_stuffs_modules', array(&$concours, 'concours_stuffs_module'));
78
79// Add description with contest informations on category
80add_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 * +-----------------------------------------------------------------------+ */
88add_event_handler('loc_end_page_header', 'ConcoursPhoto_css_js');
89
90function 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/*
101add_event_handler('ws_add_methods', 'ConcoursPhoto_ws_add_methods');
102
103function ConcoursPhoto_ws_add_methods($arr) {
104        require_once('ws/ws_functions.inc.php');
105}
106*/
107
108
109set_plugin_data($plugin['id'], $concours)
110
111?>
Note: See TracBrowser for help on using the repository browser.