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
This commit is contained in:
rvelices
2008-05-03 01:51:50 +00:00
parent 226c61c6f9
commit be31d7b2de
3 changed files with 53 additions and 18 deletions
+3 -3
View File
@@ -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;