Changeset 6782 for extensions/ContestResults/admin/results.php
- Timestamp:
- Aug 20, 2010, 12:33:47 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContestResults/admin/results.php
r6768 r6782 25 25 26 26 // +-----------------------------------------------------------------------+ 27 // Suppression d'un résultat28 // +-----------------------------------------------------------------------+29 if(isset($_GET['delete_result'])){30 pwg_query('DELETE FROM ' . CR_TABLE_2 . ' WHERE contest_id = ' . $_GET['contest_id'] . ' AND image_id = ' . $_GET['delete_result'] . ';');31 redirect(CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id']);32 }33 34 // +-----------------------------------------------------------------------+35 27 // Affichage des résultats 36 28 // +-----------------------------------------------------------------------+ … … 46 38 47 39 while($result = pwg_db_fetch_assoc($results)){ 48 $ template->append('results',array(40 $data = array( 49 41 'RANK' => $result['rank'], 50 'I D' => $result['image_id'],42 'IMAGE_ID' => $result['image_id'], 51 43 'AUTHOR' => $result['author'], 52 44 'COMMENT' => $result['comment'], 53 45 'U_DELETE' => CR_ADMIN . '&tab=results&contest_id=' . $_GET['contest_id'] . '&delete_result=' . $result['image_id'], 54 )); 46 ); 47 48 // Infos de l'image 49 $query = "SELECT id, name, file, path, tn_ext 50 FROM " . IMAGES_TABLE . " 51 WHERE id = " . $result['image_id'] . ";"; 52 $image = pwg_query($query); 53 54 if(!pwg_db_num_rows($image)){ 55 $themeconf = $template->get_template_vars('themeconf'); 56 $data['TN_SRC'] = $themeconf['admin_icon_dir'] . '/errors.png'; 57 $data['IMAGE_NAME'] = 'N/A'; 58 $page['errors'][] = l10n_dec('CR_id_unknown %d', 'CR_id_unknown %d', $result['image_id']); 59 }else{ 60 $image = pwg_db_fetch_assoc($image); 61 $data['TN_SRC'] = get_thumbnail_url($image); 62 $data['IMAGE_NAME'] = (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name']; 63 } 64 65 $template->append('results', $data); 55 66 } 56 67
Note: See TracChangeset
for help on using the changeset viewer.