'contests')) . '/'); $ED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); define('CR_ED_STATE', $ED['state']); // +-----------------------------------------------------------------------+ // Triggers // +-----------------------------------------------------------------------+ add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration add_event_handler('loc_end_section_init', 'CR_section_init'); // Paramètre URL add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Commentaire sur la page image if(CR_ED_STATE == 'active') add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues // +-----------------------------------------------------------------------+ // Fonctions // +-----------------------------------------------------------------------+ // Gestion du menu include(CR_PATH . 'include/cr_menubar.php'); // Lien d'administration function CR_admin_menu($menu) { array_push($menu, array( 'NAME' => CR_NAME, 'URL' => CR_ADMIN )); return $menu; } // Paramètre URL function CR_section_init() { global $tokens, $page, $conf; load_language('plugin.lang', CR_PATH); include(CR_PATH . 'include/functions.php'); if ($tokens[0] == 'contests') { // on est dans la section concours $page['section'] = 'contests'; $page['title'] = l10n('Contests'); if (isset($tokens[1]) AND $tokens[1]) { // on est sur la page d'un concours $page['contest'] = explode('-', $tokens[1]); $page['contest'] = $page['contest'][0]; $page['title'] .= $conf['level_separator'] . trigger_event('render_CR_content', get_contest_name($page['contest'])); } } } // Contenu de la page function CR_index() { global $template, $page, $conf; if (isset($page['section']) and $page['section'] == 'contests') { if (isset($page['contest'])) { // on est sur la page d'un concours include(CR_PATH . 'include/cr_page.php'); } else { // on est dans la section concours include(CR_PATH . 'include/cr_main.php'); } } } // Ajoute le commentaire sur la page image function CR_comment_picture() { global $page, $template, $conf; include(CR_PATH . 'include/cr_comment_picture.php'); } ?>