From 1bf3753f1449eedc4bd39c79b6ca17dc4f396e76 Mon Sep 17 00:00:00 2001 From: plegall Date: Tue, 16 Nov 2004 23:38:34 +0000 Subject: - images.path column added to reduce database access - function mass_inserts moved from admin/remote_sites.php to admin/include/function.php - function mass_inserts used in admin/update.php git-svn-id: http://piwigo.org/svn/trunk@606 68402e56-0260-453c-a942-63ccdbb3a9ee --- picture.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'picture.php') diff --git a/picture.php b/picture.php index 8698a0167..7e1af41d2 100644 --- a/picture.php +++ b/picture.php @@ -142,12 +142,7 @@ foreach (array('prev', 'current', 'next') as $i) $picture[$i]['is_picture'] = true; } - if ( !isset($array_cat_directories[$row['storage_category_id']])) - { - $array_cat_directories[$row['storage_category_id']] = - get_complete_dir( $row['storage_category_id'] ); - } - $cat_directory = $array_cat_directories[$row['storage_category_id']]; + $cat_directory = dirname($row['path']); $file_wo_ext = get_filename_wo_extension($row['file']); $icon = './template/'.$user['template'].'/mimetypes/'; @@ -165,7 +160,7 @@ foreach (array('prev', 'current', 'next') as $i) // special case for picture files if ($picture[$i]['is_picture']) { - $picture[$i]['src'] = $cat_directory.$row['file']; + $picture[$i]['src'] = $row['path']; // if we are working on the "current" element, we search if there is a // high quality picture // FIXME : with remote pictures, this "remote fopen" takes long... @@ -181,12 +176,10 @@ foreach (array('prev', 'current', 'next') as $i) // if picture is not a file, we need the download link if (!$picture[$i]['is_picture']) { - $picture[$i]['download'] = $cat_directory.$row['file']; + $picture[$i]['download'] = $row['path']; } - $picture[$i]['thumbnail'] = get_thumbnail_src($row['file'], - $row['storage_category_id'], - @$row['tn_ext']); + $picture[$i]['thumbnail'] = get_thumbnail_src($row['path'], @$row['tn_ext']); if ( !empty( $row['name'] ) ) { -- cgit v1.2.3