diff -r 8490ce0cdd8c -r ebd7003e73c6 plugins/gallery/viewimage.php --- a/plugins/gallery/viewimage.php Thu Jul 26 14:43:45 2007 -0400 +++ b/plugins/gallery/viewimage.php Thu Aug 09 12:31:24 2007 -0400 @@ -36,7 +36,7 @@ $img_id = intval($page->page_id); if ( !$img_id ) return false; - $q = $db->sql_query('SELECT img_id, img_title, img_desc, print_sizes, img_time_upload, img_time_mod, folder_parent FROM '.table_prefix.'gallery WHERE img_id=' . $img_id . ';'); + $q = $db->sql_query('SELECT img_id, img_title, img_desc, print_sizes, img_time_upload, img_time_mod, img_filename, folder_parent FROM '.table_prefix.'gallery WHERE img_id=' . $img_id . ';'); if ( !$q ) $db->_die(); } @@ -61,7 +61,7 @@ $folders = array_reverse($folders); // This is one of the best MySQL tricks on the market. We're going to reverse-travel a folder path using LEFT JOIN and the incredible power of metacoded SQL - $sql = 'SELECT g0.img_id, g0.img_title, g0.img_desc, g0.print_sizes, g0.img_time_upload, g0.img_time_mod, g0.folder_parent FROM '.table_prefix.'gallery AS g0'; + $sql = 'SELECT g0.img_id, g0.img_title, g0.img_desc, g0.print_sizes, g0.img_time_upload, g0.img_time_mod, g0.img_filename, g0.folder_parent FROM '.table_prefix.'gallery AS g0'; $where = "\n " . 'WHERE g0.img_title=\'' . $db->escape($folders[0]) . '\''; foreach ( $folders as $i => $folder ) { @@ -257,9 +257,14 @@ // By the time I got to this point, it was 1:32AM (I was on vacation) and my 5-hour playlist on my iPod had been around about 3 times today. // So I'm glad this is like the last thing on the list tonight. + $ext = get_file_extension($row['img_filename']); + $ext = strtoupper($ext); + echo 'Image details'; echo 'Uploaded:' . date('F d, Y h:i a', $row['img_time_upload']) . ''; echo 'Last modified:' . date('F d, Y h:i a', $row['img_time_mod']) . ''; + echo 'Original format:' . $ext . ''; + echo 'Download image'; echo '';