Ignore:
Timestamp:
Feb 13, 2011, 11:12:58 AM (13 years ago)
Author:
mistic100
Message:

ContestResults :

  • Code revision
  • Add Letton (lv_LV) language, thanks to Aivars Baldone
  • Delete display options
  • Fix languages bugs
  • Improve public appearence
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContestResults/include/cr_main.php

    r6768 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                      Liste des concours
     5//                              Liste des concours
    66// +-----------------------------------------------------------------------+
    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;");
    918
    10 while($contest = pwg_db_fetch_assoc($contests)){
    11         if($contest['visible'] OR is_admin()){
     19while ($contest = pwg_db_fetch_assoc($contests)) {
     20        if ($contest['visible'] OR is_admin()) {
    1221                // infos sur le concours
    1322                $item =  array(
     
    1928                        'DATE_BEGIN' => format_date($contest['date_begin']),
    2029                        '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),
    2231                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
    2332                );
    2433               
    2534                // podium si terminé
    26                 if($contest['status'] == 'finished'){
    27                         $query = "SELECT
     35                if ($contest['status'] == 'finished') {
     36                        $results = pwg_query("SELECT
    2837                                        i.id,
    2938                                        i.name,
     
    3847                                WHERE c.contest_id = " . $contest['id'] . "
    3948                                ORDER BY c.rank ASC
    40                                 LIMIT 3 OFFSET 0;";
    41                         $results = pwg_query($query);
     49                                LIMIT 3 OFFSET 0;");
    4250                       
    43                         while($result = pwg_db_fetch_assoc($results)){
     51                        while ($result = pwg_db_fetch_assoc($results)) {
    4452                                $item['RESULTS'][$result['rank']] = array(
    4553                                        'RANK' => $result['rank'],
     
    5058                }
    5159
    52                 $template->append('contests_'.$contest['status'], $item);
     60                $template->append('contests', $item);
    5361        }
    5462}
Note: See TracChangeset for help on using the changeset viewer.