Changeset 9975 for extensions/ContestResults/admin/results.php
- Timestamp:
- Apr 2, 2011, 11:43:40 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContestResults/admin/results.php
r9745 r9975 11 11 $_DUPLICATE = array(); 12 12 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 );"); 16 33 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 } 35 37 } 36 38 } 37 39 38 40 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'); 40 42 } else if (!isset($_DUPLICATE)) { 41 43 $page['infos'][] = l10n('CR_results_saved'); … … 56 58 57 59 $template->assign(array( 58 'NAME' => trigger_event('render_ CR_content', $contest['name']),60 'NAME' => trigger_event('render_category_name', $contest['name']), 59 61 'CONTEST_ID' => $_GET['contest_id'] 60 62 )); … … 108 110 109 111 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'; 112 113 $data['IMAGE_NAME'] = 'N/A'; 113 114 $data['ERROR'] = true;
Note: See TracChangeset
for help on using the changeset viewer.