Changeset 9200 for extensions/ContestResults
- Timestamp:
- Feb 13, 2011, 11:12:58 AM (14 years ago)
- Location:
- extensions/ContestResults
- Files:
-
- 1 added
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContestResults/admin/admin.php
r6768 r9200 8 8 // +-----------------------------------------------------------------------+ 9 9 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); 10 if(!isset($_GET['tab'])) 11 $page['tab'] = 'manage'; 12 else 13 $page['tab'] = $_GET['tab']; 10 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'manage'; 14 11 15 12 $tabsheet = new tabsheet(); 16 $tabsheet->add('manage', l10n('CR_manage_tab'), CR_ADMIN . '&tab=manage'); // Gestion des concours 17 $tabsheet->add('new', l10n('CR_new_tab'), CR_ADMIN . '&tab=new'); // Ajouter un nouveau concours 18 if(isset($_GET['contest_id'])) // Editer le concours | Résultats du concours 19 $tabsheet->add($_GET['tab'], l10n('CR_'.$_GET['tab'].'_tab'), CR_ADMIN . '&tab=' . $_GET['tab'] . '&contest_id=' . $_GET['contest_id']); 20 $tabsheet->add('config', l10n('Configuration'), CR_ADMIN . '&tab=config'); // Configuration 13 $tabsheet->add('manage', l10n('CR_manage_tab'), CR_ADMIN . '&tab=manage'); // Gestion des concours 14 $tabsheet->add('new', l10n('CR_new_tab'), CR_ADMIN . '&tab=new'); // Ajouter un nouveau concours 15 if (isset($_GET['contest_id'])) { // Editer le concours | Résultats du concours 16 $tabsheet->add($page['tab'], l10n('CR_'.$page['tab'].'_tab'), CR_ADMIN . '&tab=' . $page['tab'] . '&contest_id=' . $_GET['contest_id']); 17 } 18 $tabsheet->add('config', l10n('Configuration'), CR_ADMIN . '&tab=config'); // Configuration 21 19 $tabsheet->select($page['tab']); 22 20 $tabsheet->assign(); … … 27 25 $template->assign('CR_VERSION', CR_NAME . ' ' . CR_VERSION); 28 26 $template->assign('CR_PATH', CR_PATH); 29 if ($page['tab'] == 'edit') $page['tab'] = 'new';// L'édition se fait sur la page de création27 if ($page['tab'] == 'edit') { $page['tab'] = 'new'; } // L'édition se fait sur la page de création 30 28 include(CR_PATH.'admin/'.$page['tab'].'.php'); 31 29 ?> -
extensions/ContestResults/admin/config.php
r6782 r9200 3 3 4 4 // +-----------------------------------------------------------------------+ 5 // Modification de la configuration5 // Modification de la configuration 6 6 // +-----------------------------------------------------------------------+ 7 if (isset($_POST['config_submit'])){7 if (isset($_POST['config_submit'])) { 8 8 $user_config = array( 9 9 'menubar_mode' => array( 10 10 'link' => (isset($_POST['menubar_mode_link'])) ? 1 : 0, 11 'block' => (isset($_POST['menubar_mode_block'])) ? 1 : 0 11 'block' => (isset($_POST['menubar_mode_block'])) ? 1 : 0, 12 12 ), 13 13 'menubar_link' => array( 14 14 'menu' => (isset($_POST['menubar_link_menu'])) ? 1 : 0, 15 'specials' => (isset($_POST['menubar_link_specials'])) ? 1 : 0 15 'specials' => (isset($_POST['menubar_link_specials'])) ? 1 : 0, 16 16 ), 17 17 'menubar_block' => array( 18 'number' => $_POST['menubar_block_number'] 19 ) 18 'number' => $_POST['menubar_block_number'], 19 ), 20 20 ); 21 21 22 $query = "UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';"; 23 pwg_query($query); 22 pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($user_config) . "' WHERE `param` = 'ContestResults';"); 24 23 redirect(CR_ADMIN . '&tab=config'); 25 24 } 26 25 27 26 // +-----------------------------------------------------------------------+ 28 // Définition des variables template27 // Définition des variables template 29 28 // +-----------------------------------------------------------------------+ 30 29 $conf['ContestResults'] = unserialize($conf['ContestResults']); -
extensions/ContestResults/admin/get_tn.php
r6782 r9200 4 4 include_once(PHPWG_ROOT_PATH.'include/common.inc.php'); 5 5 6 $ query ="SELECT id, name, file, path, tn_ext6 $image = pwg_query("SELECT id, name, file, path, tn_ext 7 7 FROM " . IMAGES_TABLE . " 8 WHERE id = " . pwg_db_real_escape_string($_GET['image_id']) . ";"; 9 $image = pwg_query($query); 8 WHERE id = " . pwg_db_real_escape_string($_GET['image_id']) . ";"); 10 9 11 if (!pwg_db_num_rows($image)){10 if (!pwg_db_num_rows($image)) { 12 11 $themeconf = $template->get_template_vars('themeconf'); 13 12 $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 14 13 $data['IMAGE_NAME'] = 'N/A'; 15 }else{ 14 15 } else { 16 16 $image = pwg_db_fetch_assoc($image); 17 17 $data['TN_SRC'] = get_thumbnail_url($image); … … 20 20 21 21 echo "<img src='" . str_replace('../../.', '', $data['TN_SRC']) . "'/><br>" . $data['IMAGE_NAME']; 22 23 22 ?> -
extensions/ContestResults/admin/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/admin/manage.php
r6768 r9200 3 3 4 4 // +-----------------------------------------------------------------------+ 5 // Suppression d'un concours5 // Suppression d'un concours 6 6 // +-----------------------------------------------------------------------+ 7 if (isset($_GET['delete'])){8 pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete '] . ';');9 pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete '] . ';');7 if (isset($_GET['delete_contest'])) { 8 pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete_contest'] . ';'); 9 pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete_contest'] . ';'); 10 10 redirect(CR_ADMIN); 11 11 } 12 12 13 13 // +-----------------------------------------------------------------------+ 14 // Affichage des concours14 // Affichage des concours 15 15 // +-----------------------------------------------------------------------+ 16 foreach (array('pending','finished') AS $status){17 $ query ="SELECT id, name, visible, date_begin, date_end, logo16 foreach (array('pending','finished') AS $status) { 17 $result = pwg_query("SELECT id, name, visible, date_begin, date_end, logo 18 18 FROM " . CR_TABLE_1 . " 19 19 WHERE status = '" . $status . "' 20 ORDER BY date_begin DESC;"; 21 $result = pwg_query($query); 20 ORDER BY date_begin DESC;"); 22 21 23 while ($contest = pwg_db_fetch_assoc($result)){22 while ($contest = pwg_db_fetch_assoc($result)) { 24 23 $template->append('contests_'.$status, array( 25 24 'NAME' => trigger_event('render_CR_content', $contest['name']), … … 28 27 'DATE_END' => format_date($contest['date_end']), 29 28 'LOGO' => $contest['logo'], 30 'U_RESULTS' => CR_ADMIN . '& tab=results&contest_id=' . $contest['id'],31 'U_EDIT' => CR_ADMIN . '& tab=edit&contest_id=' . $contest['id'],32 'U_DELETE' => CR_ADMIN . '& delete=' . $contest['id'],29 'U_RESULTS' => CR_ADMIN . '&tab=results&contest_id=' . $contest['id'], 30 'U_EDIT' => CR_ADMIN . '&tab=edit&contest_id=' . $contest['id'], 31 'U_DELETE' => CR_ADMIN . '&delete_contest=' . $contest['id'], 33 32 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 34 33 )); -
extensions/ContestResults/admin/new.php
r6782 r9200 6 6 7 7 // +-----------------------------------------------------------------------+ 8 // Ajout ou modification d'un concours8 // Ajout ou modification d'un concours 9 9 // +-----------------------------------------------------------------------+ 10 if(isset($_POST['new_submit'])){ 11 // Pour les quatre zones de texte crée un tableau définissant le mode d'affichage 12 foreach($textareas AS $key){ 13 $_POST[$key.'_display']['pending'] = (isset($_POST[$key.'_pending'])) ? true : false; 14 $_POST[$key.'_display']['finished'] = (isset($_POST[$key.'_finished'])) ? true : false; 15 $_POST[$key.'_display'] = serialize($_POST[$key.'_display']); 16 } 17 10 if (isset($_POST['new_submit'])) { 18 11 // Modification d'un concours 19 if (isset($_POST['contest_id'])){20 $query ="UPDATE " . CR_TABLE_1 . " SET12 if (isset($_GET['contest_id'])) { 13 pwg_query("UPDATE " . CR_TABLE_1 . " SET 21 14 `name` = '" . $_POST['name'] ."', 22 15 `status` = '" . $_POST['status'] ."', … … 28 21 `summary` = '" . $_POST['summary'] ."', 29 22 `presentation` = '" . $_POST['presentation'] ."', 30 `presentation_display` = '" . $_POST['presentation_display'] ."',31 23 `rules` = '" . $_POST['rules'] ."', 32 `rules_display` = '" . $_POST['rules_display'] ."',33 24 `prices` = '" . $_POST['prices'] ."', 34 `prices_display` = '" . $_POST['prices_display'] ."', 35 `final` = '" . $_POST['final'] ."', 36 `final_display` = '" . $_POST['final_display'] ."' 37 WHERE `id` = " . $_POST['contest_id'] .";"; 25 `final` = '" . $_POST['final'] ."' 26 WHERE `id` = " . $_GET['contest_id'] .";"); 38 27 39 pwg_query($query); 40 redirect(CR_ADMIN); 28 // redirige vers la page du concours si on en viens 29 if (isset($_GET['redirect']) AND $_GET['redirect'] == 'page') { 30 redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_CR_content', $_POST['name']))); 31 } else { 32 redirect(CR_ADMIN); 33 } 41 34 42 35 // Ajout d'un concours 43 } else{44 $query ="INSERT INTO " . CR_TABLE_1 . "36 } else { 37 pwg_query("INSERT INTO " . CR_TABLE_1 . " 45 38 ( 46 39 name, … … 53 46 summary, 54 47 presentation, 55 presentation_display,56 48 rules, 57 rules_display,58 49 prices, 59 prices_display, 60 final, 61 final_display 50 final 62 51 ) 63 52 VALUES( … … 71 60 '" . $_POST['summary'] ."', 72 61 '" . $_POST['presentation'] ."', 73 '" . $_POST['presentation_display'] ."',74 62 '" . $_POST['rules'] ."', 75 '" . $_POST['rules_display'] ."',76 63 '" . $_POST['prices'] ."', 77 '" . $_POST['prices_display'] ."', 78 '" . $_POST['final'] ."', 79 '" . $_POST['final_display'] ."' 80 );"; 81 82 pwg_query($query); 64 '" . $_POST['final'] ."' 65 );"); 83 66 redirect(CR_ADMIN); 84 67 } … … 87 70 88 71 // +-----------------------------------------------------------------------+ 89 // Définition des variables template72 // Définition des variables template 90 73 // +-----------------------------------------------------------------------+ 91 74 // Edition d'un concours 92 if (isset($_GET['contest_id'])){75 if (isset($_GET['contest_id'])) { 93 76 $query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";"; 94 77 $contest = pwg_db_fetch_assoc(pwg_query($query)); … … 106 89 )); 107 90 108 foreach($textareas AS $key){ 109 $contest[$key.'_display'] = unserialize($contest[$key.'_display']); 110 if($contest[$key.'_display']['pending']) $template->assign(strtoupper($key).'_PENDING', true); 111 if($contest[$key.'_display']['finished']) $template->assign(strtoupper($key).'_FINISHED', true); 91 foreach ($textareas AS $key) { 112 92 $template->assign(strtoupper($key), $contest[$key]); 113 93 } 114 94 115 95 // Ajout d'un concours 116 } else{96 } else { 117 97 $template->assign(array( 118 98 'NAME' => null, … … 126 106 )); 127 107 128 foreach($textareas AS $key){ 129 $template->assign(array( 130 strtoupper($key).'_PENDING' => true, 131 strtoupper($key).'_FINISHED' => true, 132 strtoupper($key) => null, 133 )); 108 foreach ($textareas AS $key) { 109 $template->assign(strtoupper($key), null); 134 110 } 135 111 } -
extensions/ContestResults/admin/results.php
r6782 r9200 3 3 4 4 // +-----------------------------------------------------------------------+ 5 // Modification des résultats5 // Modification des résultats 6 6 // +-----------------------------------------------------------------------+ 7 if(isset($_POST['results_modify'])){ 8 $query = "DELETE FROM " . CR_TABLE_2 . " WHERE `contest_id` = " . $_POST['contest_id'] .";"; 9 pwg_query($query); 7 if (isset($_POST['results_modify'])) { 8 pwg_query("DELETE FROM " . CR_TABLE_2 . " WHERE `contest_id` = " . $_GET['contest_id'] .";"); 10 9 11 foreach($_POST['results'] AS $i => $data){ 12 $query = "INSERT INTO " . CR_TABLE_2 . "(image_id, contest_id, rank, comment, author) 10 foreach ($_POST['results'] AS $i => $data) { 11 pwg_query("INSERT INTO " . CR_TABLE_2 . " 12 ( 13 image_id, 14 contest_id, 15 rank, 16 comment, 17 author 18 ) 13 19 VALUES( 14 20 '" . $data['image_id'] ."', 15 '" . $_ POST['contest_id'] ."',21 '" . $_GET['contest_id'] ."', 16 22 '" . $data['rank'] ."', 17 23 '" . $data['comment'] ."', 18 24 '" . $data['author'] . "' 19 );"; 20 pwg_query($query); 25 );"); 21 26 } 22 27 23 redirect(CR_ADMIN . '& tab=results&contest_id=' . $_POST['contest_id']);28 redirect(CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id']); 24 29 } 25 30 26 31 // +-----------------------------------------------------------------------+ 27 // 32 // Affichage des résultats 28 33 // +-----------------------------------------------------------------------+ 34 // Nom du concours 29 35 $query = "SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";"; 30 36 $contest = pwg_db_fetch_assoc(pwg_query($query)); 37 31 38 $template->assign(array( 32 39 'NAME' => trigger_event('render_CR_content', $contest['name']), … … 34 41 )); 35 42 36 $query = "SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;"; 37 $results = pwg_query( $query);43 // Résultats 44 $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;"); 38 45 39 while ($result = pwg_db_fetch_assoc($results)){46 while ($result = pwg_db_fetch_assoc($results)) { 40 47 $data = array( 41 48 'RANK' => $result['rank'], … … 43 50 'AUTHOR' => $result['author'], 44 51 'COMMENT' => $result['comment'], 45 'U_DELETE' => CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id'] . '&delete_result=' . $result['image_id'],46 52 ); 47 53 48 54 // Infos de l'image 49 $ query ="SELECT id, name, file, path, tn_ext55 $image = pwg_query("SELECT id, name, file, path, tn_ext 50 56 FROM " . IMAGES_TABLE . " 51 WHERE id = " . $result['image_id'] . ";"; 52 $image = pwg_query($query); 57 WHERE id = " . $result['image_id'] . ";"); 53 58 54 if (!pwg_db_num_rows($image)){59 if (!pwg_db_num_rows($image)) { 55 60 $themeconf = $template->get_template_vars('themeconf'); 56 61 $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 57 62 $data['IMAGE_NAME'] = 'N/A'; 58 63 $page['errors'][] = l10n_dec('CR_id_unknown %d', 'CR_id_unknown %d', $result['image_id']); 59 }else{ 64 65 } else { 60 66 $image = pwg_db_fetch_assoc($image); 61 67 $data['TN_SRC'] = get_thumbnail_url($image); -
extensions/ContestResults/admin/template/config.tpl
r6782 r9200 3 3 {html_head} 4 4 <link rel="stylesheet" type="text/css" href="{$CR_PATH}admin/template/style.css"> 5 <style >5 <style type="text/css"> 6 6 tr td:first-child {ldelim} 7 7 max-width:300px; … … 55 55 <tr> 56 56 <td><span class="title">{'CR_menubar_block_number'|@translate}</span></td> 57 <td> 58 <input type="text" size="2" maxlength="2" name="menubar_block_number" value="{$BLOCK_NUMBER}"/> 59 </td> 57 <td><input type="text" size="2" maxlength="2" name="menubar_block_number" value="{$BLOCK_NUMBER}"/></td> 60 58 </tr> 61 59 </table> -
extensions/ContestResults/admin/template/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/admin/template/new.tpl
r6782 r9200 30 30 31 31 <div class="titrePage"> 32 <h2>{if isset($NAME)}{'CR_edit_tab'|@translate|cat:' : '|cat:$NAME}{else}{'CR_new_tab'|@translate}{/if}</h2> 32 <h2> 33 {if isset($NAME)} 34 {'CR_edit_tab'|@translate|cat:' : '|cat:$NAME} 35 {else} 36 {'CR_new_tab'|@translate} 37 {/if} 38 </h2> 33 39 </div> 34 40 … … 36 42 <fieldset> 37 43 <legend>{'Configuration'|@translate}</legend> 44 38 45 <table> 39 46 <tr> 40 <td><span class="title cluetip" title="{'CR_title'|@translate}|{'CR_help_title'|@translate} {'CR_help_lang'|@translate}">{'CR_title'|@translate}</span></td>47 <td><span class="title cluetip" title="{'CR_title'|@translate}|{'CR_help_title'|@translate}">{'CR_title'|@translate}</span></td> 41 48 <td colspan="3"><input type="text" size="65" maxlength="255" name="name" value="{$NAME}"/></td> 42 49 </tr> … … 45 52 46 53 <tr> 47 <td><span class="title cluetip" title="{'CR_status'|@translate}|{'CR_help_status'|@translate}"> 48 {'CR_status'|@translate} 49 </span></td> 54 <td><span class="title cluetip" title="{'CR_status'|@translate}|{'CR_help_status'|@translate}">{'CR_status'|@translate}</span></td> 50 55 <td> 51 56 <label><input type="radio" name="status" value="pending" {if $STATUS == 'pending'}checked="checked"{/if}> {'CR_pending'|@translate}</label> 52 57 <label><input type="radio" name="status" value="finished" {if $STATUS == 'finished'}checked="checked"{/if}> {'CR_finished'|@translate}</label> 53 58 </td> 54 <td><span class="title cluetip" title="{'CR_visible'|@translate}|{'CR_help_visible'|@translate}"> 55 {'CR_visible'|@translate} 56 </span></td> 59 <td><span class="title cluetip" title="{'CR_visible'|@translate}|{'CR_help_visible'|@translate}">{'CR_visible'|@translate}</span></td> 57 60 <td> 58 61 <label><input type="radio" name="visible" value="1" {if $VISIBLE == 1}checked="checked"{/if}> {'Yes'|@translate}</label> … … 71 74 <tr> 72 75 <td><span class="title">{'CR_logo'|@translate}</span></td> 73 <td colspan="3"><input type="text" s ize="65" maxlength="255" value="{$LOGO}" name="logo"/></td>76 <td colspan="3"><input type="text" style="width:100%;" maxlength="255" value="{$LOGO}" name="logo"/></td> 74 77 </tr> 75 78 <tr> 76 79 <td><span class="title">{'CR_banner'|@translate}</span></td> 77 <td colspan="3"><input type="text" s ize="65" maxlength="255" value="{$BANNER}" name="banner"/></td>80 <td colspan="3"><input type="text" style="width:100%;" maxlength="255" value="{$BANNER}" name="banner"/></td> 78 81 </tr> 79 82 … … 81 84 82 85 <tr> 83 <td><span class="title cluetip" title="{'CR_summary'|@translate}|{'CR_help_summary'|@translate}{'CR_help_lang'|@translate}"> 84 {'CR_summary'|@translate} 85 </span></td> 86 <td colspan="3"><textarea name="summary" id ="textarea" rows="4" cols="50">{$SUMMARY}</textarea></td> 86 <td><span class="title cluetip" title="{'CR_summary'|@translate}|{'CR_help_summary'|@translate}">{'CR_summary'|@translate}</span></td> 87 <td colspan="3"><textarea name="summary" id ="textarea" rows="4" style="width:100%;">{$SUMMARY}</textarea></td> 87 88 </tr> 88 89 </table> 89 90 </fieldset> 90 91 91 <div class="textareas"><span class="title cluetip" title="{'CR_textareas'|@translate}|{'CR_help_textareas'|@translate}{'CR_help_lang'|@translate}">92 {'CR_textareas'|@translate}93 </span></div>94 95 92 <fieldset> 96 <legend>{'CR_presentation'|@translate}</legend> 97 <div align="center"> 98 <textarea name="presentation" id ="textarea" rows="4" cols="50" style="width:70%;">{$PRESENTATION}</textarea> 99 <br/> 100 {'CR_visibility'|@translate} : 101 <label><input type="checkbox" name="presentation_pending" value="true" {if isset($PRESENTATION_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label> 102 <label><input type="checkbox" name="presentation_finished" value="true" {if isset($PRESENTATION_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label> 103 </div> 93 <legend><span class="title cluetip" title="{'CR_textareas'|@translate}|{'CR_help_textareas'|@translate}">{'CR_textareas'|@translate}</span></legend> 94 95 <table> 96 <tr> 97 <td><span class="title">{'CR_presentation'|@translate}</span></td> 98 <td style="width:75%;"><textarea name="presentation" id ="textarea" rows="4" style="width:100%;">{$PRESENTATION}</textarea></td> 99 </tr> 100 101 <tr><td colspan="2"><br/></td></tr> 102 103 <tr> 104 <td><span class="title">{'CR_rules'|@translate}</span></td> 105 <td><textarea name="rules" id ="textarea" rows="4" style="width:100%;">{$RULES}</textarea></td> 106 </tr> 107 108 <tr><td colspan="2"><br/></td></tr> 109 110 <tr> 111 <td><span class="title">{'CR_prices'|@translate}</span></td> 112 <td><textarea name="prices" id ="textarea" rows="4" style="width:100%;">{$PRICES}</textarea></td> 113 </tr> 114 115 <tr><td colspan="2"><br/></td></tr> 116 117 <tr> 118 <td><span class="title">{'CR_final'|@translate}</span></td> 119 <td><textarea name="final" id ="textarea" rows="4" style="width:100%;">{$FINAL}</textarea></td> 120 </tr> 121 </table> 104 122 </fieldset> 105 123 106 <fieldset>107 <legend>{'CR_rules'|@translate}</legend>108 <div align="center">109 <textarea name="rules" id ="textarea" rows="4" cols="50" style="width:70%;">{$RULES}</textarea>110 <br/>111 {'CR_visibility'|@translate} :112 <label><input type="checkbox" name="rules_pending" value="true" {if isset($RULES_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>113 <label><input type="checkbox" name="rules_finished" value="true" {if isset($RULES_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>114 </div>115 </fieldset>116 117 <fieldset>118 <legend>{'CR_prices'|@translate}</legend>119 <div align="center">120 <textarea name="prices" id ="textarea" rows="4" cols="50" style="width:70%;">{$PRICES}</textarea>121 <br/>122 {'CR_visibility'|@translate} :123 <label><input type="checkbox" name="prices_pending" value="true" {if isset($PRICES_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>124 <label><input type="checkbox" name="prices_finished" value="true" {if isset($PRICES_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>125 </div>126 </fieldset>127 128 <fieldset>129 <legend>{'CR_final'|@translate}</legend>130 <div align="center">131 <textarea name="final" id ="textarea" rows="4" cols="50" style="width:70%;">{$FINAL}</textarea>132 <br/>133 {'CR_visibility'|@translate} :134 <label><input type="checkbox" name="final_pending" value="true" {if isset($FINAL_PENDING)}checked="checked"{/if}> {'CR_pending'|@translate}</label>135 <label><input type="checkbox" name="final_finished" value="true" {if isset($FINAL_FINISHED)}checked="checked"{/if}> {'CR_finished'|@translate}</label>136 </div>137 </fieldset>138 139 {if isset($ID)}<input type="hidden" name="contest_id" value="{$ID}"/>{/if}140 124 <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="new_submit"/></p> 141 125 </form> -
extensions/ContestResults/admin/template/results.tpl
r6782 r9200 55 55 } 56 56 57 // SUPPRIME UN CHAMP DE RESULTAT (champs non enregistrés uniquement)57 // SUPPRIME UN CHAMP DE RESULTAT 58 58 function DeleteResultField(k){ldelim} 59 59 var result = document.getElementById('result_'+k); … … 107 107 108 108 <div class="titrePage"> 109 <h2> 110 {'CR_results_tab'|@translate|cat:' : '|cat:$NAME} 111 <span class="cluetip" title="{'CR_results_tab'|@translate}|{'CR_help_results'|@translate}{'CR_help_lang'|@translate}"></span> 112 </h2> 109 <h2><span class="cluetip" title="{'CR_results_tab'|@translate}|{'CR_help_results'|@translate}">{'CR_results_tab'|@translate|cat:' : '|cat:$NAME} </span></h2> 113 110 </div> 114 111 … … 126 123 </li> 127 124 </ul> 125 128 126 <p> 129 127 <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}"> 130 128 {'CR_image_no'|@translate} <input type="text" size="6" name="results[{$i}][image_id]" value="{$result.IMAGE_ID}" onkeyup="UpdatePreview({$i}, this);"/> 129 131 130 <span id="preview-{$i}"> 132 131 <span class="vtip" title="<img src='{$result.TN_SRC}'/><br>{$result.IMAGE_NAME}"> … … 134 133 </span> 135 134 </span> 135 136 136 {'CR_author'|@translate} : <input type="text" name="results[{$i}][author]" value="{$result.AUTHOR}"/> 137 137 <textarea class="result_comment" name="results[{$i}][comment]">{$result.COMMENT}</textarea> … … 147 147 148 148 <p> 149 <input type="hidden" name="contest_id" value="{$CONTEST_ID}"/>150 149 <input class="submit" type="submit" value="{'Submit'|@translate}" name="results_modify"/> 151 150 <span id="AddLink"><input class="submit" type="submit" onclick="CreateResultField({$i}{if !isset($results)}, true{/if});return false;" value="{'CR_addfield'|@translate}"/></a> -
extensions/ContestResults/changelog.txt
r7974 r9200 1 ContestResults Changelog : 1 1.2 2 - Code revision 3 - Add Letton (lv_LV) language, thanks to Aivars Baldone 4 - Delete display options 5 - Fix languages bugs 6 - Improve public appearence 7 2 8 1.1 3 9 - Add menu block/links + configuration -
extensions/ContestResults/include/cr_comment_picture.php
r6782 r9200 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 // +-----------------------------------------------------------------------+5 4 // Requète simple pour savoir si l'image a participé à des concours 6 // +-----------------------------------------------------------------------+ 7 $query = "SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";"; 8 $results = pwg_query($query); 5 $participation = pwg_query("SELECT image_id FROM " . CR_TABLE_2 . " WHERE image_id = " . $page['image_id'] . ";"); 9 6 10 if(pwg_db_num_rows($ results)){11 $ query ="SELECT7 if(pwg_db_num_rows($participation)){ 8 $results = pwg_query("SELECT 12 9 i.rank, 13 10 i.comment, … … 18 15 ON i.contest_id = c.id 19 16 WHERE i.image_id = " . $page['image_id'] . " 20 ORDER BY c.date_begin DESC;"; 21 $results = pwg_query($query); 17 ORDER BY c.date_begin DESC;"); 22 18 23 19 // Gère plusieurs participations 24 20 $comment = null; 25 while( $result = pwg_db_fetch_assoc($results)){21 while( $result = pwg_db_fetch_assoc($results)) { 26 22 // Rang amélioré 27 if($result['rank'] <= 3) $result['rank'] = l10n('CR_order_'.$result['rank']); 28 else $result['rank'] .= l10n('CR_order_sup'); 23 $result['rank'] = ($result['rank'] <= 3) ? l10n('CR_order_'.$result['rank']) : $result['rank'] . l10n('CR_order_sup'); 29 24 30 25 // Lien vers le concours … … 33 28 34 29 // Ajoute le commentaire après la description 35 $comment .= '<div style="border:1px solid #404040;padding:10px;margin:10px 25%"> 36 <b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b> 37 :: <u>' . $result['rank'] . '</u> 30 $comment .= '<div class="CR_comment"> 31 <b><a href="' . $result['contest_link'] .'">' . $result['contest_name'] . '</a></b> :: <u>' . $result['rank'] . ' ' . l10n('CR_place') . '</u> 38 32 <p>' . trigger_event('render_CR_content', $result['comment']) . '</p> 39 33 </div>'; … … 42 36 $template->append('related_categories', '<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>' . $conf['level_separator'] . '<a href="' . $result['contest_link'] . '">' . $result['contest_name'] . '</a>'); 43 37 } 38 39 // style utilisé pour les blocs des concours 40 $css = '<style type="text/css"> 41 .CR_comment { 42 border:1px solid #404040; 43 padding:10px; 44 margin:10px 20%; 45 } 46 </style>'; 44 47 45 48 $template->assign('COMMENT_IMG', $template->get_template_vars('COMMENT_IMG') . $comment); 49 $template->assign('PLUGIN_PICTURE_BEFORE', $template->get_template_vars('PLUGIN_PICTURE_BEFORE') . $css); 46 50 } 47 48 51 ?> -
extensions/ContestResults/include/cr_main.php
r6768 r9200 3 3 4 4 // +-----------------------------------------------------------------------+ 5 // Liste des concours5 // Liste des concours 6 6 // +-----------------------------------------------------------------------+ 7 $query = "SELECT id, name, visible, date_begin, date_end, status, logo, summary FROM " . CR_TABLE_1 . " ORDER BY date_begin DESC;"; 8 $contests = pwg_query($query); 7 $contests = pwg_query("SELECT 8 id, 9 name, 10 visible, 11 date_begin, 12 date_end, 13 status, 14 logo, 15 summary 16 FROM " . CR_TABLE_1 . " 17 ORDER BY date_begin DESC;"); 9 18 10 while ($contest = pwg_db_fetch_assoc($contests)){11 if ($contest['visible'] OR is_admin()){19 while ($contest = pwg_db_fetch_assoc($contests)) { 20 if ($contest['visible'] OR is_admin()) { 12 21 // infos sur le concours 13 22 $item = array( … … 19 28 'DATE_BEGIN' => format_date($contest['date_begin']), 20 29 'LOGO' => $contest['logo'], 21 'SUMMARY' => trigger_event('render_CR_content', $contest['summary']),30 'SUMMARY' => CR_cut_string(trigger_event('render_CR_content', $contest['summary']), 350), 22 31 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 23 32 ); 24 33 25 34 // podium si terminé 26 if ($contest['status'] == 'finished'){27 $ query ="SELECT35 if ($contest['status'] == 'finished') { 36 $results = pwg_query("SELECT 28 37 i.id, 29 38 i.name, … … 38 47 WHERE c.contest_id = " . $contest['id'] . " 39 48 ORDER BY c.rank ASC 40 LIMIT 3 OFFSET 0;"; 41 $results = pwg_query($query); 49 LIMIT 3 OFFSET 0;"); 42 50 43 while ($result = pwg_db_fetch_assoc($results)){51 while ($result = pwg_db_fetch_assoc($results)) { 44 52 $item['RESULTS'][$result['rank']] = array( 45 53 'RANK' => $result['rank'], … … 50 58 } 51 59 52 $template->append('contests _'.$contest['status'], $item);60 $template->append('contests', $item); 53 61 } 54 62 } -
extensions/ContestResults/include/cr_menubar.php
r6768 r9200 3 3 4 4 // +-----------------------------------------------------------------------+ 5 // Trigger 5 // Triggers 6 6 // +-----------------------------------------------------------------------+ 7 global $conf;8 7 $config = unserialize($conf['ContestResults']); 9 if ($config['menubar_mode']['block'])8 if ($config['menubar_mode']['block']) { 10 9 add_event_handler('blockmanager_register_blocks', 'CR_register_menubar_blocks'); 10 } 11 11 add_event_handler('blockmanager_apply', 'CR_menubar_apply'); 12 12 … … 14 14 // Ajouter un block 15 15 // +-----------------------------------------------------------------------+ 16 function CR_register_menubar_blocks($menu_ref_arr) {16 function CR_register_menubar_blocks($menu_ref_arr) { 17 17 $menu = &$menu_ref_arr[0]; 18 if ($menu->get_id() != 'menubar') return;18 if ($menu->get_id() != 'menubar') { return; } 19 19 $menu->register_block(new RegisteredBlock('mbContestResults', l10n('Contests'), 'ContestResults')); 20 20 } 21 21 22 22 // +-----------------------------------------------------------------------+ 23 // Remplis les block23 // Remplis les block 24 24 // +-----------------------------------------------------------------------+ 25 function CR_menubar_apply($menu_ref_arr) {25 function CR_menubar_apply($menu_ref_arr) { 26 26 global $template, $conf; 27 27 $config = unserialize($conf['ContestResults']); 28 28 $menu = &$menu_ref_arr[0]; 29 29 30 // Block Contest 31 if (($block = $menu->get_block('mbContestResults')) != null){30 // Block Contest - un nouveau bloc dans le menu 31 if (($block = $menu->get_block('mbContestResults')) != null) { 32 32 $data = array(); 33 34 // on récupère les concours 35 $contests = pwg_query("SELECT 36 id, 37 name, 38 visible, 39 status, 40 date_begin, 41 date_end 42 FROM " . CR_TABLE_1 . " 43 ORDER BY date_begin DESC;"); 33 44 34 $query = "SELECT id, name, visible, status, date_begin, date_end 35 FROM " . CR_TABLE_1 . " 36 ORDER BY date_begin DESC 37 LIMIT " . $config['menubar_block']['number'] . " OFFSET 0;"; 38 $result = pwg_query($query); 39 40 while($contest = pwg_db_fetch_assoc($result)){ 41 if($contest['visible'] OR is_admin()){ 45 $m = 0; // copteur pour limiter le nombre de concours affichés 46 while($contest = pwg_db_fetch_assoc($contests)){ 47 if (($contest['visible'] OR is_admin()) AND $m < $config['menubar_block']['number']) { 42 48 array_push($data, array( 43 49 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 44 50 'LABEL' => trigger_event('render_CR_content', $contest['name']), 45 51 'DATE' => format_date($contest['date_begin']) . ' - ' . format_date($contest['date_end']), 46 'STATUS' => $contest['status'] 52 'STATUS' => $contest['status'], 53 'VISIBLE' => $contest['visible'] 47 54 )); 48 55 } 56 $m++; 49 57 } 50 58 51 if(!empty($data)){ 59 // Finalement on rempli le bloc avec les concours 60 if (!empty($data)) { 52 61 $template->set_template_dir(CR_PATH . 'template/'); 53 62 $block->set_title('<a href="' . CR_PUBLIC . '">' . l10n('Contests') . '</a>'); … … 57 66 } 58 67 59 // Block Menu 60 if ($config['menubar_mode']['link'] AND $config['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null){68 // Block Menu - ajout d'un lien dans le bloc Menu 69 if ($config['menubar_mode']['link'] AND $config['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null) { 61 70 array_push($block->data, array( 62 71 'URL' => CR_PUBLIC, … … 66 75 } 67 76 68 // Block Specials 77 // Block Specials - ajout d'un lien dans le bloc Specials 69 78 if($config['menubar_mode']['link'] AND $config['menubar_link']['specials'] AND ($block = $menu->get_block('mbSpecials')) != null){ 70 79 array_push($block->data, array( -
extensions/ContestResults/include/cr_page.php
r6782 r9200 3 3 4 4 // +-----------------------------------------------------------------------+ 5 // Page d'un concours5 // Page d'un concours 6 6 // +-----------------------------------------------------------------------+ 7 if (is_admin()){8 $template->assign('U_EDIT', CR_ADMIN . '& tab=edit&contest_id=' . $page['contest']);9 $template->assign('U_RESULTS', CR_ADMIN . '& tab=results&contest_id=' . $page['contest']);7 if (is_admin()) { 8 $template->assign('U_EDIT', CR_ADMIN . '&tab=edit&contest_id=' . $page['contest'] . '&redirect=page'); 9 $template->assign('U_RESULTS', CR_ADMIN . '&tab=results&contest_id=' . $page['contest']); 10 10 } 11 11 12 12 // Infos du concours 13 $query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";"; 14 $results = pwg_query($query); 15 $contest = pwg_db_fetch_assoc($results); 13 $contest = pwg_query("SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";"); 16 14 17 if(pwg_db_num_rows($results) AND ($contest['visible'] OR is_admin())){ 15 if (pwg_db_num_rows($contest)) { 16 $contest = pwg_db_fetch_assoc($contest); 17 18 // Concours non-publique 19 if (!$contest['visible']) { 20 check_status(ACCESS_ADMINISTRATOR); 21 } 22 18 23 // Paramètres généraux 19 24 $template->assign(array( … … 29 34 )); 30 35 31 // Quatre zones texte 32 foreach(array('presentation','rules','prices','final') AS $key){ 33 $contest[$key.'_display'] = unserialize($contest[$key.'_display']); 34 if($contest[$key.'_display']['pending']) $template->assign(strtoupper($key).'_PENDING', true); 35 if($contest[$key.'_display']['finished']) $template->assign(strtoupper($key).'_FINISHED', true); 36 // Les quatre zones texte 37 foreach (array('presentation','rules','prices','final') AS $key) { 36 38 $template->assign(strtoupper($key), trigger_event('render_CR_content', $contest[$key])); 37 39 } 38 40 39 41 // Affichage des résultats 40 if ($contest['status'] == 'finished'){42 if ($contest['status'] == 'finished') { 41 43 // Infos des résultats 42 $query = "SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;"; 43 $results = pwg_query($query); 44 $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;"); 44 45 45 while ($result = pwg_db_fetch_assoc($results)){46 while ($result = pwg_db_fetch_assoc($results)) { 46 47 // Infos de l'image 47 48 $query = "SELECT … … 59 60 60 61 // retrieving category informations 61 $query = "SELECT id, name, permalink, uppercats 62 $query = "SELECT 63 id, 64 name, 65 permalink, 66 uppercats 62 67 FROM " . CATEGORIES_TABLE." 63 68 WHERE id = " . $image['category_id'] . ";"; … … 72 77 73 78 // Template 74 if (in_array($result['rank'], array(1,2,3))){79 if (in_array($result['rank'], array(1,2,3))) { 75 80 $data = array( 76 81 'RANK' => $result ['rank'], … … 80 85 'IMAGE_NAME' => (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'], 81 86 'COMMENT' => CR_cut_string(trigger_event('render_CR_content', $result['comment']), 450), 82 87 ); 83 88 }else{ 84 89 $data = array( … … 96 101 $template->set_filenames(array('index'=> dirname(__FILE__).'/../template/cr_page.tpl')); 97 102 98 } else{103 } else { 99 104 page_not_found(l10n('CR_notavailable')); 100 105 } -
extensions/ContestResults/include/functions.php
r6782 r9200 3 3 4 4 // Racourcis un texte et ajoute une ellipse 5 function CR_cut_string($string, $limit) {5 function CR_cut_string($string, $limit) { 6 6 include_once(CR_PATH . 'include/cutstring.class.php'); 7 if (strlen(str_replace("\r\n", "\n", strip_tags($string))) > $limit){7 if (strlen(str_replace("\r\n", "\n", strip_tags($string))) > $limit) { 8 8 $output = new HtmlCutString($string, $limit); 9 9 return ($output->cut()).'...'; 10 } else{10 } else { 11 11 return $string; 12 12 } … … 14 14 15 15 // Recupère le nom d'un coucours à partir de l'id 16 function get_contest_name($id) {17 $ query= pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $id . ";");18 if (pwg_db_num_rows($query)){19 $ result = pwg_db_fetch_assoc($query);20 return $ result['name'];21 } else{16 function get_contest_name($id) { 17 $contest = pwg_query("SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $id . ";"); 18 if (pwg_db_num_rows($contest)) { 19 $contest = pwg_db_fetch_assoc($contest); 20 return $contest['name']; 21 } else { 22 22 return null; 23 23 } -
extensions/ContestResults/include/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/language/en_UK/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/language/en_UK/plugin.lang.php
r8650 r9200 25 25 $lang['CR_final'] = 'Ending'; 26 26 $lang['CR_summary'] = 'Summary'; 27 $lang['CR_visibility'] = 'Visible if the contest is';28 27 $lang['CR_textareas'] = 'Contest description'; 29 28 $lang['CR_new'] = 'New contest'; … … 35 34 $lang['CR_comment'] = 'Comment'; 36 35 $lang['CR_rank'] = 'Rank'; 36 $lang['CR_place'] = 'place'; 37 37 $lang['CR_period'] = 'Period'; 38 $lang['CR_visible'] = ' Visible';38 $lang['CR_visible'] = 'Public'; 39 39 $lang['CR_nopublic'] = 'This page is not available for the public !'; 40 40 $lang['CR_notavailable'] = 'This contest is not available'; … … 52 52 $lang['CR_menubar_block_number'] = 'Quantity of contests to display in the block'; 53 53 54 $lang['CR_help_lang'] = (CR_ED_state == 'active') ? "<b>You can use HTML and multilanguage descriptions.</b>" : "<b>You can use HTML.</b>"; 55 // <span style='font-size:0.8em;'><br/><br/> 56 // Multilanguage descriptions are placed between [lang=xx] and [/lang] tags, where xx is the language code (for example en, es, fr). There is also 2 special languages : [lang=default] and [lang=all]. 57 // <br/><br/> 58 // Special language <i>default</i> : the default description will be used if the description is not available in the connected user selected language. If [lang=default] does not exists, anything outside the [lang] tags will be considered as the default description. 59 // <br/><br/> 60 // Special language <i>all</i> : anything inside [lang=all] will be included in the description, anywhat the connected user defined language is. This is mainly useful to include HTML/JavaScript code inside a description."; 61 62 $lang['CR_help_title'] = ""; 54 $lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>You can use HTML and multilanguage descriptions.</b>" : "<b>You can use HTML.</b>"; 55 $lang['CR_help_title'] = "" . $lang['CR_help_lang']; 63 56 $lang['CR_help_status'] = "When the contest is <i>Finished</i> the results are displayed on the contest page and the marker <span style='color:#a00;'>(Finished)</span> is activated.<br/> 64 57 <b>Caution :</b> the contest doesn't switch automaticaly to the status 'finished' when the end date is reached !"; 65 $lang['CR_help_visible'] = "If the contest is 'unvisible'only <b>administrators</b> can see it.";66 $lang['CR_help_summary'] = "The summary is only displayed in the general contest page. 67 <br/>" ;68 $lang['CR_help_textareas'] = " - These four areas allow you to describe the contest.69 - For each area you can choose the displaying according to the contest status.";58 $lang['CR_help_visible'] = "If the contest is not public only <b>administrators</b> can see it."; 59 $lang['CR_help_summary'] = "The summary is only displayed in the general contest page.<br/> 60 <br/>" . $lang['CR_help_lang']; 61 $lang['CR_help_textareas'] = "These four areas allow you to describe the contest.<br/> 62 <br/>" . $lang['CR_help_lang']; 70 63 $lang['CR_help_results'] = "- Descriptions are displayed on each pictures pages and on the contest page for the first three.<br/> 71 64 - Sort elements by drag-and-drop them.<br/> 72 - Hover this icon <img src='".CR_PATH."admin/template/image/images.png'/> to view the picture that corresponds to the id.<br/>"; 65 - Hover this icon <img src='".CR_PATH."admin/template/image/images.png'/> to view the picture that corresponds to the id.<br/> 66 <br/>" . $lang['CR_help_lang']; 73 67 74 68 ?> -
extensions/ContestResults/language/fr_FR/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/language/fr_FR/plugin.lang.php
r6795 r9200 25 25 $lang['CR_final'] = 'Conclusion'; 26 26 $lang['CR_summary'] = 'Résumé'; 27 $lang['CR_visibility'] = 'Visible si le concours est';28 27 $lang['CR_textareas'] = 'Description du concours'; 29 28 $lang['CR_new'] = 'Nouveau concours'; … … 35 34 $lang['CR_comment'] = 'Commentaire'; 36 35 $lang['CR_rank'] = 'Rang'; 36 $lang['CR_place'] = 'place'; 37 37 $lang['CR_period'] = 'Période'; 38 $lang['CR_visible'] = ' Visible';38 $lang['CR_visible'] = 'Publique'; 39 39 $lang['CR_nopublic'] = "Cette page n'est pas accessible au public !"; 40 40 $lang['CR_notavailable'] = "Ce concours n'est pas disponible"; 41 41 $lang['CR_id_unknown %d'] = "L'image n°%d n'existe pas"; 42 42 43 $lang['CR_order_1'] = '1<sup> er</sup>';43 $lang['CR_order_1'] = '1<sup>ère</sup>'; 44 44 $lang['CR_order_2'] = '2<sup>ème</sup>'; 45 45 $lang['CR_order_3'] = '3<sup>ème</sup>'; … … 52 52 $lang['CR_menubar_block_number'] = 'Nombre de concours à afficher dans le bloc'; 53 53 54 $lang['CR_help_lang'] = (CR_ED_state == 'active') ? "<b>Vous pouvez utiliser du HTML et les descriptions multilingues.</b>" : "<b>Vous pouvez utiliser du HTML.</b>"; 55 // <span style='font-size:0.8em;'><br/><br/> 56 // Les descriptions multilingues se font entre les balises [lang=xx] et [/lang], ou xx est le code de la langue (par exemple fr, en, es, it, etc....) Il existe également 2 balises spéciales: [lang=default] et [lang=all]. 57 // <br/><br/> 58 // Balise <i>default</i> : la description par défaut sera utilisée si la description dans la langue de l'utilisateur n'est pas définie. Si [lang=default] n'existe pas, tout ce qui est situé en dehors des balises de langues sera considéré comme description par défaut. 59 // <br/><br/> 60 // Balise <i>all</i> : tout ce qui est situé entre les balises [lang=all] et [/lang] sera inclus dans la description, quelle que soit la langue de l'utilisateur. Ceci est particulièrement pratique pour inclure du code html ou javascript dans une description.</span>"; 61 62 $lang['CR_help_title'] = ""; 54 $lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>Vous pouvez utiliser du HTML et les descriptions multilingues.</b>" : "<b>Vous pouvez utiliser du HTML.</b>"; 55 $lang['CR_help_title'] = "" . $lang['CR_help_lang']; 63 56 $lang['CR_help_status'] = "Quand le concours est <i>Terminé</i> les résultats sont affichés sur la page du concours et l'indicateur <span style='color:#a00;'>(Terminé)</span> s'active.<br/> 64 57 <b>Attention :</b> le concours ne passe pas automatiquement en status terminé quand la date de fin est atteinte !"; 65 $lang['CR_help_visible'] = "Si le concours est 'invisible'seuls les <b>administrateurs</b> peuvent le voir.";58 $lang['CR_help_visible'] = "Si le concours n'est pas publique seuls les <b>administrateurs</b> peuvent le voir."; 66 59 $lang['CR_help_summary'] = "Le résumé n'est affiché que sur la page regroupant tous les concours.<br/> 67 <br/>"; 68 $lang['CR_help_textareas'] = "- Ces quatres zones de texte vous permettent de décrire le concours.<br/> 69 - Pour chaque zone vous pouvez choisir son affichage selon le status du concours.<br/> 70 <br/>"; 60 <br/>" . $lang['CR_help_lang']; 61 $lang['CR_help_textareas'] = "Ces quatres zones de texte vous permettent de décrire le concours.<br/> 62 <br/>" . $lang['CR_help_lang']; 71 63 $lang['CR_help_results'] = "- Les descriptions seront affichées sur les pages de chaque images et sur la page du concours pour les trois premiers.<br/> 72 64 - Triez les éléments par glisser-déposer.<br/> 73 65 - Survolez l'icône <img src='".CR_PATH."admin/template/image/images.png'/> pour voir l'image correspondante à l'identifiant entré.<br/> 74 <br/>" ;66 <br/>" . $lang['CR_help_lang']; 75 67 76 68 ?> -
extensions/ContestResults/language/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/language/lv_LV/description.txt
r8650 r9200 1 Pievieno konkursu p ārvaldības lapas1 Pievieno konkursu parvaldibas lapas -
extensions/ContestResults/language/lv_LV/index.php
r8650 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id$ 8 // | last update : $Date$ 9 // | last modifier : $Author$ 10 // | revision : $Revision$ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/language/lv_LV/plugin.lang.php
r8650 r9200 25 25 $lang['CR_final'] = 'Beigšana'; 26 26 $lang['CR_summary'] = 'Kopā'; 27 $lang['CR_visibility'] = 'Redzams, ja konkurss ir';28 27 $lang['CR_textareas'] = 'Konkursa apraksts'; 29 28 $lang['CR_new'] = 'Jauns konkurss'; … … 35 34 $lang['CR_comment'] = 'Komentārs'; 36 35 $lang['CR_rank'] = 'Novērtējums'; 36 $lang['CR_place'] = 'vietu'; 37 37 $lang['CR_period'] = 'Periods'; 38 38 $lang['CR_visible'] = 'Redzams'; … … 52 52 $lang['CR_menubar_block_number'] = 'Blokā attēlojamo konkursu skaits'; 53 53 54 $lang['CR_help_lang'] = (CR_ED_state == 'active') ? "Iespējasm lietot HTML un multivalodu aprakstus." : "Varat lietot HTML."; 55 //<span style='font-size:0.8em;'><br/><br/> 56 // Multilvalodu apraksts ir izvietots starp [lang=xx] un [/lang] iezīmēm (tagiem), kur xx ir valodas kods (piemēram en, es, fr). Ir arī 2 īpašas valodas : [lang=default] un [lang=all]. 57 //<br/><br/> 58 // Īpašā valoda pēc noklusējuma (default) : ja nebūs pieejams apraksts lietotāja izvēlētajā valodā, tad tiks lietots apraksts pēc noklusējuma noklusējuma valodā. Ja [lang=default] neeksistē, viss ārpus [lang] iezīmēm tiks uztverts kā apraksts pēc noklusējuma. 59 //<br/><br/> 60 // Īpašā valoda visi (all) : viss, kas atrodas starp iezīmēm [lang=all] tiks iekļauts aprakstā, veinalga kāda ir konekcijā esošā lietotāja definētā valoda. Tas galvenokārt ir noderīgi, ja aprakstā tiek iekļauts HTML/JavaScript kods."; 54 $lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "Iespējasm lietot HTML un multivalodu aprakstus." : "Varat lietot HTML."; 55 $lang['CR_help_title'] = "" . $lang['CR_help_lang']; 56 $lang['CR_help_status'] = "Kad konkurss ir <i>Pabeigts</i>, tā rezultāti tiek atainoti konkursa lapā un tiek aktivēts marķieris <span style='color:#a00;'>(Pabeigts)</span>.<br/> 57 <b>Brīdinājums :</b> konkurss, sasniedzot tā beigu datumu, automātiski nepieņem statusu 'Pabeigts' !"; 58 $lang['CR_help_visible'] = "Ja konkurss ir 'neredzams' (unvisible), to var redzāt tikai administrators."; 59 $lang['CR_help_summary'] = "Kopsavilkums tiek attēlots tikai konkursa galvenajā lapā.<br/> 60 <br/>" . $lang['CR_help_lang']; 61 $lang['CR_help_textareas'] = "Šie četri apgabali dod jums iespēju aprakstīt konkursu.<br/> 62 <br/>" . $lang['CR_help_lang']; 63 $lang['CR_help_results'] = "- Apraksti tiek rādīti uz katras attēla lapas un uz konkursa lapas - pirmajiem trim.<br/> 64 - Kārtot elementus ar (velc un met) drag-and-drop metodi.<br/> 65 - Uzej ar peli uz ikonas <img src='".CR_PATH."admin/template/image/images.png'/> lai redzētu attēlu, kas atbilst id.<br/> 66 <br/>" . $lang['CR_help_lang']; 61 67 62 $lang['CR_help_title'] = "";63 $lang['CR_help_status'] = "Kad konkurss ir Pabeigts, tā rezultāti tiek atainoti konkursa lapā un tiek aktivēts marķieris <span style='color:#a00;'>(Pabeigts)</span>.64 Brīdinājums : konkurss, sasniedzot tā beigu datumu, automātiski nepieņem statusu 'Pabeigts' !";65 $lang['CR_help_visible'] = "Ja konkurss ir 'neredzams' (unvisible), to var redzāt tikai administrators .";66 $lang['CR_help_summary'] = "Kopsavilkums tiek attēlots tikai konkursa galvenajā lapā.67 <br/>";68 $lang['CR_help_textareas'] = "- Šie četri apgabali dod jums iespēju aprakstīt konkursu.69 - Katram apgabalam, ņemot vērā konkursa statusu, iespējams izvēlēties tā attēlojumu.";70 $lang['CR_help_results'] = "- Apraksti tiek rādīti uz katras attēla lapas un uz konkursa lapas - pirmajiem trim.71 - Kārtot elementus ar (velc un met) drag-and-drop metodi.72 - Uzej ar peli uz ikonas, src='".CR_PATH."admin/template/image/images.png' _fcksavedurl='".CR_PATH."admin/template/image/images.png'/> lai redzētu attēlu, kas atbilst id.";73 68 ?> -
extensions/ContestResults/main.inc.php
r6795 r9200 2 2 /* 3 3 Plugin Name: ContestResults 4 Version: 1. 14 Version: 1.2 5 5 Description: Add contests management pages 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=439 … … 11 11 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 12 12 13 global $prefixeTable ;13 global $prefixeTable, $conf; 14 14 15 15 // +-----------------------------------------------------------------------+ 16 // Variables globales CR16 // Variables globales CR 17 17 // +-----------------------------------------------------------------------+ 18 18 define('CR_DIR' , basename(dirname(__FILE__))); … … 21 21 define('CR_TABLE_2' , $prefixeTable . 'contests_results'); 22 22 define('CR_NAME' , 'ContestResults'); 23 define('CR_VERSION', '1. 1');24 define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin& section=' . CR_DIR . '/admin/admin.php');23 define('CR_VERSION', '1.2'); 24 define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CR_DIR . '/admin/admin.php'); 25 25 define('CR_PUBLIC', make_index_url(array('section' => 'contests')) . '/'); 26 26 27 27 $ED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); 28 define('CR_ED_ state', $ED['state']);28 define('CR_ED_STATE', $ED['state']); 29 29 30 30 31 31 // +-----------------------------------------------------------------------+ 32 // Trigger32 // Triggers 33 33 // +-----------------------------------------------------------------------+ 34 34 add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration … … 36 36 add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page 37 37 add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Commentaire sur la page image 38 if(CR_ED_STATE == 'active') add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues 38 39 39 if(CR_ED_state == 'active') add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues40 40 41 // Langues42 load_language('plugin.lang', CR_PATH); 43 41 // +-----------------------------------------------------------------------+ 42 // Fonctions 43 // +-----------------------------------------------------------------------+ 44 44 // Gestion du menu 45 45 include(CR_PATH . 'include/cr_menubar.php'); 46 46 47 47 // Lien d'administration 48 function CR_admin_menu($menu) {48 function CR_admin_menu($menu) { 49 49 array_push($menu, array( 50 50 'NAME' => CR_NAME, … … 55 55 56 56 // Paramètre URL 57 function CR_section_init() {57 function CR_section_init() { 58 58 global $tokens, $page, $conf; 59 60 load_language('plugin.lang', CR_PATH); 59 61 include(CR_PATH . 'include/functions.php'); 60 62 61 if ($tokens[0] == 'contests'){63 if ($tokens[0] == 'contests') { // on est dans la section concours 62 64 $page['section'] = 'contests'; 63 65 $page['title'] = l10n('Contests'); 64 if(isset($tokens[1]) AND $tokens[1]){ 66 67 if (isset($tokens[1]) AND $tokens[1]) { // on est sur la page d'un concours 65 68 $page['contest'] = explode('-', $tokens[1]); 66 69 $page['contest'] = $page['contest'][0]; … … 70 73 } 71 74 72 // Contenu d ula page73 function CR_index() {75 // Contenu de la page 76 function CR_index() { 74 77 global $template, $page, $conf; 75 if(isset($page['section']) and $page['section'] == 'contests'){ 76 if(isset($page['contest'])) 78 79 if (isset($page['section']) and $page['section'] == 'contests') { 80 if (isset($page['contest'])) { // on est sur la page d'un concours 77 81 include(CR_PATH . 'include/cr_page.php'); 78 else82 } else { // on est dans la section concours 79 83 include(CR_PATH . 'include/cr_main.php'); 84 } 80 85 } 81 86 } 82 87 83 88 // Ajoute le commentaire sur la page image 84 function CR_comment_picture() {89 function CR_comment_picture() { 85 90 global $page, $template, $conf; 86 91 include(CR_PATH . 'include/cr_comment_picture.php'); -
extensions/ContestResults/maintain.inc.php
r6782 r9200 2 2 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 3 3 4 // Configuration par défaut 4 5 define('default_config' , serialize(array( 5 6 'menubar_mode' => array( … … 16 17 ))); 17 18 18 function plugin_install(){ 19 // Installtion 20 function plugin_install() { 19 21 global $prefixeTable; 20 22 21 $query ="CREATE TABLE `" . $prefixeTable . "contests` (23 pwg_query("CREATE TABLE `" . $prefixeTable . "contests` ( 22 24 `id` INT NOT NULL AUTO_INCREMENT , 23 25 `name` VARCHAR( 255 ) NOT NULL , … … 30 32 `summary` TEXT NULL , 31 33 `presentation` TEXT NULL , 32 `presentation_display` VARCHAR( 255 ) NULL ,33 34 `rules` TEXT NULL , 34 `rules_display` VARCHAR( 255 ) NULL ,35 35 `prices` TEXT NULL , 36 `prices_display` VARCHAR( 255 ) NULL , 37 `final` TEXT NULL , 38 `final_display` VARCHAR( 255 ) NULL , 36 `final` TEXT NULL 39 37 PRIMARY KEY ( `id` ) 40 );"; 41 pwg_query($query); 38 );"); 42 39 43 $query ="CREATE TABLE `" . $prefixeTable . "contests_results` (40 pwg_query("CREATE TABLE `" . $prefixeTable . "contests_results` ( 44 41 `image_id` INT NOT NULL , 45 42 `contest_id` INT NOT NULL , … … 48 45 `comment` TEXT NULL, 49 46 UNIQUE ( `image_id` , `contest_id` ) 50 );"; 51 pwg_query($query); 47 );"); 52 48 53 $query = "INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');"; 54 pwg_query($query); 49 pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');"); 55 50 } 56 51 52 // Activation 57 53 function plugin_activate(){ 58 global $conf ;54 global $conf, $prefixeTable; 59 55 60 // compatibilité avec les versions < 1.1 61 if(!isset($conf['ContestResults'])){ 62 $query = "INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');"; 63 pwg_query($query); 56 // compatibilité avec les versions < 1.1 (ajout d'une entrée de configuration) 57 if (!isset($conf['ContestResults'])) { 58 pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');"); 59 } 60 61 // compatibilité avec les versions < 1.2 (suppression option d'affichage) 62 $field = pwg_query("SHOW COLUMNS FROM `" . $prefixeTable . "contests` LIKE 'presentation_display'"); 63 if (pwg_db_num_rows($field)) { 64 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `presentation_display`"); 65 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `rules_display`"); 66 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `prices_display`"); 67 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `final_display`"); 64 68 } 65 69 } 66 70 67 function plugin_uninstall(){ 71 // Désinstallation 72 function plugin_uninstall() { 68 73 global $prefixeTable; 69 74 70 $query = "DROP TABLE `" . $prefixeTable . "contests`;"; 71 pwg_query($query); 72 73 $query = "DROP TABLE `" . $prefixeTable . "contests_results`;"; 74 pwg_query($query); 75 76 $query = "DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'ContestResults';"; 77 pwg_query($query); 75 pwg_query("DROP TABLE `" . $prefixeTable . "contests`;"); 76 pwg_query("DROP TABLE `" . $prefixeTable . "contests_results`;"); 77 pwg_query("DELETE FROM " . CONFIG_TABLE . " WHERE `param` = 'ContestResults';"); 78 78 } 79 79 ?> -
extensions/ContestResults/template/cr_main.tpl
r6782 r9200 6 6 7 7 {if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if} 8 8 9 <div id="content" class="content"> 9 10 <div class="titrePage"> … … 13 14 <h2>{'Contests'|@translate}</h2> 14 15 </div> <!-- titrePage --> 15 {if !isset($contests_pending) AND !isset($contests_finished)} 16 17 {if !isset($contests)} 16 18 <div class="nopublic" style="margin-bottom:200px;"> 17 19 {'CR_no_contest'|@translate} 18 20 </div> 19 {/if}20 { if isset($contests_pending)}21 22 {else} 21 23 <ul class="thumbnailCategories"> 22 {foreach from=$contests_pending item=contest} 23 <li> 24 <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}"> 25 <div class="illustration"> 26 <a href="{$contest.URL}"> 27 {if !empty($contest.LOGO)} 28 <img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;"> 24 {foreach from=$contests item=contest} 25 <li> 26 <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}"> 27 <div class="illustration"> 28 <a href="{$contest.URL}"> 29 {if $contest.STATUS == 'pending'} 30 {if !empty($contest.LOGO)} 31 <img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;"> 32 {/if} 33 {else} 34 <img src="{$contest.RESULTS.1.TN_SRC}" alt="{$contest.NAME|@replace:'"':' '}"> 29 35 {/if} 30 </a> 31 </div> 32 <div class="description"> 33 <h3> 34 <a href="{$contest.URL}">{$contest.NAME}</a> 35 </h3> 36 <div class="text"> 37 <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p> 38 {if !empty($contest.SUMMARY)} 39 <p>{$contest.SUMMARY}</p> 40 {/if} 36 </a> 41 37 </div> 42 </div> 43 </div> 44 </li> 45 {/foreach} 46 </ul> 47 {/if} 48 49 {if isset($contests_finished)} 50 <ul class="thumbnailCategories"> 51 {foreach from=$contests_finished item=contest} 52 <li> 53 <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}"> 54 <div class="description"> 55 <h3> 56 <a href="{$contest.URL}">{$contest.NAME}</a> 57 <span class="finished">({'CR_finished'|@translate})</span> 58 </h3> 59 <div class="text"> 60 <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p> 61 <div class="results"> 62 <a href="{$contest.URL}"> 38 <div class="description"> 39 <h3> 40 <a href="{$contest.URL}">{$contest.NAME}</a> 41 {if $contest.STATUS == 'finished'}<span class="CR_finished">({'CR_finished'|@translate})</span>{/if} 42 </h3> 43 <div class="text"> 44 <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p> 45 <p> 46 {if $contest.STATUS == 'pending'} 47 {if !empty($contest.SUMMARY)} 48 {$contest.SUMMARY} 49 {/if} 50 {else} 63 51 {foreach from=$contest.RESULTS item=result} 64 <img src="{$result.TN_SRC}" style="max-height:80px;max-width:120px;"/>52 {'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u><br> 65 53 {/foreach} 66 </a> 54 {/if} 55 </p> 67 56 </div> 68 57 </div> 69 58 </div> 70 </div> 71 </li> 72 {/foreach} 73 </ul> 59 </li> 60 {/foreach} 61 </ul> 74 62 {/if} 75 63 </div> <!-- content --> -
extensions/ContestResults/template/cr_menubar.tpl
r6768 r9200 1 1 {html_head} 2 2 <style type="text/css"> 3 . finished {ldelim}3 .CR_finished {ldelim} 4 4 font-size:0.8em; 5 5 color:#a00; … … 15 15 <a href="{$data.URL}" title="{$data.DATE}"> 16 16 {$data.LABEL} 17 {if $data.STATUS == 'finished'}<span class=" finished">×</span>{/if}17 {if $data.STATUS == 'finished'}<span class="CR_finished">×</span>{/if} 18 18 </a> 19 19 </li> -
extensions/ContestResults/template/cr_page.tpl
r6782 r9200 6 6 7 7 {if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if} 8 <div id="content_contest"class="content">8 <div class="content"> 9 9 <div class="titrePage"> 10 10 <ul class="categoryActions"> … … 15 15 </ul> 16 16 <h2> 17 <a href="index.php?/contests" >{'Contests'|@translate}</a>{$SEPARATOR}<a href="{$URL}">{$NAME}</a>18 {if $STATUS=='finished'}<span class=" finished">({'CR_finished'|@translate})</span>{/if}17 <a href="index.php?/contests" name="top">{'Contests'|@translate}</a>{$SEPARATOR}<a href="{$URL}">{$NAME}</a> 18 {if $STATUS=='finished'}<span class="CR_finished">({'CR_finished'|@translate})</span>{/if} 19 19 </h2> 20 20 </div> <!-- titrePage --> … … 26 26 {/if} 27 27 28 <div class="CR_banner"> 28 29 {if !empty($BANNER)} 29 <div class="CR_banner"> 30 <a href="#results"><img src="{$BANNER}" alt="{$NAME}"/></a> 30 <h1><a href="#results"><img src="{$BANNER}" alt="{$NAME}"/></a></h1> 31 {else} 32 <h1><a href="#results">{$NAME}</a></h1> 33 {/if} 34 </div> 35 36 <div class="CR_text CR_period"> 37 {$DATE_BEGIN} - {$DATE_END} 38 </div> 39 40 {if !empty($PRESENTATION)} 41 <div class="CR_text"> 42 <h3>{'CR_presentation'|@translate} :</h3> 43 {$PRESENTATION} 31 44 </div> 32 45 {/if} 33 46 34 {if (($STATUS=='pending' AND $PRESENTATION_PENDING) OR ($STATUS=='finished' AND $PRESENTATION_FINISHED)) AND !empty($PRESENTATION)}47 {if !empty($RULES)} 35 48 <div class="CR_text"> 36 <h3>{'CR_ presentation'|@translate} :</h3>37 <p>{$PRESENTATION}</p>49 <h3>{'CR_rules'|@translate} :</h3> 50 {$RULES} 38 51 </div> 39 52 {/if} 40 53 41 <div class="CR_text"> 42 <h3>{'CR_period'|@translate} :</h3> 43 <p>{$DATE_BEGIN} - {$DATE_END}</p> 44 </div> 54 {if !empty($PRICES)} 55 <div class="CR_text"> 56 <h3>{'CR_prices'|@translate} :</h3> 57 {$PRICES} 58 </div> 59 {/if} 45 60 46 <div id="CR_rules_prices"> 47 {if (($STATUS=='pending' AND $RULES_PENDING) OR ($STATUS=='finished' AND $RULES_FINISHED)) AND !empty($RULES)} 48 <div id="CR_rules"> 49 <h3>{'CR_rules'|@translate} :</h3> 50 <p>{$RULES}</p> 51 </div> 52 {/if} 53 54 {if (($STATUS=='pending' AND $PRICES_PENDING) OR ($STATUS=='finished' AND $PRICES_FINISHED)) AND !empty($PRICES)} 55 <div id="CR_prices"> 56 <h3>{'CR_prices'|@translate} :</h3> 57 <p>{$PRICES}</p> 58 </div> 59 {/if} 60 </div> 61 62 {if (($STATUS=='pending' AND $FINAL_PENDING) OR ($STATUS=='finished' AND $FINAL_FINISHED)) AND !empty($FINAL)} 61 {if !empty($FINAL)} 63 62 <div class="CR_text"> 64 63 <h3>{'CR_final'|@translate} :</h3> 65 <p>{$FINAL}</p>64 {$FINAL} 66 65 </div> 67 66 {/if} … … 69 68 70 69 {if !empty($RESULTS)} 71 <div id="content_results"class="content">70 <div class="content"> 72 71 <div class="titrePage"> 73 72 <ul class="categoryActions"> … … 85 84 <div class="podium_{$result.RANK}"> 86 85 <div class="illustration"> 87 <div class="title">{'CR_order_'|cat:$result.RANK|@translate} - <u>{$result.AUTHOR}</u></div>86 <div class="title">{'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u></div> 88 87 <a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}"> 89 88 <img src="{$result.IMAGE_SRC}" alt="{$result.IMAGE_NAME}"/> 90 89 </a> 91 90 </div> 92 < div class="comment">93 <div>{$result.COMMENT}</div>94 </ div>91 <p> 92 {$result.COMMENT} 93 </p> 95 94 </div> 96 95 {if $result.RANK == 3}</div>{/if} … … 108 107 <img class="thumbnail" src="{$result.TN_SRC}" alt="{$result.IMAGE_NAME}"/> 109 108 </a> 110 </span> 109 </span> 111 110 <span class="thumbLegend"> 112 <b>{$result.RANK}{'CR_order_sup'|@translate}</b> - {$result.AUTHOR} 111 <span class="thumbnail-name"> 112 {$result.AUTHOR} 113 </span> 114 <span class="nb-hits"> 115 <br>{$result.RANK}{'CR_order_sup'|@translate} {'CR_place'|@translate} 116 </span> 113 117 </span> 114 118 </span> … … 120 124 {if !empty($LOGO)} 121 125 <div class="CR_banner"> 122 < img src="{$LOGO}" alt="{$NAME}"/>126 <h1><a href="#top"><img src="{$LOGO}" alt="{$NAME}"/></a></h1> 123 127 </div> 124 128 {/if} -
extensions/ContestResults/template/index.php
r6768 r9200 1 1 <?php 2 2 // +-----------------------------------------------------------------------+ 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net | 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 3 // | Piwigo - a PHP based picture gallery | 6 4 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php 1912 2007-03-16 06:30:07Z rub $ 8 // | last update : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $ 9 // | last modifier : $Author: rub $ 10 // | revision : $Revision: 1912 $ 5 // | Copyright(C) 2008-2010 Piwigo Team http://piwigo.org | 6 // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | 7 // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | 11 8 // +-----------------------------------------------------------------------+ 12 9 // | This program is free software; you can redistribute it and/or modify | -
extensions/ContestResults/template/style.css
r6782 r9200 1 .content { 2 min-height:0; 3 } 4 5 .finished { 1 .CR_finished { 6 2 font-weight:normal; 7 3 font-size:0.8em; … … 9 5 padding-left:10px; 10 6 color:#a00; 11 }12 13 .results {14 overflow:hidden;15 white-space:nowrap;16 7 } 17 8 … … 31 22 } 32 23 33 #content_contest {34 padding-bottom:20px;35 }36 37 p {38 text-align:justify;39 margin:0 0 10px 20px;40 font-size:1.1em;41 }42 43 h3 {44 margin-bottom:0;45 font-size:1.3em;46 }47 48 ul {49 margin:0;50 font-size:1.1em;51 }52 53 24 .CR_banner { 54 25 width:100%; 55 26 text-align:center; 56 27 } 28 .CR_banner h1 { 29 margin:20px; 30 font-size:2.5em; 31 } 57 32 58 33 .CR_text { 59 margin:0 5%; 34 margin:0 20px 20px 20px; 35 text-align:justify; 60 36 } 61 62 #CR_rules_prices { 37 .CR_text h3 { 38 margin:0 0 3px 0; 39 font-size:1.3em; 40 border-bottom:1px dotted #999; 41 color:#ddd; 42 } 43 44 .CR_period { 63 45 text-align:center; 64 margin:0 5%; 46 font-size:1.3em; 47 font-weight:bold; 48 font-style:italic; 49 font-family:"Consolas"; 50 color:#ddd; 51 border-top:1px dotted #999; 65 52 } 66 #CR_rules, #CR_prices {67 display:inline-block;68 width:49%;69 text-align:left;70 vertical-align:top;71 }72 #CR_rules_prices h3 {73 margin-left:-1%;74 }75 53 76 54 #CR_podium { 77 55 text-align:center; 78 margin:0 5 % 30px 5%;56 margin:0 5px 30px 5px; 79 57 } 80 58 #CR_podium .podium_1 { … … 92 70 } 93 71 #CR_podium .podium_1 .illustration { 94 margin:0 10% 10px 10%;72 margin:0 5px 10px 5px; 95 73 } 96 74 #CR_podium .podium_1 .illustration img { … … 98 76 max-height:250px; 99 77 max-width:100%; 100 -moz-border-radius:10px; 101 border-radius:10px; 78 border-radius:5px; 79 -moz-border-radius:5px; 80 -webkit-border-radius:5px; 81 -moz-box-shadow:0 0 5px #EFBF00; 82 -webkit-box-shadow:0 0 5px #EFBF00; 102 83 } 103 84 #CR_podium .podium_1 .illustration img:hover { 104 85 border-style:inset; 105 86 } 106 #CR_podium .podium_1 .comment { 107 padding:0 5px; 108 } 109 110 #CR_podium .podium_1 .comment div { 111 margin:0 auto; 87 #CR_podium .podium_1 p { 88 padding:0 10px 0 5px; 112 89 text-align:justify; 90 font-size:0.9em; 113 91 } 114 92 #CR_podium .podium_23 { … … 117 95 text-align:left; 118 96 vertical-align:middle; 119 border-left:1px dotted # 555;97 border-left:1px dotted #ddd; 120 98 max-height:400px; 121 99 } … … 131 109 margin-bottom:5px; 132 110 } 133 #CR_podium .podium_ 2.title {111 #CR_podium .podium_3 .title { 134 112 color:#EF5400; 135 113 } 136 #CR_podium .podium_ 3.title {114 #CR_podium .podium_2 .title { 137 115 color:#9F9F9F; 138 116 } 139 117 #CR_podium .podium_2 .illustration, #CR_podium .podium_3 .illustration { 140 display:inline-block;141 margin:0 2% 10px 2%;142 width: 40%;118 float:left; 119 margin:0 10px 10px 10px; 120 width:180px; 143 121 text-align:center; 144 122 } … … 146 124 border-width:3px; 147 125 border-style:outset; 148 max-height:150px; 149 max-width:100%; 150 border-radius:6px; 151 -moz-border-radius:6px; 126 max-height:160px; 127 max-width:170px; 128 border-radius:5px; 129 -moz-border-radius:5px; 130 -webkit-border-radius:5px; 152 131 } 132 #CR_podium .podium_3 .illustration img { 133 border-color:#EF5400; 134 -moz-box-shadow:0 0 5px #EF5400; 135 -webkit-box-shadow:0 0 5px #EF5400; 136 } 153 137 #CR_podium .podium_2 .illustration img { 154 border-color:#EF5400;155 }156 #CR_podium .podium_3 .illustration img {157 138 border-color:#9F9F9F; 139 -moz-box-shadow:0 0 5px #9F9F9F; 140 -webkit-box-shadow:0 0 5px #9F9F9F; 158 141 } 159 142 #CR_podium .podium_2 .illustration img:hover, #CR_podium .podium_3 .illustration img:hover { … … 161 144 } 162 145 163 #CR_podium .podium_2 .comment, #CR_podium .podium_3 .comment { 164 display:inline-block; 165 width:53%; 166 height:50%; 167 vertical-align:top; 168 margin-top:20px; 146 #CR_podium .podium_2 p, #CR_podium .podium_3 p { 169 147 text-align:justify; 170 148 font-size:0.9em;
Note: See TracChangeset
for help on using the changeset viewer.