source: extensions/ContestResults/admin/get_tn.php @ 9975

Last change on this file since 9975 was 9975, checked in by mistic100, 13 years ago
  • many corrections
File size: 705 bytes
RevLine 
[6782]1<?php
[9975]2define('PHPWG_ROOT_PATH','./../../../');
[6782]3define('IN_ADMIN', true);
4include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
5
[9200]6$image = pwg_query("SELECT id, name, file, path, tn_ext
[6782]7        FROM " . IMAGES_TABLE . "
[9200]8        WHERE id = " . pwg_db_real_escape_string($_GET['image_id']) . ";");
[6782]9
[9200]10if (!pwg_db_num_rows($image)) {
[9572]11        $data['TN_SRC'] = 'admin/themes/default/icon/errors.png';
[6782]12        $data['IMAGE_NAME'] = 'N/A';
[9200]13       
14} else {
[6782]15        $image = pwg_db_fetch_assoc($image);
16        $data['TN_SRC'] = get_thumbnail_url($image);
17        $data['IMAGE_NAME'] = (empty($image['name'])) ? get_name_from_file($image['file']) : $image['name'];
18}
19
20echo "<img src='" . str_replace('../../.', '', $data['TN_SRC']) . "'/><br>" . $data['IMAGE_NAME'];
21?>
Note: See TracBrowser for help on using the repository browser.