Changeset 9200 for extensions/ContestResults/include/cr_main.php
- Timestamp:
- Feb 13, 2011, 11:12:58 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.