diff options
author | rvelices <rv-github@modusoptimus.com> | 2008-05-03 01:52:08 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2008-05-03 01:52:08 +0000 |
commit | 40a882c3cf93030546f5ae2eddde7644c9db99bc (patch) | |
tree | 3be039a6b696c86421aa66b00318c344e62e9d2d /picture.php | |
parent | 5436a351ef6dd685483f022af6656bbf8b797cb6 (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/trunk@2327 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | picture.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/picture.php b/picture.php index 286b51ff6..8daacb353 100644 --- a/picture.php +++ b/picture.php @@ -35,9 +35,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', @@ -100,8 +102,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; @@ -867,11 +867,11 @@ if ($metadata_showable and isset($_GET['metadata'])) { include(PHPWG_ROOT_PATH.'include/picture_metadata.inc.php'); } -//------------------------------------------------------------ log informations -pwg_log($picture['current']['id'], 'picture'); include(PHPWG_ROOT_PATH.'include/page_header.php'); trigger_action('loc_end_picture'); $template->pparse('picture'); +//------------------------------------------------------------ log informations +pwg_log($picture['current']['id'], 'picture'); include(PHPWG_ROOT_PATH.'include/page_tail.php'); ?> |