Ignore:
Timestamp:
Apr 2, 2011, 11:43:40 AM (13 years ago)
Author:
mistic100
Message:
  • many corrections
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContestResults/admin/results.php

    r9745 r9975  
    1111        $_DUPLICATE = array();
    1212       
    13         foreach ($_POST['results'] AS $i => $data) {
    14                 if (!in_array($data['image_id'], $registered_ids)) {
    15                         $registered_ids[] = $data['image_id'];
     13        if (isset($_POST['results'])) {
     14                foreach ($_POST['results'] AS $i => $data) {
     15                        if (!in_array($data['image_id'], $registered_ids)) {
     16                                $registered_ids[] = $data['image_id'];
     17                               
     18                                pwg_query("INSERT INTO " . CR_TABLE_2 . "
     19                                        (
     20                                                image_id,
     21                                                contest_id,
     22                                                rank,
     23                                                comment,
     24                                                author
     25                                        )
     26                                        VALUES(
     27                                                '" . $data['image_id'] ."',
     28                                                '" . $_GET['contest_id'] ."',
     29                                                '" . $data['rank'] ."',
     30                                                '" . $data['comment'] ."',
     31                                                '" . $data['author'] . "'
     32                                        );");
    1633                       
    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;
     34                        } else {
     35                                $_DUPLICATE[] = $data;
     36                        }
    3537                }
    3638        }
    3739       
    3840        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');
     41                redirect(CR_PUBLIC . $_GET['contest_id'] . '-' . str2url(trigger_event('render_category_name', get_contest_name($_GET['contest_id']))) . '#results');
    4042        } else if (!isset($_DUPLICATE)) {
    4143                $page['infos'][] = l10n('CR_results_saved');
     
    5658
    5759        $template->assign(array(
    58                 'NAME' => trigger_event('render_CR_content', $contest['name']),
     60                'NAME' => trigger_event('render_category_name', $contest['name']),
    5961                'CONTEST_ID' => $_GET['contest_id']
    6062        ));
     
    108110               
    109111                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['TN_SRC'] = 'admin/themes/default/icon/errors.png';
    112113                        $data['IMAGE_NAME'] = 'N/A';
    113114                        $data['ERROR'] = true;
Note: See TracChangeset for help on using the changeset viewer.