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/admin/manage.php

    r6768 r9200  
    33
    44// +-----------------------------------------------------------------------+
    5 //                      Suppression d'un concours
     5//                              Suppression d'un concours
    66// +-----------------------------------------------------------------------+
    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'] . ';');
     7if (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'] . ';');
    1010        redirect(CR_ADMIN);
    1111}
    1212
    1313// +-----------------------------------------------------------------------+
    14 //                      Affichage des concours
     14//                              Affichage des concours
    1515// +-----------------------------------------------------------------------+
    16 foreach(array('pending','finished') AS $status){
    17         $query = "SELECT id, name, visible, date_begin, date_end, logo
     16foreach (array('pending','finished') AS $status) {
     17        $result = pwg_query("SELECT id, name, visible, date_begin, date_end, logo
    1818                FROM " . CR_TABLE_1 . "
    1919                WHERE status = '" . $status . "'
    20                 ORDER BY date_begin DESC;";
    21         $result = pwg_query($query);
     20                ORDER BY date_begin DESC;");
    2221
    23         while($contest = pwg_db_fetch_assoc($result)){
     22        while ($contest = pwg_db_fetch_assoc($result)) {
    2423                $template->append('contests_'.$status, array(
    2524                        'NAME' => trigger_event('render_CR_content', $contest['name']),
     
    2827                        'DATE_END' => format_date($contest['date_end']),
    2928                        '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'],
    3332                        'URL' => CR_PUBLIC . $contest['id'] . '-' . str2url(trigger_event('render_CR_content', $contest['name'])),
    3433                ));
Note: See TracChangeset for help on using the changeset viewer.