aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2004-11-16 23:38:34 +0000
committerplegall <plg@piwigo.org>2004-11-16 23:38:34 +0000
commit1bf3753f1449eedc4bd39c79b6ca17dc4f396e76 (patch)
tree7d7443b94356cd18a038b3f104f6e21a35d01279 /picture.php
parent973e0f8806cd6d569c01977ad5112e16cc7a7f6f (diff)
- 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
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php15
1 files changed, 4 insertions, 11 deletions
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'] ) )
{