Changeset 6782 for extensions/ContestResults/main.inc.php
- Timestamp:
- Aug 20, 2010, 12:33:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContestResults/main.inc.php
r6768 r6782 25 25 define('CR_PUBLIC', make_index_url(array('section' => 'contests')) . '/'); 26 26 27 28 // +-----------------------------------------------------------------------+ 29 // Trigger 30 // +-----------------------------------------------------------------------+ 31 add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration 32 add_event_handler('loc_end_section_init', 'CR_section_init'); // Paramètre URL 33 add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page 34 add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Commentaire sur la page image 35 36 $ED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); 37 if($ED['state'] == 'active') add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues 38 39 // Langues 40 load_language('plugin.lang', CR_PATH); 41 27 42 // Gestion du menu 28 43 include(CR_PATH . 'include/cr_menubar.php'); … … 39 54 // Paramètre URL 40 55 function CR_section_init(){ 41 global $tokens, $page; 42 load_language('plugin.lang', CR_PATH); 56 global $tokens, $page, $conf; 57 include(CR_PATH . 'include/functions.php'); 58 43 59 if($tokens[0] == 'contests'){ 44 60 $page['section'] = 'contests'; … … 47 63 $page['contest'] = explode('-', $tokens[1]); 48 64 $page['contest'] = $page['contest'][0]; 49 $page['title'] .= trigger_event('render_CR_content', get_contest_name($page['contest']));65 $page['title'] .= $conf['level_separator'] . trigger_event('render_CR_content', get_contest_name($page['contest'])); 50 66 } 51 67 } … … 54 70 // Contenu du la page 55 71 function CR_index(){ 56 global $template, $page, $conf , $menu;72 global $template, $page, $conf; 57 73 if(isset($page['section']) and $page['section'] == 'contests'){ 58 include(CR_PATH . 'include/functions.php');59 74 if(isset($page['contest'])) 60 75 include(CR_PATH . 'include/cr_page.php'); … … 67 82 function CR_comment_picture(){ 68 83 global $page, $template, $conf; 69 include(CR_PATH . 'include/functions.php');70 84 include(CR_PATH . 'include/cr_comment_picture.php'); 71 85 } 72 86 73 function get_contest_name($contest){74 global $conf;75 $query = pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $contest . ";");76 if(pwg_db_num_rows($query)){77 $result = pwg_db_fetch_assoc($query);78 return $conf['level_separator'] . $result['name'];79 }else{80 return null;81 }82 }83 84 add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration85 add_event_handler('loc_end_section_init', 'CR_section_init'); // Paramètre URL86 add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page87 add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Ajoute le commentaire sur la page image88 add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues89 90 87 ?>
Note: See TracChangeset
for help on using the changeset viewer.