Changeset 9745 for extensions/ContestResults
- Timestamp:
- Mar 17, 2011, 8:25:13 PM (14 years ago)
- Location:
- extensions/ContestResults
- Files:
-
- 8 added
- 1 deleted
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContestResults/admin/config.php
r9419 r9745 6 6 // +-----------------------------------------------------------------------+ 7 7 if (isset($_POST['config_submit'])) { 8 $ user_config= array(8 $conf['ContestResults'] = array( 9 9 'menubar_mode' => array( 10 10 'link' => (isset($_POST['menubar_mode_link'])) ? 1 : 0, … … 18 18 'number' => $_POST['menubar_block_number'], 19 19 ), 20 'truncate_summary' => $_POST['truncate_summary'], 20 21 ); 21 22 22 pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($ user_config) . "' WHERE `param` = 'ContestResults';");23 redirect(CR_ADMIN . '&tab=config&msg=saved');23 pwg_query("UPDATE " . CONFIG_TABLE . " SET `value` = '" . serialize($conf['ContestResults']) . "' WHERE `param` = 'ContestResults';"); 24 $page['infos'][] = l10n('Information data registered in database'); 24 25 } 25 26 … … 27 28 // Définition des variables template 28 29 // +-----------------------------------------------------------------------+ 29 if (isset($_GET['msg']) AND $_GET['msg'] == 'saved')30 array_push($page['infos'], l10n('Information data registered in database'));31 32 33 30 $template->assign(array( 34 31 'MODE_LINK' => ($conf['ContestResults']['menubar_mode']['link']) ? 'checked="checked"' : '', … … 37 34 'LINK_SPECIALS' => ($conf['ContestResults']['menubar_link']['specials']) ? 'checked="checked"' : '', 38 35 'BLOCK_NUMBER' => $conf['ContestResults']['menubar_block']['number'], 36 'TRUNCATE_SUMMARY' => $conf['ContestResults']['truncate_summary'], 39 37 )); 40 38 … … 44 42 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/config.tpl')); 45 43 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 44 46 45 ?> -
extensions/ContestResults/admin/get_tn.php
r9572 r9745 9 9 10 10 if (!pwg_db_num_rows($image)) { 11 $themeconf = $template->get_template_vars('themeconf');11 //$themeconf = $template->get_template_vars('themeconf'); 12 12 //$data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 13 13 $data['TN_SRC'] = 'admin/themes/default/icon/errors.png'; -
extensions/ContestResults/admin/manage.php
r9572 r9745 8 8 pwg_query('DELETE FROM ' . CR_TABLE_1 . ' WHERE id = ' . $_GET['delete_contest'] . ';'); 9 9 pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['delete_contest'] . ';'); 10 redirect(CR_ADMIN .'&tab=manage&msg=deleted');10 $page['infos'][] = l10n('CR_contest_deleted'); 11 11 } 12 12 13 13 if (isset($_GET['msg'])){ 14 array_push($page['infos'], l10n('CR_contest_'. $_GET['msg'])); 14 $_GET['msg'] = explode('.', $_GET['msg']); 15 $page[$_GET['msg'][0]][] = l10n('CR_'. $_GET['msg'][1]); 15 16 } 16 17 … … 29 30 30 31 while ($contest = pwg_db_fetch_assoc($contests)) { 31 if (is_date_passed($contest['date_end'])) { 32 $contest['status'] = 'finished'; 33 } else { 34 $contest['status'] = 'pending'; 35 } 32 $contest = array_merge($contest, get_contest_status($contest['date_begin'],$contest['date_end'])); 33 36 34 $template->append('contests_'.$contest['status'], array( 37 'NAME' => trigger_event('render_CR_content', $contest['name']),38 'VISIBLE' => $contest['visible'],35 'NAME' => trigger_event('render_CR_content', $contest['name']), 36 'VISIBLE' => $contest['visible'], 39 37 'DATE_BEGIN' => format_date($contest['date_begin']), 40 'DATE_END' => format_date($contest['date_end']),41 'LOGO' => $contest['logo'],42 'U_RESULTS' => CR_ADMIN . '&tab=results&contest_id=' . $contest['id'],43 'U_EDIT' => CR_ADMIN . '&tab=edit&contest_id=' . $contest['id'],44 'U_DELETE' => CR_ADMIN . '&delete_contest=' . $contest['id'],45 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),46 'DAYS' => DateDiff($contest['date_end'],date('Y-m-d')),38 'DATE_END' => format_date($contest['date_end']), 39 'LOGO' => $contest['logo'], 40 'U_RESULTS' => CR_ADMIN . '-results&contest_id=' . $contest['id'], 41 'U_EDIT' => CR_ADMIN . '-edit&contest_id=' . $contest['id'], 42 'U_DELETE' => CR_ADMIN . '-manage&delete_contest=' . $contest['id'], 43 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 44 'DAYS' => $contest['days'], 47 45 )); 48 46 } … … 53 51 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/manage.tpl')); 54 52 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 53 55 54 ?> -
extensions/ContestResults/admin/new.php
r9572 r9745 8 8 if ($_POST['name'] != null) { 9 9 // Mise en forme des descriptions 10 if (isset($_POST['description'])) { 11 $new_description = array(); 12 foreach ($_POST['description'] as $data) { 13 $new_description[] = array( 14 'name' => $data['name'], 15 'content' => $data['content'] 16 ); 10 if (isset($_POST['description'])) { 11 for ($i=0; $i<=count($_POST['description']); $i++) { 12 unset($_POST['description'][$i]['rank']); 17 13 } 18 14 // encoder le tableau sérialisé est le seul moyen que j'ai trouvé pour pas perdre les caractères spéciaux et planter unserialize 19 $_POST['description'] = base64_encode(serialize($new_description)); 15 $_POST['description'] = base64_encode(serialize($_POST['description'])); 16 } else { 17 $_POST['description'] = null; 20 18 } 21 19 22 20 // Modification d'un concours 23 if (isset($_GET['contest_id']) ) {21 if (isset($_GET['contest_id']) AND get_contest_name($_GET['contest_id'])) { 24 22 pwg_query("UPDATE " . CR_TABLE_1 . " SET 25 23 `name` = '" . $_POST['name'] ."', … … 37 35 redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_CR_content', $_POST['name']))); 38 36 } else { 39 redirect(CR_ADMIN .' &tab=manage&msg=saved');37 redirect(CR_ADMIN .'-manage&msg=infos.contest_saved'); 40 38 } 41 39 … … 63 61 '" . $_POST['description'] ."' 64 62 );"); 65 redirect(CR_ADMIN .'&tab=manage&msg=added'); 63 64 redirect(CR_ADMIN .'-manage&msg=infos.contest_added'); 66 65 } 67 66 68 67 } else { 69 array_push($page['errors'], l10n('CR_name_empty'));68 $page['errors'][] = l10n('CR_name_empty'); 70 69 } 71 70 } … … 75 74 // Définition des variables template 76 75 // +-----------------------------------------------------------------------+ 77 // Formulaire incomplet ##############################################################################################################################################################76 // Formulaire incomplet 78 77 if ($page['errors']) { 79 78 $template->assign(array( … … 100 99 101 100 // Edition d'un concours 102 } else if (isset($_GET['contest_id']) ) {101 } else if (isset($_GET['contest_id']) AND get_contest_name($_GET['contest_id'])) { 103 102 $query = "SELECT * FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";"; 104 103 $contest = pwg_db_fetch_assoc(pwg_query($query)); … … 115 114 )); 116 115 117 if ( $contest['description'] != null) {116 if (!empty($contest['description'])) { 118 117 $contest['description'] = unserialize(base64_decode($contest['description'])); 119 118 $i=0; … … 146 145 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__).'/template/new.tpl')); 147 146 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 147 148 148 ?> -
extensions/ContestResults/admin/results.php
r9419 r9745 8 8 pwg_query("DELETE FROM " . CR_TABLE_2 . " WHERE `contest_id` = " . $_GET['contest_id'] .";"); 9 9 10 $registered_ids = array(); 11 $_DUPLICATE = array(); 12 10 13 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 ) 19 VALUES( 20 '" . $data['image_id'] ."', 21 '" . $_GET['contest_id'] ."', 22 '" . $data['rank'] ."', 23 '" . $data['comment'] ."', 24 '" . $data['author'] . "' 25 );"); 14 if (!in_array($data['image_id'], $registered_ids)) { 15 $registered_ids[] = $data['image_id']; 16 17 pwg_query("INSERT INTO " . CR_TABLE_2 . " 18 ( 19 image_id, 20 contest_id, 21 rank, 22 comment, 23 author 24 ) 25 VALUES( 26 '" . $data['image_id'] ."', 27 '" . $_GET['contest_id'] ."', 28 '" . $data['rank'] ."', 29 '" . $data['comment'] ."', 30 '" . $data['author'] . "' 31 );"); 32 33 } else { 34 $_DUPLICATE[] = $data; 35 } 26 36 } 27 37 28 redirect(CR_ADMIN . '&tab=results&msg=saved&contest_id=' . $_GET['contest_id']); 38 if (isset($_GET['redirect']) AND $_GET['redirect'] == 'page') { 39 redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_CR_content', get_contest_name($_GET['contest_id']))) . '#results'); 40 } else if (!isset($_DUPLICATE)) { 41 $page['infos'][] = l10n('CR_results_saved'); 42 } 29 43 } 30 44 … … 32 46 // Affichage des résultats 33 47 // +-----------------------------------------------------------------------+ 34 if (isset($_GET['msg']) AND $_GET['msg'] == 'saved') 35 array_push($page['infos'], l10n('CR_results_saved')); 48 49 if (!get_contest_name($_GET['contest_id'])) { 50 redirect(CR_ADMIN .'-manage&msg=errors.notavailable'); 36 51 37 38 // Nom du concours39 $query = "SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";";40 $contest = pwg_db_fetch_assoc(pwg_query($query));52 } else { 53 // Nom du concours 54 $query = "SELECT name FROM " . CR_TABLE_1 . " WHERE id = " . $_GET['contest_id'] . ";"; 55 $contest = pwg_db_fetch_assoc(pwg_query($query)); 41 56 42 $template->assign(array(43 'NAME' => trigger_event('render_CR_content', $contest['name']),44 'CONTEST_ID' => $_GET['contest_id']45 ));57 $template->assign(array( 58 'NAME' => trigger_event('render_CR_content', $contest['name']), 59 'CONTEST_ID' => $_GET['contest_id'] 60 )); 46 61 47 // Résultats 48 $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;"); 62 // Résultats en double 63 if (isset($_DUPLICATE)) { 64 foreach ($_DUPLICATE AS $result) { 65 $data = array( 66 'RANK' => 0, 67 'IMAGE_ID' => $result['image_id'], 68 'AUTHOR' => $result['author'], 69 'COMMENT' => $result['comment'], 70 'ERROR' => true, 71 ); 72 73 // Infos de l'image 74 $image = pwg_query("SELECT id, name, file, path, tn_ext 75 FROM " . IMAGES_TABLE . " 76 WHERE id = " . $result['image_id'] . ";"); 77 78 if (!pwg_db_num_rows($image)) { 79 $themeconf = $template->get_template_vars('themeconf'); 80 $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 81 $data['IMAGE_NAME'] = 'N/A'; 82 } else { 83 $image = pwg_db_fetch_assoc($image); 84 $data['TN_SRC'] = get_thumbnail_url($image); 85 $data['IMAGE_NAME'] = (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name']; 86 } 87 88 $page['errors'][] = l10n_dec('CR_duplicate_result %d', 'CR_duplicate_result %d', $result['image_id']); 89 $template->append('results', $data); 90 } 91 } 49 92 50 while ($result = pwg_db_fetch_assoc($results)) { 51 $data = array( 52 'RANK' => $result['rank'], 53 'IMAGE_ID' => $result['image_id'], 54 'AUTHOR' => $result['author'], 55 'COMMENT' => $result['comment'], 56 ); 57 58 // Infos de l'image 59 $image = pwg_query("SELECT id, name, file, path, tn_ext 60 FROM " . IMAGES_TABLE . " 61 WHERE id = " . $result['image_id'] . ";"); 62 63 if (!pwg_db_num_rows($image)) { 64 $themeconf = $template->get_template_vars('themeconf'); 65 $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 66 $data['IMAGE_NAME'] = 'N/A'; 67 $page['errors'][] = l10n_dec('CR_id_unknown %d', 'CR_id_unknown %d', $result['image_id']); 93 // Résultats enregistrés 94 $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id = " . $_GET['contest_id'] . " ORDER BY rank;"); 95 96 while ($result = pwg_db_fetch_assoc($results)) { 97 $data = array( 98 'RANK' => $result['rank'], 99 'IMAGE_ID' => $result['image_id'], 100 'AUTHOR' => $result['author'], 101 'COMMENT' => $result['comment'], 102 ); 68 103 69 } else { 70 $image = pwg_db_fetch_assoc($image); 71 $data['TN_SRC'] = get_thumbnail_url($image); 72 $data['IMAGE_NAME'] = (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name']; 104 // Infos de l'image 105 $image = pwg_query("SELECT id, name, file, path, tn_ext 106 FROM " . IMAGES_TABLE . " 107 WHERE id = " . $result['image_id'] . ";"); 108 109 if (!pwg_db_num_rows($image)) { 110 $themeconf = $template->get_template_vars('themeconf'); 111 $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 112 $data['IMAGE_NAME'] = 'N/A'; 113 $data['ERROR'] = true; 114 $page['errors'][] = l10n_dec('CR_id_unknown %d', 'CR_id_unknown %d', $result['image_id']); 115 } else { 116 $image = pwg_db_fetch_assoc($image); 117 $data['TN_SRC'] = get_thumbnail_url($image); 118 $data['IMAGE_NAME'] = (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name']; 119 } 120 121 $template->append('results', $data); 73 122 } 74 75 $template->append('results', $data); 123 124 // +-----------------------------------------------------------------------+ 125 // Template 126 // +-----------------------------------------------------------------------+ 127 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/results.tpl')); 128 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 76 129 } 77 130 78 // +-----------------------------------------------------------------------+79 // Template80 // +-----------------------------------------------------------------------+81 $template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/template/results.tpl'));82 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');83 131 ?> -
extensions/ContestResults/admin/template/config.tpl
r9572 r9745 1 {combine_script id='jquery' path='themes/default/js/jquery.min.js'} 2 {combine_css id='cr_admin_style' path=$CR_PATH|@cat:'admin/template/style.css'} 1 {combine_css path=$CR_PATH|@cat:'admin/template/style.css'} 3 2 4 {html_head} 5 <style type="text/css"> 6 tr td:first-child {ldelim} 7 max-width:300px; 8 min-width:300px; 3 {footer_script require='jquery'} 4 {literal} 5 function ToggleConfig(sel, section) { 6 var obj = jQuery('#config_'+section); 7 if (sel.checked) { 8 obj.show(); 9 } else { 10 obj.hide(); 9 11 } 10 </style>12 } 11 13 12 <script type="text/javascript"> 13 function ToggleConfig(sel, section){ldelim} 14 var obj = jQuery('#config_'+section); 15 if(sel.checked){ldelim} 16 obj.show(); 17 }else{ldelim} 18 obj.hide(); 19 } 20 } 21 </script> 22 {/html_head} 14 ToggleConfig(document.forms['CR_config'].elements['menubar_mode_link'], 'link'); 15 ToggleConfig(document.forms['CR_config'].elements['menubar_mode_block'], 'block'); 16 {/literal} 17 {/footer_script} 23 18 24 <h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>19 <h2 class="version_title">{$CR_VERSION}</h2> 25 20 26 21 <div class="titrePage"> … … 28 23 </div> 29 24 30 <form method="post" action="" class="properties"> 25 <form method="post" action="" class="properties" id="CR_config"> 26 <fieldset> 27 <legend>{'Preferences'|@translate}</legend> 28 29 <table> 30 <tr> 31 <td><span class="title">{'CR_truncate_summary'|@translate}</span></td> 32 <td><input type="text" size="3" name="truncate_summary" value="{$TRUNCATE_SUMMARY}"/></td> 33 </tr> 34 </table> 35 </fieldset> 36 31 37 <fieldset> 32 38 <legend>{'Menu'|@translate}</legend> … … 56 62 <tr> 57 63 <td><span class="title">{'CR_menubar_block_number'|@translate}</span></td> 58 <td><input type="text" size="2" maxlength="2"name="menubar_block_number" value="{$BLOCK_NUMBER}"/></td>64 <td><input type="text" size="2" name="menubar_block_number" value="{$BLOCK_NUMBER}"/></td> 59 65 </tr> 60 66 </table> … … 63 69 <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="config_submit"/></p> 64 70 </form> 65 66 <script type="text/javascript">67 ToggleConfig(document.forms[0].elements['menubar_mode_link'], 'link');68 ToggleConfig(document.forms[0].elements['menubar_mode_block'], 'block');69 </script> -
extensions/ContestResults/admin/template/manage.tpl
r9572 r9745 1 {combine_css id='cr_admin_style'path=$CR_PATH|@cat:'admin/template/style.css'}1 {combine_css path=$CR_PATH|@cat:'admin/template/style.css'} 2 2 3 <h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>3 <h2 class="version_title">{$CR_VERSION}</h2> 4 4 5 5 <div class="titrePage"> … … 7 7 </div> 8 8 9 {if !isset($contests_pending) and !isset($contests_ finished)}9 {if !isset($contests_pending) and !isset($contests_running) and !isset($contests_finished)} 10 10 {'CR_no_contest'|@translate}<br> 11 <a href=" admin.php?page=plugin§ion=ContestResults/admin/admin.php&tab=new">{'CR_new_tab'|@translate}</a>11 <a href="{$CR_ADMIN}&tab=new">{'CR_new_tab'|@translate}</a> 12 12 {/if} 13 13 14 14 {if isset($contests_pending)} 15 <fieldset> 16 <legend>{'CR_pending_title'|@translate}</legend> 17 <form id="categoryOrdering"> 18 <ul class="categoryUl"> 19 {foreach from=$contests_pending item=contest name=pending_loop} 20 <li class="categoryLi {if $smarty.foreach.pending_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}novisible{/if}"> 21 <ul class="categoryActions"> 22 <li> 23 <a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}"> 24 <img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/> 25 </a> 26 </li> 27 <li> 28 <a href="{$contest.U_RESULTS}" title="{'CR_results_tab'|@translate}"> 29 <img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'CR_results_tab'|@translate}"/> 30 </a> 31 </li> 32 <li> 33 <a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> 34 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" /> 35 </a> 36 </li> 37 </ul> 38 <p> 39 {if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if} 40 <strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END} 41 <span class="CR_finished">{$contest.DAYS} {'CR_days'|@translate}</span> 42 </p> 15 <fieldset> 16 <legend>{'CR_pending_title'|@translate}</legend> 17 <form id="categoryOrdering"> 18 <ul class="categoryUl"> 19 {foreach from=$contests_pending item=contest name=pending_loop} 20 <li class="categoryLi {if $smarty.foreach.pending_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}novisible{/if}"> 21 <ul class="categoryActions"> 22 <li> 23 <a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}"> 24 <img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/> 25 </a> 43 26 </li> 44 {/foreach} 45 </ul> 46 </form> 47 </fieldset> 27 <li> 28 <a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> 29 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" /> 30 </a> 31 </li> 32 </ul> 33 <p> 34 {if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if} 35 <strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END} 36 <span class="CR_finished">{$contest.DAYS}</span> 37 </p> 38 </li> 39 {/foreach} 40 </ul> 41 </form> 42 </fieldset> 43 {/if} 44 45 {if isset($contests_running)} 46 <fieldset> 47 <legend>{'CR_running_title'|@translate}</legend> 48 <form id="categoryOrdering"> 49 <ul class="categoryUl"> 50 {foreach from=$contests_running item=contest name=running_loop} 51 <li class="categoryLi {if $smarty.foreach.running_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}novisible{/if}"> 52 <ul class="categoryActions"> 53 <li> 54 <a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}"> 55 <img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/> 56 </a> 57 </li> 58 <li> 59 <a href="{$contest.U_RESULTS}" title="{'CR_results_tab'|@translate}"> 60 <img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'CR_results_tab'|@translate}"/> 61 </a> 62 </li> 63 <li> 64 <a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> 65 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" /> 66 </a> 67 </li> 68 </ul> 69 <p> 70 {if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if} 71 <strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END} 72 <span class="CR_finished">{$contest.DAYS}</span> 73 </p> 74 </li> 75 {/foreach} 76 </ul> 77 </form> 78 </fieldset> 48 79 {/if} 49 80 50 81 {if isset($contests_finished)} 51 <fieldset> 52 <legend>{'CR_finished_title'|@translate}</legend> 53 <form id="categoryOrdering"> 54 <ul class="categoryUl"> 55 {foreach from=$contests_finished item=contest name=finished_loop} 56 <li class="categoryLi {if $smarty.foreach.finished_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}novisible{/if}"> 57 <ul class="categoryActions"> 58 <li> 59 <a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}"> 60 <img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/> 61 </a> 62 </li> 63 <li> 64 <a href="{$contest.U_RESULTS}" title="{'CR_results_tab'|@translate}"> 65 <img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'CR_results_tab'|@translate}"/> 66 </a> 67 </li> 68 <li> 69 <a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> 70 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" /> 71 </a> 72 </li> 73 </ul> 74 <p> 75 {if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if} 76 <strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END} 77 </p> 82 <fieldset> 83 <legend>{'CR_finished_title'|@translate}</legend> 84 <form id="categoryOrdering"> 85 <ul class="categoryUl"> 86 {foreach from=$contests_finished item=contest name=finished_loop} 87 <li class="categoryLi {if $smarty.foreach.finished_loop.index is odd}virtual_cat{/if} {if $contest.VISIBLE == 0}novisible{/if}"> 88 <ul class="categoryActions"> 89 <li> 90 <a href="{$contest.U_EDIT}" title="{'CR_edit_tab'|@translate}"> 91 <img src="{$themeconf.admin_icon_dir}/category_edit.png" class="button" alt="{'CR_edit_tab'|@translate}"/> 92 </a> 78 93 </li> 79 {/foreach} 80 </ul> 81 </form> 82 </fieldset> 94 <li> 95 <a href="{$contest.U_RESULTS}" title="{'CR_results_tab'|@translate}"> 96 <img src="{$themeconf.admin_icon_dir}/category_elements.png" class="button" alt="{'CR_results_tab'|@translate}"/> 97 </a> 98 </li> 99 <li> 100 <a href="{$contest.U_DELETE}" title="{'CR_delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> 101 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete'|@translate}" /> 102 </a> 103 </li> 104 </ul> 105 <p> 106 {if !empty($contest.LOGO)}<img src="{$contest.LOGO}" width="13px" class="button"/>{/if} 107 <strong><a href="{$contest.URL}" title="{'CR_go'|@translate}">{$contest.NAME}</a></strong> - {$contest.DATE_BEGIN} | {$contest.DATE_END} 108 <span class="CR_finished">{$contest.DAYS}</span> 109 </p> 110 </li> 111 {/foreach} 112 </ul> 113 </form> 114 </fieldset> 83 115 {/if} -
extensions/ContestResults/admin/template/new.tpl
r9572 r9745 1 {combine_script id='jquery ' path='themes/default/js/jquery.min.js'}2 {combine_script id='jquery.ui ' path='themes/default/js/ui/minified/jquery.ui.core.min.js'}3 {combine_script id='jquery. ui.sortable' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'}4 {combine_script id='jquery.cluetip' path='themes/default/js/plugins/jquery.cluetip.packed.js'} 5 {combine_css id='cr_admin_style'path=$CR_PATH|@cat:'admin/template/style.css'}1 {combine_script id='jquery.ui' require='jquery' path='themes/default/js/ui/minified/jquery.ui.core.min.js'} 2 {combine_script id='jquery.ui.sortable' require='jquery' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'} 3 {combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'} 4 5 {combine_css path=$CR_PATH|@cat:'admin/template/style.css'} 6 6 {include file='include/autosize.inc.tpl'} 7 7 {include file='include/datepicker.inc.tpl'} 8 8 9 {footer_script require='jquery'} 10 // AJOUTE UN CHAMP DE RESULTAT 11 function CreateDescField(j, new_desc){ldelim} 12 // Si il n'y a aucun résultats on efface le message 13 if(new_desc) jQuery('#categoryUl').html(''); 14 15 // Ajoute à la fin de la liste une nouvelle ligne de résultat vide 16 jQuery('<li id="desc_'+ j +'" class="categoryLi virtual_cat"></li>').appendTo('#categoryUl'); 17 18 // Contenu de la ligne 19 jQuery('#desc_'+ j).html('<ul class="categoryActions"> '+ 20 '<li> '+ 21 '<a href="#" title="{'CR_delete_desc'|@translate}" onclick="jQuery(\'#desc_'+ j +'\').remove();return false;"> '+ 22 '<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> '+ 23 '</a> '+ 24 '</li> '+ 25 '</ul> '+ 26 '<p> '+ 27 '<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}"> '+ 28 '<input type="text" size="65" name="description['+ j +'][name]" value=""/> '+ 29 '<textarea class="result_comment" name="description['+ j +'][content]"></textarea> '+ 30 '</p> '+ 31 '<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="description['+ j +'][rank]" value=""/></p>'); 32 33 // Remplace le lien de création 34 jQuery('#AddLink').html('<input class="submit" type="reset" onclick="CreateDescField('+ (j+1) +');return false;" value="{'CR_addfield'|@translate}"/>'); 35 36 // Réinitiliase les fonctions jQuery 37 jQuery('.catPos').hide(); 38 jQuery('.drag_button').show(); 39 jQuery('.categoryLi').css('cursor', 'move'); 40 jQuery('textarea').autogrow(); 41 jQuery('textarea').css('overflow-y', 'hidden'); 42 } 43 44 {literal} 45 jQuery().ready(function(){ 46 // Drag-and-Drop 47 jQuery('.catPos').hide(); 48 jQuery('.drag_button').show(); 49 jQuery('.categoryLi').css('cursor', 'move'); 50 jQuery('.categoryUl').sortable({ 51 axis: 'y', 52 opacity: 0.8 53 }); 54 jQuery('#categoryOrdering').submit(function(){ 55 ar = jQuery('.categoryUl').sortable('toArray'); 56 for(i=0; i<ar.length; i++) { 57 cat = ar[i].split('desc_'); 58 document.getElementsByName('description[' + cat[1] + '][rank]')[0].value = i+1; 59 } 60 }); 61 // Cluetip 62 jQuery('.cluetip').cluetip({ 63 width: 550, 64 splitTitle: '|' 65 }); 66 }); 67 68 $(function() { 69 $('#DateBegin').datepicker({dateFormat:'yy-mm-dd', firstDay:1}); 70 $('#DateEnd').datepicker({dateFormat:'yy-mm-dd', firstDay:1}); 71 }); 72 {/literal} 73 {/footer_script} 74 9 75 {html_head} 10 <script type="text/javascript"> 11 // AJOUTE UN CHAMP DE RESULTAT 12 function CreateDescField(j, new_contest){ldelim} 13 // Si il n'y a aucun résultats on efface le message 14 if(new_contest) document.getElementById('categoryUl').innerHTML = ''; 15 16 // Ajoute à la fin de la liste une nouvelle ligne de résultat vide 17 var new_result = document.createElement('li'); 18 new_result.setAttribute('id', 'desc_'+(j)); 19 new_result.setAttribute('class', 'categoryLi virtual_cat'); 20 document.getElementById('categoryUl').appendChild(new_result); 21 22 // Contenu de la ligne 23 new_result.innerHTML = '<ul class="categoryActions"> '+ 24 '<li> '+ 25 '<a href="#" title="{'CR_delete_desc'|@translate}" onclick="DeleteDescField('+ j +');return false;"> '+ 26 '<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> '+ 27 '</a> '+ 28 '</li> '+ 29 '</ul> '+ 30 '<p> '+ 31 '<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}"> '+ 32 '<input type="text" size="65" name="description['+ j +'][name]" value=""/> '+ 33 '<textarea class="result_comment" name="description['+ j +'][content]"></textarea> '+ 34 '</p> '+ 35 '<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="description['+ j +'][rank]" value=""/></p>'; 36 37 // Remplace le lien de création 38 document.getElementById('AddLink').innerHTML = '<input class="submit" type="reset" onclick="CreateDescField('+ (j+1) +');return false;" value="{'CR_addfield'|@translate}"/>'; 39 40 // Réinitiliase les fonctions jQuery 41 jQuery('.catPos').hide(); 42 jQuery('.drag_button').show(); 43 jQuery('.categoryLi').css('cursor', 'move'); 44 jQuery('textarea').autogrow(); 45 jQuery('textarea').css('overflow-y', 'hidden'); 46 vtip(); 47 } 48 49 // SUPPRIME UN CHAMP DE RESULTAT 50 function DeleteDescField(k){ldelim} 51 var result = document.getElementById('desc_'+k); 52 var parent = result.parentNode; 53 parent.removeChild(result); 54 } 55 56 jQuery().ready(function(){ldelim} 57 // Drag-and-Drop 58 jQuery('.catPos').hide(); 59 jQuery('.drag_button').show(); 60 jQuery('.categoryLi').css('cursor', 'move'); 61 jQuery('.categoryUl').sortable({ldelim} 62 axis: 'y', 63 opacity: 0.8 64 }); 65 jQuery('#categoryOrdering').submit(function(){ldelim} 66 ar = jQuery('.categoryUl').sortable('toArray'); 67 for(i=0; i<ar.length; i++) {ldelim} 68 cat = ar[i].split('desc_'); 69 document.getElementsByName('description[' + cat[1] + '][rank]')[0].value = i+1; 70 } 71 }); 72 // Cluetip 73 jQuery('.cluetip').cluetip({ldelim} 74 width: 550, 75 splitTitle: '|' 76 }); 77 }); 78 79 $(function() {ldelim} 80 $('#DateBegin').datepicker({ldelim}dateFormat:'yy-mm-dd', firstDay:1}); 81 $('#DateEnd').datepicker({ldelim}dateFormat:'yy-mm-dd', firstDay:1}); 82 }); 83 </script> 84 85 <style type="text/css"> 86 .cluetip:after {ldelim} 87 content:url('{$themeconf.admin_icon_dir}/help.png'); 88 } 89 </style> 76 <style type="text/css"> 77 .cluetip:after {ldelim} 78 content:url('{$themeconf.admin_icon_dir}/help.png'); 79 } 80 </style> 90 81 {/html_head} 91 82 92 <h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>83 <h2 class="version_title">{$CR_VERSION}</h2> 93 84 94 85 <div class="titrePage"> … … 159 150 <ul class="categoryActions"> 160 151 <li> 161 <a href="#" title="{'CR_delete_desc'|@translate}" onclick=" DeleteDescField({$i});return false;">152 <a href="#" title="{'CR_delete_desc'|@translate}" onclick="jQuery('#desc_{$i}').remove();return false;"> 162 153 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> 163 154 </a> -
extensions/ContestResults/admin/template/results.tpl
r9572 r9745 1 {combine_script id='jquery ' path='themes/default/js/jquery.min.js'}2 {combine_script id='jquery.ui ' path='themes/default/js/ui/minified/jquery.ui.core.min.js'}3 {combine_script id='jquery. ui.sortable' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'}4 {combine_script id='jquery. cluetip' path='themes/default/js/plugins/jquery.cluetip.packed.js'}5 {combine_script id='jquery.vtip' path=$CR_PATH|@cat:'admin/template/vtip.js'} 6 {combine_css id='cr_admin_style'path=$CR_PATH|@cat:'admin/template/style.css'}1 {combine_script id='jquery.ui' require='jquery' path='themes/default/js/ui/minified/jquery.ui.core.min.js'} 2 {combine_script id='jquery.ui.sortable' require='jquery' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'} 3 {combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'} 4 {combine_script id='jquery.vtip' require='jquery' path=$CR_PATH|@cat:'admin/template/vtip.js'} 5 6 {combine_css path=$CR_PATH|@cat:'admin/template/style.css'} 7 7 {include file='include/autosize.inc.tpl'} 8 8 9 {footer_script require='jquery'} 10 // AJOUTE UN CHAMP DE RESULTAT 11 function CreateResultField(j, new_contest){ldelim} 12 // Si il n'y a aucun résultats on efface le message 13 if(new_contest) jQuery('#categoryUl').html(''); 14 15 // Ajoute à la fin de la liste une nouvelle ligne de résultat vide 16 jQuery('<li id="result_'+ j +'" class="categoryLi virtual_cat"></li>').appendTo('#categoryUl'); 17 18 // Contenu de la ligne 19 jQuery('#result_'+ j).html('<ul class="categoryActions"> '+ 20 '<li> '+ 21 '<a href="#" title="{'CR_delete_result'|@translate}" onclick="jQuery(\'#result_'+ j +'\').remove();return false;"> '+ 22 '<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> '+ 23 '</a> '+ 24 '</li> '+ 25 '</ul> '+ 26 '<p> '+ 27 '<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}"> '+ 28 '{'CR_image_no'|@translate} <input type="text" size="6" name="results['+ j +'][image_id]" value="" onkeyup="UpdatePreview('+ j +', this);"/> '+ 29 '<span id="preview-'+ j +'"> '+ 30 '<span class="vtip" title="<img src=\'admin/themes/default/icon/errors.png\'/><br>N/A"> '+ 31 '<img src="{$CR_PATH}admin/template/image/images.png"/> '+ 32 '</span> '+ 33 '</span> '+ 34 '{'CR_author'|@translate} : <input type="text" name="results['+ j +'][author]" value=""/> '+ 35 '<textarea class="result_comment" name="results['+ j +'][comment]"></textarea> '+ 36 '</p> '+ 37 '<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="results['+ j +'][rank]" value=""/></p>'); 38 39 // Remplace le lien de création 40 jQuery('#AddLink').html('<input class="submit" type="reset" onclick="CreateResultField('+ (j+1) +');return false;" value="{'CR_addfield'|@translate}"/>'); 41 42 // Réinitiliase les fonctions jQuery 43 jQuery('.catPos').hide(); 44 jQuery('.drag_button').show(); 45 jQuery('.categoryLi').css('cursor', 'move'); 46 jQuery('textarea').autogrow(); 47 jQuery('textarea').css('overflow-y', 'hidden'); 48 vtip(); 49 } 50 51 // MET A JOUR LA PREVISUALISATION DE L'IMAGE 52 function UpdatePreview(image_id, input){ldelim} 53 $.get("{$CR_PATH}admin/get_tn.php", {ldelim}image_id: input.value}, 54 function success(data){ldelim} 55 document.getElementById('preview-'+image_id).innerHTML = '<span class="vtip" title="'+ data + '">'+ 56 '<img src="{$CR_PATH}admin/template/image/images.png"/>'+ 57 '</span>'; 58 vtip(); 59 } 60 ); 61 } 62 63 {literal} 64 jQuery().ready(function(){ 65 // Drag-and-Drop 66 jQuery('.catPos').hide(); 67 jQuery('.drag_button').show(); 68 jQuery('.categoryLi').css('cursor', 'move'); 69 jQuery('.categoryUl').sortable({ 70 axis: 'y', 71 opacity: 0.8 72 }); 73 jQuery('#categoryOrdering').submit(function(){ 74 ar = jQuery('.categoryUl').sortable('toArray'); 75 for(i=0; i<ar.length; i++) { 76 cat = ar[i].split('result_'); 77 document.getElementsByName('results[' + cat[1] + '][rank]')[0].value = i+1; 78 } 79 }); 80 // Cluetip 81 jQuery('.cluetip').cluetip({ 82 width: 550, 83 splitTitle: '|' 84 }); 85 }); 86 {/literal} 87 {/footer_script} 88 9 89 {html_head} 10 <script type="text/javascript"> 11 // AJOUTE UN CHAMP DE RESULTAT 12 function CreateResultField(j, new_contest){ldelim} 13 // Si il n'y a aucun résultats on efface le message 14 if(new_contest) document.getElementById('categoryUl').innerHTML = ''; 15 16 // Ajoute à la fin de la liste une nouvelle ligne de résultat vide 17 var new_result = document.createElement('li'); 18 new_result.setAttribute('id', 'result_'+(j)); 19 new_result.setAttribute('class', 'categoryLi virtual_cat'); 20 document.getElementById('categoryUl').appendChild(new_result); 21 22 // Contenu de la ligne 23 new_result.innerHTML = '<ul class="categoryActions"> '+ 24 '<li> '+ 25 '<a href="#" title="{'CR_delete_result'|@translate}" onclick="DeleteResultField('+ j +');return false;"> '+ 26 '<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> '+ 27 '</a> '+ 28 '</li> '+ 29 '</ul> '+ 30 '<p> '+ 31 '<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}"> '+ 32 '{'CR_image_no'|@translate} <input type="text" size="6" name="results['+ j +'][image_id]" value="" onkeyup="UpdatePreview('+ j +', this);"/> '+ 33 '<span id="preview-'+ j +'"> '+ 34 '<span class="vtip" title="<img src=\'admin/themes/default/icon/errors.png\'/><br>N/A"> '+ 35 '<img src="{$CR_PATH}admin/template/image/images.png"/> '+ 36 '</span> '+ 37 '</span> '+ 38 '{'CR_author'|@translate} : <input type="text" name="results['+ j +'][author]" value=""/> '+ 39 '<textarea class="result_comment" name="results['+ j +'][comment]"></textarea> '+ 40 '</p> '+ 41 '<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="results['+ j +'][rank]" value=""/></p>'; 42 43 // Remplace le lien de création 44 document.getElementById('AddLink').innerHTML = '<input class="submit" type="reset" onclick="CreateResultField('+ (j+1) +');return false;" value="{'CR_addfield'|@translate}"/>'; 45 46 // Réinitiliase les fonctions jQuery 47 jQuery('.catPos').hide(); 48 jQuery('.drag_button').show(); 49 jQuery('.categoryLi').css('cursor', 'move'); 50 jQuery('textarea').autogrow(); 51 jQuery('textarea').css('overflow-y', 'hidden'); 52 vtip(); 53 } 54 55 // SUPPRIME UN CHAMP DE RESULTAT 56 function DeleteResultField(k){ldelim} 57 var result = document.getElementById('result_'+k); 58 var parent = result.parentNode; 59 parent.removeChild(result); 60 } 61 62 jQuery().ready(function(){ldelim} 63 // Drag-and-Drop 64 jQuery('.catPos').hide(); 65 jQuery('.drag_button').show(); 66 jQuery('.categoryLi').css('cursor', 'move'); 67 jQuery('.categoryUl').sortable({ldelim} 68 axis: 'y', 69 opacity: 0.8 70 }); 71 jQuery('#categoryOrdering').submit(function(){ldelim} 72 ar = jQuery('.categoryUl').sortable('toArray'); 73 for(i=0; i<ar.length; i++) {ldelim} 74 cat = ar[i].split('result_'); 75 document.getElementsByName('results[' + cat[1] + '][rank]')[0].value = i+1; 76 } 77 }); 78 // Cluetip 79 jQuery('.cluetip').cluetip({ldelim} 80 width: 550, 81 splitTitle: '|' 82 }); 83 }); 84 85 // MET A JOUR LA PREVISUALISATION DE L'IMAGE 86 function UpdatePreview(image_id, input){ldelim} 87 $.get("{$CR_PATH}admin/get_tn.php", {ldelim}image_id: input.value}, 88 function success(data){ldelim} 89 document.getElementById('preview-'+image_id).innerHTML = '<span class="vtip" title="'+ data + '">'+ 90 '<img src="{$CR_PATH}admin/template/image/images.png"/>'+ 91 '</span>'; 92 vtip(); 93 } 94 ); 95 } 96 </script> 97 98 <style type="text/css"> 99 .cluetip:after {ldelim} 100 content:url('{$themeconf.admin_icon_dir}/help.png'); 101 } 102 </style> 90 <style type="text/css"> 91 .cluetip:after {ldelim} 92 content:url('{$themeconf.admin_icon_dir}/help.png'); 93 } 94 </style> 103 95 {/html_head} 104 96 105 <h2 style="float:right;top:-24px;position:relative;font-style:italic;margin-bottom:-20px;font-size:12px;font-weight:normal;">{$CR_VERSION}</h2>97 <h2 class="version_title">{$CR_VERSION}</h2> 106 98 107 99 <div class="titrePage"> … … 114 106 {if isset($results)} 115 107 {foreach from=$results item=result} 116 <li class="categoryLi {if $result.IMAGE_NAME == 'N/A'}error_cat{/if}" id="result_{$i}">108 <li class="categoryLi {if isset($result.ERROR)}error_cat{/if}" id="result_{$i}"> 117 109 <ul class="categoryActions"> 118 110 <li> 119 <a href="#" title="{'CR_delete_result'|@translate}" onclick=" DeleteResultField({$i});return false;">111 <a href="#" title="{'CR_delete_result'|@translate}" onclick="jQuery('#result_{$i}').remove();return false;"> 120 112 <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> 121 113 </a> -
extensions/ContestResults/admin/template/style.css
r9572 r9745 1 .titrePage {2 clear:right;3 }4 .titrePage h2 {5 text-align:center;6 }7 8 1 .result_comment { 9 2 width:95%; … … 71 64 color:#a00; 72 65 } 66 67 #CR_config tr td:first-child { 68 max-width:300px; 69 min-width:300px; 70 } 71 72 .version_title { 73 float:right; 74 position:relative; 75 top:-24px; 76 margin-bottom:-20px !important; 77 font-size:12px !important; 78 font-style:italic; 79 font-weight:normal; 80 } -
extensions/ContestResults/changelog.txt
r9572 r9745 1 1.3 1 1.3.b 2 - Use new admin links and javascript implementation 3 - Distinguish pending and running contests (both pending before) 4 - Tables are created in utf8 5 - New bloc for PWG Stuffs 6 7 1.3.a 2 8 - Add error and success messages on admin page 3 9 - Add Spain (es_ES) thanks to jpr928 -
extensions/ContestResults/include/cr_main.php
r9572 r9745 17 17 18 18 while ($contest = pwg_db_fetch_assoc($contests)) { 19 $contest = array_merge($contest, get_contest_status($contest['date_begin'],$contest['date_end'])); 20 19 21 if ($contest['visible'] OR is_admin()) { 20 $contest['finished'] = is_date_passed($contest['date_end']);21 22 22 // infos sur le concours 23 23 $item = array( … … 25 25 'NAME' => trigger_event('render_CR_content', $contest['name']), 26 26 'VISIBLE' => $contest['visible'], 27 ' FINISHED' => $contest['finished'],27 'STATUS' => $contest['status'], 28 28 'DATE_END' => format_date($contest['date_end']), 29 29 'DATE_BEGIN' => format_date($contest['date_begin']), 30 30 'LOGO' => $contest['logo'], 31 'SUMMARY' => CR_cut_string(trigger_event('render_CR_content', $contest['summary']), 350),31 'SUMMARY' => CR_cut_string(trigger_event('render_CR_content', $contest['summary']), $conf['ContestResults']['truncate_summary']), 32 32 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 33 'DAYS' => DateDiff($contest['date_end'], date('Y-m-d')),33 'DAYS' => $contest['days'], 34 34 ); 35 35 36 36 // podium si terminé 37 if ($contest[' finished'] == true) {37 if ($contest['status'] == 'finished') { 38 38 $results = pwg_query("SELECT 39 39 i.id, -
extensions/ContestResults/include/cr_menubar.php
r9572 r9745 5 5 // Triggers 6 6 // +-----------------------------------------------------------------------+ 7 $config = unserialize($conf['ContestResults']); 8 if ($config['menubar_mode']['block']) { 7 if ($conf['ContestResults']['menubar_mode']['block']) { 9 8 add_event_handler('blockmanager_register_blocks', 'CR_register_menubar_blocks'); 10 9 } … … 25 24 function CR_menubar_apply($menu_ref_arr) { 26 25 global $template, $conf; 27 $config = unserialize($conf['ContestResults']);26 //$config = unserialize($conf['ContestResults']); 28 27 $menu = &$menu_ref_arr[0]; 29 28 … … 43 42 44 43 $m = 0; // compteur pour limiter le nombre de concours affichés 45 while($contest = pwg_db_fetch_assoc($contests)){ 46 if (($contest['visible'] OR is_admin()) AND $m < $config['menubar_block']['number']) { 44 while ($contest = pwg_db_fetch_assoc($contests)) { 45 $contest = array_merge($contest, get_contest_status($contest['date_begin'],$contest['date_end'])); 46 47 if (($contest['visible'] OR is_admin()) AND $m < $conf['ContestResults']['menubar_block']['number']) { 47 48 array_push($data, array( 48 49 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), … … 50 51 'DATE' => format_date($contest['date_begin']) . ' - ' . format_date($contest['date_end']), 51 52 'VISIBLE' => $contest['visible'], 52 ' FINISHED' => is_date_passed($contest['date_end']),53 'DAYS' => DateDiff($contest['date_end'],date('Y-m-d')),53 'STATUS' => $contest['status'], 54 'DAYS' => $contest['days'], 54 55 )); 55 56 } … … 67 68 68 69 // Block Menu - ajout d'un lien dans le bloc Menu 69 if ($conf ig['menubar_mode']['link'] AND $config['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null) {70 if ($conf['ContestResults']['menubar_mode']['link'] AND $conf['ContestResults']['menubar_link']['menu'] AND ($block = $menu->get_block('mbMenu')) != null) { 70 71 array_push($block->data, array( 71 72 'URL' => CR_PUBLIC, … … 76 77 77 78 // Block Specials - ajout d'un lien dans le bloc Specials 78 if($conf ig['menubar_mode']['link'] AND $config['menubar_link']['specials'] AND ($block = $menu->get_block('mbSpecials')) != null){79 if($conf['ContestResults']['menubar_mode']['link'] AND $conf['ContestResults']['menubar_link']['specials'] AND ($block = $menu->get_block('mbSpecials')) != null){ 79 80 array_push($block->data, array( 80 81 'URL' => CR_PUBLIC, -
extensions/ContestResults/include/cr_page.php
r9572 r9745 6 6 // +-----------------------------------------------------------------------+ 7 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']);8 $template->assign('U_EDIT', CR_ADMIN . '-edit&contest_id=' . $page['contest'] . '&redirect=page'); 9 $template->assign('U_RESULTS', CR_ADMIN . '-results&contest_id=' . $page['contest'] . '&redirect=page'); 10 10 } 11 11 12 12 // Infos du concours 13 $contest = pwg_query("SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";"); 13 $contest = pwg_db_fetch_assoc(pwg_query("SELECT * FROM " . CR_TABLE_1 . " WHERE id=" . $page['contest'] . ";")); 14 $contest = array_merge($contest, get_contest_status($contest['date_begin'],$contest['date_end'])); 14 15 15 if (pwg_db_num_rows($contest)) { 16 $contest = pwg_db_fetch_assoc($contest); 17 $contest['finished'] = is_date_passed($contest['date_end']); 18 19 // Concours non-publique 20 if (!$contest['visible']) { 21 check_status(ACCESS_ADMINISTRATOR); 22 } 23 24 // Paramètres généraux 25 $template->assign(array( 26 'ID' => $contest['id'], 27 'NAME' => trigger_event('render_CR_content', $contest['name']), 28 'VISIBLE' => $contest['visible'], 29 'FINISHED' => $contest['finished'], 30 'DATE_BEGIN' => format_date($contest['date_begin']), 31 'DATE_END' => format_date($contest['date_end']), 32 'LOGO' => $contest['logo'], 33 'BANNER' => $contest['banner'], 34 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 35 'DAYS' => DateDiff($contest['date_end'], date('Y-m-d')), 36 )); 37 38 // Les quatre zones texte 39 if (!empty($contest['description'])) { 40 $contest['description'] = unserialize(base64_decode($contest['description'])); 41 foreach ($contest['description'] as $desc) { 42 $template->append('description', array( 43 'NAME' => trigger_event('render_CR_content', stripslashes($desc['name'])), 44 'CONTENT' => trigger_event('render_CR_content', stripslashes($desc['content'])), 45 )); 46 } 47 } 48 49 // Affichage des résultats 50 if ($contest['finished'] == true) { 51 // Infos des résultats 52 $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;"); 53 54 while ($result = pwg_db_fetch_assoc($results)) { 55 // Infos de l'image 56 $query = "SELECT 57 i.id, 58 i.name, 59 i.file, 60 i.path, 61 i.tn_ext, 62 ic.category_id 63 FROM " . IMAGES_TABLE . " AS i 64 INNER JOIN " . IMAGE_CATEGORY_TABLE . " AS ic 65 ON ic.image_id = i.id 66 WHERE i.id = " . $result['image_id'] . ";"; 67 $image = pwg_db_fetch_assoc(pwg_query($query)); 68 69 // retrieving category informations 70 $query = "SELECT 71 id, 72 name, 73 permalink, 74 uppercats 75 FROM " . CATEGORIES_TABLE." 76 WHERE id = " . $image['category_id'] . ";"; 77 $image['cat'] = pwg_db_fetch_assoc(pwg_query($query)); 78 79 // link to the full size picture 80 $image['url'] = make_picture_url(array( 81 'category' => $image['cat'], 82 'image_id' => $image['id'], 83 'image_file' => $image['file'], 84 )); 85 86 // Template 87 if (in_array($result['rank'], array(1,2,3))) { 88 $data = array( 89 'RANK' => $result ['rank'], 90 'AUTHOR' => $result['author'], 91 'IMAGE_SRC' => str_replace('thumbnail/'.$conf['prefix_thumbnail'], null, get_thumbnail_url($image)), 92 'IMAGE_URL' => $image['url'], 93 'IMAGE_NAME' => (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'], 94 'COMMENT' => CR_cut_string(trigger_event('render_CR_content', $result['comment']), 450), 95 ); 96 }else{ 97 $data = array( 98 'RANK' => $result ['rank'], 99 'AUTHOR' => $result['author'], 100 'TN_SRC' => get_thumbnail_url($image), 101 'IMAGE_URL' => $image['url'], 102 'IMAGE_NAME' => (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'], 103 ); 104 } 105 $template->append('RESULTS', $data); 106 } 107 } 108 109 $template->set_filenames(array('index'=> dirname(__FILE__).'/../template/cr_page.tpl')); 110 111 } else { 112 page_not_found(l10n('CR_notavailable')); 16 // Concours non-publique 17 if (!$contest['visible']) { 18 check_status(ACCESS_ADMINISTRATOR); 113 19 } 114 20 21 // Paramètres généraux 22 $template->assign(array( 23 'ID' => $contest['id'], 24 'NAME' => trigger_event('render_CR_content', $contest['name']), 25 'VISIBLE' => $contest['visible'], 26 'STATUS' => $contest['status'], 27 'DATE_BEGIN' => format_date($contest['date_begin']), 28 'DATE_END' => format_date($contest['date_end']), 29 'LOGO' => $contest['logo'], 30 'BANNER' => $contest['banner'], 31 'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])), 32 'DAYS' => $contest['days'], 33 )); 34 35 // Les quatre zones texte 36 if (!empty($contest['description'])) { 37 $contest['description'] = unserialize(base64_decode($contest['description'])); 38 foreach ($contest['description'] as $desc) { 39 $template->append('description', array( 40 'NAME' => trigger_event('render_CR_content', stripslashes($desc['name'])), 41 'CONTENT' => trigger_event('render_CR_content', stripslashes($desc['content'])), 42 )); 43 } 44 } 45 46 // Affichage des résultats 47 if ($contest['status'] == 'finished') { 48 // Infos des résultats 49 $results = pwg_query("SELECT * FROM " . CR_TABLE_2 . " WHERE contest_id=" . $contest['id'] . " ORDER BY rank ASC;"); 50 $i=0; 51 while ($result = pwg_db_fetch_assoc($results)) { 52 $i++; 53 // Infos de l'image 54 $query = "SELECT 55 i.id, 56 i.name, 57 i.file, 58 i.path, 59 i.tn_ext, 60 ic.category_id 61 FROM " . IMAGES_TABLE . " AS i 62 INNER JOIN " . IMAGE_CATEGORY_TABLE . " AS ic 63 ON ic.image_id = i.id 64 WHERE i.id = " . $result['image_id'] . ";"; 65 $image = pwg_db_fetch_assoc(pwg_query($query)); 66 67 // retrieving category informations 68 $query = "SELECT 69 id, 70 name, 71 permalink, 72 uppercats 73 FROM " . CATEGORIES_TABLE." 74 WHERE id = " . $image['category_id'] . ";"; 75 $image['cat'] = pwg_db_fetch_assoc(pwg_query($query)); 76 77 // link to the full size picture 78 $image['url'] = make_picture_url(array( 79 'category' => $image['cat'], 80 'image_id' => $image['id'], 81 'image_file' => $image['file'], 82 )); 83 84 // Template 85 if (in_array($result['rank'], array(1,2,3))) { 86 $data = array( 87 'RANK' => $result ['rank'], 88 'AUTHOR' => $result['author'], 89 'IMAGE_SRC' => str_replace('thumbnail/'.$conf['prefix_thumbnail'], null, get_thumbnail_url($image)), 90 'IMAGE_URL' => $image['url'], 91 'IMAGE_NAME' => (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'], 92 'COMMENT' => CR_cut_string(trigger_event('render_CR_content', $result['comment']), 450), 93 ); 94 }else{ 95 $data = array( 96 'RANK' => $result ['rank'], 97 'AUTHOR' => $result['author'], 98 'TN_SRC' => get_thumbnail_url($image), 99 'IMAGE_URL' => $image['url'], 100 'IMAGE_NAME' => (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'], 101 ); 102 } 103 $template->append('RESULTS', $data); 104 } 105 $template->assign('NB_RESULTS', $i); 106 } 107 108 $template->set_filenames(array('index'=> dirname(__FILE__).'/../template/cr_page.tpl')); 109 115 110 116 111 // +-----------------------------------------------------------------------+ -
extensions/ContestResults/include/functions.php
r9572 r9745 20 20 return $contest['name']; 21 21 } else { 22 return null;22 return false; 23 23 } 24 24 } 25 25 26 26 // Nombre de jours entre deux dates 27 function DateDiff($date2, $date1) {27 function date_diff($date2, $date1) { 28 28 return ceil((strtotime($date2)-strtotime($date1))/(3600*24)); 29 29 } … … 37 37 } 38 38 } 39 40 // Calcul le status d'un concours 41 function get_contest_status($date_begin, $date_end) { 42 if (!is_date_passed($date_begin)) { 43 $contest['status'] = 'pending'; 44 $contest['days'] = l10n_dec('CR_%d_days_to_begin', 'CR_%d_days_to_begin', date_diff($date_begin,date('Y-m-d'))); 45 } else if (is_date_passed($date_end)) { 46 $contest['status'] = 'finished'; 47 $contest['days'] = l10n('CR_finished'); 48 } else { 49 $contest['status'] = 'running'; 50 $contest['days'] = l10n_dec('CR_%d_days_to_end', 'CR_%d_days_to_end', date_diff($date_end,date('Y-m-d'))); 51 } 52 53 return $contest; 54 } 39 55 ?> -
extensions/ContestResults/language/en_UK/plugin.lang.php
r9572 r9745 1 1 <?php 2 2 3 /* général */ 3 4 $lang['Contests'] = 'Contests'; 5 $lang['CR_finished'] = 'Finished'; 6 $lang['CR_results'] = 'Results'; 7 $lang['CR_place'] = 'place'; 8 $lang['CR_nopublic'] = 'This page is not available for the public !'; 9 $lang['CR_notavailable'] = 'This contest is not available'; 10 $lang['CR_%d_days_to_begin'] = "Begins in %d days"; 11 $lang['CR_%d_days_to_end'] = "%d days remaining"; 12 $lang['CR_order_1'] = '1<sup>st</sup>'; 13 $lang['CR_order_2'] = '2<sup>nd</sup>'; 14 $lang['CR_order_3'] = '3<sup>rd</sup>'; 15 $lang['CR_order_sup'] = '<sup>th</sup>'; 16 17 /* admin */ 4 18 $lang['CR_edit_tab'] = 'Edit contest'; 5 19 $lang['CR_delete'] = 'Delete contest'; … … 8 22 $lang['CR_new_tab'] = 'Add a new contest'; 9 23 $lang['CR_results_tab'] = 'Contest results'; 10 $lang['CR_pending_title'] = 'Pending contests';11 $lang['CR_finished_title'] = 'Finished contest';12 $lang['CR_results'] = 'Results';13 24 $lang['CR_go'] = 'Go to the contest page'; 14 25 $lang['CR_title'] = 'Title'; … … 18 29 $lang['CR_logo'] = 'Logo'; 19 30 $lang['CR_banner'] = 'Banner'; 20 $lang['CR_pending'] = 'Pending';21 $lang['CR_finished'] = 'Finished';22 31 $lang['CR_summary'] = 'Summary'; 23 32 $lang['CR_textareas'] = 'Contest description'; … … 30 39 $lang['CR_comment'] = 'Comment'; 31 40 $lang['CR_rank'] = 'Rank'; 32 $lang['CR_place'] = 'place';33 $lang['CR_period'] = 'Period';34 41 $lang['CR_visible'] = 'Public'; 35 $lang['CR_nopublic'] = 'This page is not available for the public !';36 $lang['CR_notavailable'] = 'This contest is not available';37 42 $lang['CR_id_unknown %d'] = "The picture n°%d doesn't exist"; 43 $lang['CR_duplicate_result %d'] = "The picture n°%d appears twice"; 38 44 $lang['CR_contest_saved'] = "Contest settings saved"; 39 45 $lang['CR_contest_added'] = "Contest added"; … … 41 47 $lang['CR_results_saved'] = "Results saved"; 42 48 $lang['CR_name_empty'] = "The name of the contest can't be empty"; 43 $lang['CR_days'] = "days remaining"; 49 $lang['CR_pending_title'] = 'Pending contests'; 50 $lang['CR_running_title'] = 'Contests running'; 51 $lang['CR_finished_title'] = 'Finished contest'; 44 52 45 $lang['CR_order_1'] = '1<sup>st</sup>'; 46 $lang['CR_order_2'] = '2<sup>nd</sup>'; 47 $lang['CR_order_3'] = '3<sup>rd</sup>'; 48 $lang['CR_order_sup'] = '<sup>th</sup>'; 49 50 $lang['CR_menubar_mode'] = 'Add ContestResults to the menu'; 53 /* config */ 54 $lang['CR_menubar_mode'] = 'Add Contest Results to the menu'; 51 55 $lang['CR_menubar_link'] = 'Add a link to a existing menu-block'; 52 56 $lang['CR_menubar_link_display'] = 'Display the link in the following blocks'; 53 57 $lang['CR_menubar_block'] = 'New menu block'; 54 58 $lang['CR_menubar_block_number'] = 'Quantity of contests to display in the block'; 59 $lang['CR_truncate_summary'] = "Truncate the summary of the contest after x characters"; 55 60 61 /* stuffs */ 62 $lang['CR_select_contest'] = "Select one or more contests"; 63 $lang['CR_stuffs_desc'] = "Display one or more contests"; 64 65 /* cluetip */ 56 66 $lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>You can use HTML and multilanguage descriptions.</b>" : "<b>You can use HTML.</b>"; 57 67 $lang['CR_help_title'] = "" . $lang['CR_help_lang']; -
extensions/ContestResults/language/es_ES/plugin.lang.php
r9572 r9745 1 1 <?php 2 2 3 /* général */ 3 4 $lang['Contests'] = 'Concurso'; 5 $lang['CR_finished'] = 'Terminado'; 6 $lang['CR_results'] = 'Resultados'; 7 $lang['CR_place'] = 'sitio'; 8 $lang['CR_nopublic'] = "Esta página no es accesible al público !"; 9 $lang['CR_notavailable'] = "Este concurso no está disponible"; 10 $lang['CR_%d_days_to_begin'] = "Begins in %d days"; 11 $lang['CR_%d_days_to_end'] = "%d days remaining"; 12 $lang['CR_order_1'] = '1<sup>a</sup>'; 13 $lang['CR_order_2'] = '2<sup>0</sup>'; 14 $lang['CR_order_3'] = '3<sup>0</sup>'; 15 $lang['CR_order_sup'] = '<sup>0</sup>'; 16 17 /* admin */ 4 18 $lang['CR_edit_tab'] = 'Edición del Concurso'; 5 19 $lang['CR_delete'] = 'Suprimir el concurso'; … … 8 22 $lang['CR_new_tab'] = 'Añadir un nuevo concurso'; 9 23 $lang['CR_results_tab'] = 'Resultados del Concurso'; 10 $lang['CR_pending_title'] = 'Concursos en curso';11 $lang['CR_finished_title'] = 'Concurso terminado';12 $lang['CR_results'] = 'Resultados';13 24 $lang['CR_go'] = 'Ir a la página del concurso'; 14 25 $lang['CR_title'] = 'Titulo'; … … 18 29 $lang['CR_logo'] = 'Logo'; 19 30 $lang['CR_banner'] = 'Bandera'; 20 $lang['CR_pending'] = 'En curso';21 $lang['CR_finished'] = 'Terminado';22 31 $lang['CR_summary'] = 'Resumen'; 23 32 $lang['CR_textareas'] = 'Descripcion del concurso'; … … 30 39 $lang['CR_comment'] = 'Comentario'; 31 40 $lang['CR_rank'] = 'Rango'; 32 $lang['CR_place'] = 'sitio';33 $lang['CR_period'] = 'Periodo';34 41 $lang['CR_visible'] = 'Publico'; 35 $lang['CR_nopublic'] = "Esta página no es accesible al público !";36 $lang['CR_notavailable'] = "Este concurso no está disponible";37 42 $lang['CR_id_unknown %d'] = "Imagen #% d no existe"; 43 $lang['CR_duplicate_result %d'] = "The picture n°%d appears twice"; 38 44 $lang['CR_contest_saved'] = "Configuración del concurso guardada"; 39 45 $lang['CR_contest_added'] = "Concurso añadido"; … … 41 47 $lang['CR_results_saved'] = "Resultados guardado "; 42 48 $lang['CR_name_empty'] = "El nombre del concurso no puede estar vacío"; 43 $lang['CR_days'] = "días restantes"; 49 $lang['CR_pending_title'] = 'Concursos en curso'; 50 $lang['CR_running_title'] = 'Contests running'; 51 $lang['CR_finished_title'] = 'Concurso terminado'; 44 52 45 $lang['CR_order_1'] = '1<sup>a</sup>'; 46 $lang['CR_order_2'] = '2<sup>0</sup>'; 47 $lang['CR_order_3'] = '3<sup>0</sup>'; 48 $lang['CR_order_sup'] = '<sup>0</sup>'; 49 53 /* config */ 50 54 $lang['CR_menubar_mode'] = 'Insertar ContestResults al menú'; 51 55 $lang['CR_menubar_link'] = 'Vínculo en un bloque menú existente'; … … 53 57 $lang['CR_menubar_block'] = 'Nuevo bloque menú'; 54 58 $lang['CR_menubar_block_number'] = 'Número de Concursos para mostrar en el bloque'; 59 $lang['CR_truncate_summary'] = "Truncate the summary of the contest after x characters"; 55 60 61 /* stuffs */ 62 $lang['CR_select_contest'] = "Select one or more contests"; 63 $lang['CR_stuffs_desc'] = "Display one or more contests"; 64 65 /* cluetip */ 56 66 $lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>Puede usar HTML y descripciones multilingüe.</b>" : "<b>Puede usar HTML.</b>"; 57 67 $lang['CR_help_title'] = "" .$lang['CR_help_lang']; … … 67 77 - Pase el ratón sobre el icono <img src='".CR_PATH."admin/template/image/images.png'/> para ver la imagen correspondiente al identificador de entrada.<br/> 68 78 <br/>" .$lang['CR_help_lang']; 69 79 70 80 ?> -
extensions/ContestResults/language/fr_FR/plugin.lang.php
r9572 r9745 1 1 <?php 2 2 3 /* général */ 3 4 $lang['Contests'] = 'Concours'; 5 $lang['CR_finished'] = 'Terminé'; 6 $lang['CR_results'] = 'Résultats'; 7 $lang['CR_place'] = 'place'; 8 $lang['CR_nopublic'] = "Cette page n'est pas accessible au public !"; 9 $lang['CR_notavailable'] = "Ce concours n'est pas disponible"; 10 $lang['CR_%d_days_to_begin'] = "Commence dans %d jours"; 11 $lang['CR_%d_days_to_end'] = "%d jours restants"; 12 $lang['CR_order_1'] = '1<sup>ère</sup>'; 13 $lang['CR_order_2'] = '2<sup>ème</sup>'; 14 $lang['CR_order_3'] = '3<sup>ème</sup>'; 15 $lang['CR_order_sup'] = '<sup>ème</sup>'; 16 17 /* admin */ 4 18 $lang['CR_edit_tab'] = 'Editer le concours'; 5 19 $lang['CR_delete'] = 'Supprimer le concours'; … … 8 22 $lang['CR_new_tab'] = 'Ajouter un nouveau concours'; 9 23 $lang['CR_results_tab'] = 'Résultats du concours'; 10 $lang['CR_pending_title'] = 'Concours en cours';11 $lang['CR_finished_title'] = 'Concours terminés';12 $lang['CR_results'] = 'Résultats';13 24 $lang['CR_go'] = 'Aller sur la page du concours'; 14 25 $lang['CR_title'] = 'Titre'; … … 18 29 $lang['CR_logo'] = 'Logo'; 19 30 $lang['CR_banner'] = 'Bannière'; 20 $lang['CR_pending'] = 'En cours';21 $lang['CR_finished'] = 'Terminé';22 31 $lang['CR_summary'] = 'Résumé'; 23 32 $lang['CR_textareas'] = 'Description du concours'; … … 30 39 $lang['CR_comment'] = 'Commentaire'; 31 40 $lang['CR_rank'] = 'Rang'; 32 $lang['CR_place'] = 'place';33 $lang['CR_period'] = 'Période';34 41 $lang['CR_visible'] = 'Publique'; 35 $lang['CR_nopublic'] = "Cette page n'est pas accessible au public !";36 $lang['CR_notavailable'] = "Ce concours n'est pas disponible";37 42 $lang['CR_id_unknown %d'] = "L'image n°%d n'existe pas"; 43 $lang['CR_duplicate_result %d'] = "L'image n°%d est en double"; 38 44 $lang['CR_contest_saved'] = "Paramètres du concours sauvegardés"; 39 45 $lang['CR_contest_added'] = "Concours ajouté"; … … 41 47 $lang['CR_results_saved'] = "Résultats sauvegardés"; 42 48 $lang['CR_name_empty'] = "Le nom du concours ne peut être vide"; 43 $lang['CR_days'] = "jours restants"; 49 $lang['CR_pending_title'] = 'Concours en attente'; 50 $lang['CR_running_title'] = 'Concours en cours'; 51 $lang['CR_finished_title'] = 'Concours terminés'; 44 52 45 $lang['CR_order_1'] = '1<sup>ère</sup>'; 46 $lang['CR_order_2'] = '2<sup>ème</sup>'; 47 $lang['CR_order_3'] = '3<sup>ème</sup>'; 48 $lang['CR_order_sup'] = '<sup>ème</sup>'; 49 50 $lang['CR_menubar_mode'] = 'Intégrer ContestResults au menu'; 53 /* config */ 54 $lang['CR_menubar_mode'] = 'Intégrer Contest Results au menu'; 51 55 $lang['CR_menubar_link'] = 'Lien dans un bloc menu existant'; 52 56 $lang['CR_menubar_link_display'] = 'Afficher le lien dans les blocs'; 53 57 $lang['CR_menubar_block'] = 'Nouveau bloc menu'; 54 58 $lang['CR_menubar_block_number'] = 'Nombre de concours à afficher dans le bloc'; 59 $lang['CR_truncate_summary'] = "Tronquer le résumé du concours après x caractères"; 55 60 61 /* stuffs */ 62 $lang['CR_select_contest'] = "Sélectionnez un ou plusieurs concours"; 63 $lang['CR_stuffs_desc'] = "Afficher un ou plusieurs concours"; 64 65 /* cluetip */ 56 66 $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>"; 57 67 $lang['CR_help_title'] = "" . $lang['CR_help_lang']; -
extensions/ContestResults/language/lv_LV/plugin.lang.php
r9572 r9745 1 1 <?php 2 2 3 /* général */ 3 4 $lang['Contests'] = 'Konkursi'; 5 $lang['CR_finished'] = 'Pabeigts'; 6 $lang['CR_results'] = 'Rezultāti'; 7 $lang['CR_place'] = 'vietu'; 8 $lang['CR_nopublic'] = 'Šī lapa nav publiski pieejama !'; 9 $lang['CR_notavailable'] = 'Šis konkurss nav pieejams'; 10 $lang['CR_%d_days_to_begin'] = "Begins in %d days"; 11 $lang['CR_%d_days_to_end'] = "%d days remaining"; 12 $lang['CR_order_1'] = '1.'; 13 $lang['CR_order_2'] = '2.'; 14 $lang['CR_order_3'] = '3.'; 15 $lang['CR_order_sup'] = '.'; 16 17 /* admin */ 4 18 $lang['CR_edit_tab'] = 'Rediģēt konkursu'; 5 19 $lang['CR_delete'] = 'Dzēst konkursu'; … … 8 22 $lang['CR_new_tab'] = 'Pievienot jaunu konkursu'; 9 23 $lang['CR_results_tab'] = 'Konkursa rezultāti'; 10 $lang['CR_pending_title'] = 'Vēl nepabeigtie konkursi';11 $lang['CR_finished_title'] = 'Pabeigtie konkursi';12 $lang['CR_results'] = 'Rezultāti';13 24 $lang['CR_go'] = 'Iet uz konkursa lapu'; 14 25 $lang['CR_title'] = 'Nosaukums'; … … 18 29 $lang['CR_logo'] = 'Logo'; 19 30 $lang['CR_banner'] = 'Baneris'; 20 $lang['CR_pending'] = 'Vēl nepabeigts';21 $lang['CR_finished'] = 'Pabeigts';22 31 $lang['CR_summary'] = 'Kopā'; 23 32 $lang['CR_textareas'] = 'Konkursa apraksts'; … … 30 39 $lang['CR_comment'] = 'Komentārs'; 31 40 $lang['CR_rank'] = 'Novērtējums'; 32 $lang['CR_place'] = 'vietu';33 $lang['CR_period'] = 'Periods';34 41 $lang['CR_visible'] = 'Redzams'; 35 $lang['CR_nopublic'] = 'Šī lapa nav publiski pieejama !';36 $lang['CR_notavailable'] = 'Šis konkurss nav pieejams';37 42 $lang['CR_id_unknown %d'] = "Attēls n°%d neeksistē"; 43 $lang['CR_duplicate_result %d'] = "The picture n°%d appears twice"; 38 44 $lang['CR_contest_saved'] = "Konkursa iestatījumi saglabāti"; 39 45 $lang['CR_contest_added'] = "Konkurss pievienots"; … … 41 47 $lang['CR_results_saved'] = "Rezultāti saglabāti"; 42 48 $lang['CR_name_empty'] = "Konkursa nosaukums nevar būt tukšs"; 43 $lang['CR_days'] = "atlikušo dienu"; 49 $lang['CR_pending_title'] = 'Vēl nepabeigtie konkursi'; 50 $lang['CR_running_title'] = 'Contests running'; 51 $lang['CR_finished_title'] = 'Pabeigtie konkursi'; 44 52 45 $lang['CR_order_1'] = '1.'; 46 $lang['CR_order_2'] = '2.'; 47 $lang['CR_order_3'] = '3.'; 48 $lang['CR_order_sup'] = '.'; 49 53 /* config */ 50 54 $lang['CR_menubar_mode'] = 'Pievienot Konkursa Rezultātus izvēlnei'; 51 55 $lang['CR_menubar_link'] = 'Pievienot saiti uz esošu izvēlnes bloku'; … … 53 57 $lang['CR_menubar_block'] = 'Jauns izvēlnes bloks'; 54 58 $lang['CR_menubar_block_number'] = 'Blokā attēlojamo konkursu skaits'; 59 $lang['CR_truncate_summary'] = "Truncate the summary of the contest after x characters"; 55 60 61 /* stuffs */ 62 $lang['CR_select_contest'] = "Select one or more contests"; 63 $lang['CR_stuffs_desc'] = "Display one or more contests"; 64 65 /* cluetip */ 56 66 $lang['CR_help_lang'] = (CR_ED_STATE == 'active') ? "<b>Iespējasm lietot HTML un multivalodu aprakstus.</b>" : "<b>Varat lietot HTML.</b>"; 57 67 $lang['CR_help_title'] = "" . $lang['CR_help_lang']; -
extensions/ContestResults/main.inc.php
r9572 r9745 2 2 /* 3 3 Plugin Name: ContestResults 4 Version: 1.3 4 Version: 1.3.b 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, $conf ;13 global $prefixeTable, $conf, $pwg_loaded_plugins; 14 14 15 15 // +-----------------------------------------------------------------------+ … … 17 17 // +-----------------------------------------------------------------------+ 18 18 define('CR_NAME' , 'Contest Results'); 19 define('CR_VERSION', '1.3 ');19 define('CR_VERSION', '1.3.b'); 20 20 define('CR_DIR' , basename(dirname(__FILE__))); 21 21 define('CR_PATH' , PHPWG_PLUGINS_PATH . CR_DIR . '/'); 22 22 define('CR_TABLE_1' , $prefixeTable . 'contests'); 23 23 define('CR_TABLE_2' , $prefixeTable . 'contests_results'); 24 define('CR_ADMIN', PHPWG_ROOT_PATH . 'admin.php?page=plugin&section=' . CR_DIR . '/admin/admin.php');24 define('CR_ADMIN', get_root_url().'admin.php?page=plugin-' . CR_DIR); 25 25 define('CR_PUBLIC', make_index_url(array('section' => 'contests')) . '/'); 26 27 $ED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';")); 28 define('CR_ED_STATE', $ED['state']); 26 define('CR_ED_STATE', isset($pwg_loaded_plugins['ExtendedDescription']) ? 'active' : 'unactive'); 29 27 30 28 … … 32 30 // Triggers 33 31 // +-----------------------------------------------------------------------+ 34 add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration 35 add_event_handler('loc_end_section_init', 'CR_section_init'); // Paramètre URL 36 add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page 37 add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Commentaire sur la page image 32 add_event_handler('loading_lang', 'CR_load_lang'); // Chargement des fichiers de langue 33 add_event_handler('get_admin_plugin_menu_links', 'CR_admin_menu'); // Lien d'administration 34 add_event_handler('loc_end_section_init', 'CR_section_init'); // Paramètre URL 35 add_event_handler('loc_end_index', 'CR_index'); // Contenu du la page 36 add_event_handler('loc_end_picture', 'CR_comment_picture', 10); // Commentaire sur la page image 37 add_event_handler('get_stuffs_modules', 'CR_register_stuffs_module'); // Ajoute un module pour PWG Stuffs 38 38 if(CR_ED_STATE == 'active') add_event_handler('render_CR_content', 'get_user_language_desc'); // Textes multilangues 39 39 … … 43 43 // +-----------------------------------------------------------------------+ 44 44 include(CR_PATH . 'include/functions.php'); 45 $conf['ContestResults'] = unserialize($conf['ContestResults']); 46 45 47 // Gestion du menu 46 48 include(CR_PATH . 'include/cr_menubar.php'); 49 50 // Chargement des fichiers de langue et de la config 51 function CR_load_lang() { 52 load_language('plugin.lang', CR_PATH); 53 } 47 54 48 55 // Lien d'administration … … 59 66 global $tokens, $page, $conf; 60 67 61 load_language('plugin.lang', CR_PATH);62 63 68 if ($tokens[0] == 'contests') { // on est dans la section concours 64 69 $page['section'] = 'contests'; … … 67 72 if (isset($tokens[1]) AND !empty($tokens[1])) { // on est sur la page d'un concours 68 73 $tokens[1] = explode('-', $tokens[1]); 74 69 75 if (preg_match('#^([0-9]*)$#', $tokens[1][0])) { // is_int ne marche pas parce que le chiffre est stocké en (string) 70 76 $page['contest'] = $tokens[1][0]; 71 $page['title'] .= $conf['level_separator'] . trigger_event('render_CR_content', get_contest_name($page['contest'])); 77 78 if ($contest_name = get_contest_name($page['contest'])) { // vérifie si le concours existe 79 $page['title'] .= $conf['level_separator'] . trigger_event('render_CR_content', $contest_name); 80 } else { 81 page_not_found(l10n('CR_notavailable')); 82 } 72 83 } 73 84 } … … 88 99 } 89 100 101 // Ajoute un module pour PWG Stuffs 102 function CR_register_stuffs_module($modules) { 103 array_push($modules, array( 104 'path' => CR_PATH . '/stuffs_module', 105 'name' => CR_NAME, 106 'description' => l10n('CR_stuffs_desc'), 107 )); 108 109 return $modules; 110 } 111 90 112 // Ajoute le commentaire sur la page image 91 113 function CR_comment_picture() { -
extensions/ContestResults/maintain.inc.php
r9572 r9745 14 14 'menubar_block' => array( 15 15 'number' => 5 16 ) 16 ), 17 'truncate_summary' => 350, 17 18 ))); 18 19 19 // Install tion20 // Installation 20 21 function plugin_install() { 21 22 global $prefixeTable; … … 29 30 `logo` VARCHAR( 255 ) NULL , 30 31 `banner` VARCHAR( 255 ) NULL , 32 `summary` TEXT NULL , 31 33 `description` TEXT NULL , 32 34 PRIMARY KEY ( `id` ) 33 ) ;");35 ) DEFAULT CHARSET=utf8;"); 34 36 35 37 pwg_query("CREATE TABLE `" . $prefixeTable . "contests_results` ( … … 40 42 `comment` TEXT NULL, 41 43 UNIQUE ( `image_id` , `contest_id` ) 42 ) ;");44 ) DEFAULT CHARSET=utf8;"); 43 45 44 46 pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');"); … … 49 51 global $conf, $prefixeTable; 50 52 51 // compatibilité avec les versions < 1.1 (ajout d'une entrée de configuration) 52 if (!isset($conf['ContestResults'])) { 53 pwg_query("INSERT INTO " . CONFIG_TABLE . "(param,value,comment) VALUES('ContestResults', '" . default_config . "', 'Parametres du plugin ContestResults');"); 54 } 55 56 // compatibilité avec les versions < 1.2 (suppression option d'affichage) 57 $field = pwg_query("SHOW COLUMNS FROM `" . $prefixeTable . "contests` LIKE 'presentation_display'"); 58 if (pwg_db_num_rows($field)) { 59 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` 60 DROP `presentation_display`, 61 DROP `rules_display`, 62 DROP `prices_display`, 63 DROP `final_display`;" 64 ); 65 } 66 67 // compatibilité avec les versions < 1.3 (suppression option status, regroupement des champs de description) 68 $field = pwg_query("SHOW COLUMNS FROM `" . $prefixeTable . "contests` LIKE 'status'"); 69 if (pwg_db_num_rows($field)) { 70 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` DROP `status`"); 71 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` ADD `description` TEXT NULL"); 72 73 $contests = pwg_query("SELECT * FROM `" . $prefixeTable . "contests`"); 74 while ($contest = pwg_db_fetch_assoc($contests)) { 75 $new_description = array(); 76 if (!empty($contest['presentation'])) { 77 $new_description[] = array( 78 'name' => 'Presentation[lang=fr]Présentation[/lang][lang=es]Presentación[/lang][lang=lv]Prezentacija[/lang]', 79 'content' => $contest['presentation'], 80 ); 81 } 82 if (!empty($contest['rules'])) { 83 $new_description[] = array( 84 'name' => 'Rules[lang=fr]Règles[/lang][lang=es]Restricciones[/lang][lang=lv]Noteikumi[/lang]', 85 'content' => $contest['rules'], 86 ); 87 } 88 if (!empty($contest['prices'])) { 89 $new_description[] = array( 90 'name' => 'Prices[lang=fr]Prix[/lang][lang=es]Precios[/lang][lang=lv]Cenas[/lang]', 91 'content' => $contest['prices'], 92 ); 93 } 94 if (!empty($contest['final'])) { 95 $new_description[] = array( 96 'name' => 'Conclusion[lang=fr]Conclusion[/lang][lang=es]Conclusión[/lang][lang=lv]Beigsana[/lang]', 97 'content' => $contest['final'], 98 ); 99 } 100 101 $new_description = base64_encode(serialize($new_description)); 102 pwg_query("UPDATE `" . $prefixeTable . "contests` 103 SET description = '". $new_description ."' 104 WHERE id = ". $contest['id'] .";" 105 ); 106 } 107 108 pwg_query("ALTER TABLE `" . $prefixeTable . "contests` 109 DROP `presentation`, 110 DROP `rules`, 111 DROP `prices`, 112 DROP `final`;" 113 ); 114 } 115 53 include('include/compatibility.inc.php'); 116 54 } 117 55 -
extensions/ContestResults/template/cr_main.tpl
r9572 r9745 1 {combine_css id='cr_style'path=$CR_PATH|@cat:'template/style.css'}1 {combine_css path=$CR_PATH|@cat:'template/style.css'} 2 2 3 3 {$MENUBAR} … … 26 26 {else} 27 27 <ul class="thumbnailCategories"> 28 {foreach from=$contests item=contest}29 <li >30 <div class="thumbnailCategory {if $contest.VISIBLE == 0}novisible{/if}">28 {foreach from=$contests item=contest} 29 <li {if !$contest.VISIBLE}class="novisible"{/if}> 30 <div class="thumbnailCategory"> 31 31 <div class="illustration"> 32 {if !$contest.FINISHED == 'pending'}33 32 <a href="{$contest.URL}"> 34 {if !empty($contest.LOGO)}33 {if $contest.STATUS != 'finished' AND !empty($contest.LOGO)} 35 34 <img src="{$contest.LOGO}" alt="{$contest.NAME}" style="max-height:120px;max-width:120px;"> 35 {elseif !empty($contest.RESULTS.1.TN_SRC)} 36 <img src="{$contest.RESULTS.1.TN_SRC}" alt="{$contest.NAME|@replace:'"':' '}"> 36 37 {/if} 37 38 </a> 38 {else}39 <a href="{$contest.URL}">40 <img src="{$contest.RESULTS.1.TN_SRC}" alt="{$contest.NAME|@replace:'"':' '}">41 </a>42 {/if}43 39 </div> 44 40 <div class="description"> 45 <h3> 46 <a href="{$contest.URL}">{$contest.NAME}</a> 47 {if $contest.FINISHED} 48 <span class="CR_finished">({'CR_finished'|@translate})</span> 49 {else} 50 <span class="CR_finished">({$contest.DAYS} {'CR_days'|@translate})</span> 51 {/if} 52 </h3> 41 <h3><a href="{$contest.URL}">{$contest.NAME}</a></h3> 53 42 <div class="text"> 54 43 <p class="Nb_images">{$contest.DATE_BEGIN} - {$contest.DATE_END}</p> 44 <span class="CR_finished">({$contest.DAYS})</span> 55 45 <p> 56 {if !$contest.FINISHED} 57 {if !empty($contest.SUMMARY)} 58 {$contest.SUMMARY} 59 {/if} 46 {if $contest.STATUS != 'finished' AND !empty($contest.SUMMARY)} 47 {$contest.SUMMARY} 60 48 {else} 61 49 {foreach from=$contest.RESULTS item=result} … … 68 56 </div> 69 57 </li> 70 {/foreach}58 {/foreach} 71 59 </ul> 72 60 {/if} -
extensions/ContestResults/template/cr_menubar.tpl
r9572 r9745 1 1 {html_head} 2 <style type="text/css"> 3 .CR_finished_menu {ldelim} 4 font-size:0.8em; 5 color:#a00; 6 letter-spacing:0px; 7 } 8 </style> 2 {literal} 3 <style type="text/css"> 4 .CR_finished_menu { 5 font-size:0.8em; 6 color:#a00; 7 letter-spacing:0px; 8 } 9 </style> 10 {/literal} 9 11 {/html_head} 10 12 … … 13 15 <ul> 14 16 {foreach from=$block->data item=data} 15 <li> 16 <a href="{$data.URL}" title="{$data.DATE}"> 17 {$data.LABEL} 18 {if $data.FINISHED} 19 <span class="CR_finished_menu">×</span> 20 {else} 21 <span class="CR_finished_menu">{$data.DAYS}</span> 22 {/if} 23 </a> 24 </li> 17 <li> 18 <a href="{$data.URL}" title="{$data.DATE}"> 19 {$data.LABEL} 20 <span class="CR_finished_menu">{$data.DAYS}</span> 21 </a> 22 </li> 25 23 {/foreach} 26 24 </ul> -
extensions/ContestResults/template/cr_page.tpl
r9572 r9745 1 {combine_css id='cr_style'path=$CR_PATH|@cat:'template/style.css'}1 {combine_css path=$CR_PATH|@cat:'template/style.css'} 2 2 3 3 {$MENUBAR} 4 4 5 5 {if !empty($PLUGIN_INDEX_CONTENT_BEFORE)}{$PLUGIN_INDEX_CONTENT_BEFORE}{/if} 6 6 7 <div class="content"> 7 8 <div class="titrePage"> … … 16 17 <h2> 17 18 <a href="index.php?/contests" name="top">{'Contests'|@translate}</a>{$SEPARATOR}<a href="{$URL}">{$NAME}</a> 18 {if $FINISHED} 19 <span class="CR_finished">({'CR_finished'|@translate})</span> 20 {else} 21 <span class="CR_finished">({$DAYS} {'CR_days'|@translate})</span> 22 {/if} 19 <span class="CR_finished">({$DAYS})</span> 23 20 </h2> 24 21 </div> <!-- titrePage --> 25 22 26 23 {if !$VISIBLE} 27 28 29 24 <div class="nopublic"> 25 {'CR_nopublic'|@translate} 26 </div> 30 27 {/if} 31 28 … … 43 40 44 41 {foreach from=$description item=desc name=desc_loop} 45 46 47 48 42 <div class="CR_text"> 43 <h3>{$desc.NAME} :</h3> 44 {$desc.CONTENT} 45 </div> 49 46 {/foreach} 50 47 </div> <!-- content_contest --> 51 48 52 49 {if !empty($RESULTS)} 53 <div class="content"> 54 <div class="titrePage"> 55 <ul class="categoryActions"> 56 {if isset($U_RESULTS) } 57 <li><a href="{$U_RESULTS}" title="{'CR_results'|@translate}" class="pwg-state-default pwg-button"> 58 <span class="pwg-icon pwg-icon-category-edit"> </span><span class="pwg-button-text">{'CR_edit_tab'|@translate}</span> 59 </a></li> 60 {/if} 61 </ul> 62 <h2><a href="{$URL}">{$NAME}</a>{$SEPARATOR}<a href="#results" name="results">{'CR_results'|@translate}</a></h2> 50 <div class="content"> 51 <div class="titrePage"> 52 <ul class="categoryActions"> 53 {if isset($U_RESULTS) } 54 <li><a href="{$U_RESULTS}" title="{'CR_results'|@translate}" class="pwg-state-default pwg-button"> 55 <span class="pwg-icon pwg-icon-category-edit"> </span><span class="pwg-button-text">{'CR_edit_tab'|@translate}</span> 56 </a></li> 57 {/if} 58 </ul> 59 <h2><a href="#top">{$NAME}</a>{$SEPARATOR}<a href="#results" name="results">{'CR_results'|@translate}</a></h2> 60 </div> 61 62 <div id="CR_podium"> 63 {foreach from=$RESULTS item=result} 64 {if $result.RANK <= 3} 65 {if $result.RANK == 2}<div class="podium_23">{/if} 66 <div class="podium_{$result.RANK}"> 67 <div class="illustration"> 68 <div class="title">{'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u></div> 69 <a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}"> 70 <img src="{$result.IMAGE_SRC}" alt="{$result.IMAGE_NAME}"/> 71 </a> 72 </div> 73 <p> 74 {$result.COMMENT} 75 </p> 63 76 </div> 64 65 <div id="CR_podium"> 66 {foreach from=$RESULTS item=result} 67 {if $result.RANK <= 3} 68 {if $result.RANK == 2}<div class="podium_23">{/if} 69 <div class="podium_{$result.RANK}"> 70 <div class="illustration"> 71 <div class="title">{'CR_order_'|cat:$result.RANK|@translate} {'CR_place'|@translate} - <u>{$result.AUTHOR}</u></div> 72 <a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}"> 73 <img src="{$result.IMAGE_SRC}" alt="{$result.IMAGE_NAME}"/> 74 </a> 75 </div> 76 <p> 77 {$result.COMMENT} 78 </p> 79 </div> 80 {if $result.RANK == 3}</div>{/if} 81 {/if} 82 {/foreach} 83 </div> 84 85 <ul class="thumbnails"> 86 {foreach from=$RESULTS item=result} 87 {if $result.RANK > 3} 88 <li> 89 <span class="wrap1"> 90 <span class="wrap2"> 91 <a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}"> 92 <img class="thumbnail" src="{$result.TN_SRC}" alt="{$result.IMAGE_NAME}"/> 93 </a> 94 </span> 95 <span class="thumbLegend"> 96 <span class="thumbnail-name"> 97 {$result.AUTHOR} 98 </span> 99 <span class="nb-hits"> 100 <br>{$result.RANK}{'CR_order_sup'|@translate} {'CR_place'|@translate} 101 </span> 102 </span> 103 </span> 104 </li> 105 {/if} 106 {/foreach} 107 </ul> 108 109 {if !empty($LOGO)} 110 <div class="CR_banner"> 111 <h1><a href="#top"><img src="{$LOGO}" alt="{$NAME}"/></a></h1> 112 </div> 77 {if $result.RANK == 3 OR ($result.RANK == 2 AND $NB_RESULTS == 2)}</div>{/if} <!-- au cas ou il n'y a que deux résultats --> 113 78 {/if} 114 </div> <!-- content_results --> 79 {/foreach} 80 </div> 81 82 <ul class="thumbnails"> 83 {foreach from=$RESULTS item=result} 84 {if $result.RANK > 3} 85 <li> 86 <span class="wrap1"> 87 <span class="wrap2"> 88 <a href="{$result.IMAGE_URL}" title="{$result.IMAGE_NAME}"> 89 <img class="thumbnail" src="{$result.TN_SRC}" alt="{$result.IMAGE_NAME}"/> 90 </a> 91 </span> 92 <span class="thumbLegend"> 93 <span class="thumbnail-name"> 94 {$result.AUTHOR} 95 </span> 96 <span class="nb-hits"> 97 <br>{$result.RANK}{'CR_order_sup'|@translate} {'CR_place'|@translate} 98 </span> 99 </span> 100 </span> 101 </li> 102 {/if} 103 {/foreach} 104 </ul> 105 106 {if !empty($LOGO)} 107 <div class="CR_banner"> 108 <h1><a href="#top"><img src="{$LOGO}" alt="{$NAME}"/></a></h1> 109 </div> 110 {/if} 111 </div> <!-- content_results --> 115 112 {/if} 116 113 -
extensions/ContestResults/template/style.css
r9572 r9745 3 3 font-size:0.8em; 4 4 letter-spacing:0.2em; 5 padding-left:10px;5 6 6 color:#a00; 7 7 } 8 8 9 div.thumbnailCategory.novisible {9 .novisible { 10 10 opacity:0.4; 11 11 } 12 12 13 div.nopublic {13 .nopublic { 14 14 background:#aaa; 15 15 border:1px dotted #555; … … 39 39 font-size:1.3em; 40 40 border-bottom:1px dotted #999; 41 color:#ddd;42 41 } 43 42 … … 48 47 font-style:italic; 49 48 font-family:"Consolas"; 50 color:#ddd;51 49 border-top:1px dotted #999; 52 50 }
Note: See TracChangeset
for help on using the changeset viewer.