aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-05-03 01:51:50 +0000
committerrvelices <rv-github@modusoptimus.com>2008-05-03 01:51:50 +0000
commitbe31d7b2ded3679cf28d1bfac605c9576b034e1d (patch)
treec6b0d1deb55d2af42add502a7ee4b3068c4a7b89 /picture.php
parent226c61c6f9dbd6ebac686b2bf0a5b0ae8eea2238 (diff)
just some optimizations (especially for large dbs)
- replace some REGEXP with LIKE in sql - optimized queries for the combination of large data sets with picture_url_style file git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2326 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/picture.php b/picture.php
index 0e64d2946..abb3d714b 100644
--- a/picture.php
+++ b/picture.php
@@ -38,9 +38,11 @@ if (isset($page['category']))
check_restrictions($page['category']['id']);
}
+$page['rank_of'] = array_flip($page['items']);
+
// if this image_id doesn't correspond to this category, an error message is
// displayed, and execution is stopped
-if (!in_array($page['image_id'], $page['items']))
+if ( !isset($page['rank_of'][$page['image_id']]) )
{
page_not_found(
'The requested image does not belong to this image set',
@@ -103,8 +105,6 @@ function default_picture_content($content, $element_info)
// | initialization |
// +-----------------------------------------------------------------------+
-$page['rank_of'] = array_flip($page['items']);
-
// caching first_rank, last_rank, current_rank in the displayed
// section. This should also help in readability.
$page['first_rank'] = 0;