diff options
author | rvelices <rv-github@modusoptimus.com> | 2008-09-21 11:06:20 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2008-09-21 11:06:20 +0000 |
commit | 93fb07841fad34e25ff1e7d5d353dcb7433d094d (patch) | |
tree | ea89517a2cab2f8d7d23b57413a14d5995e6aeed /admin/include/functions.php | |
parent | a0a0511a6ff430797618b6aa3640fc6bed8b4dc6 (diff) |
- fix function get_fulldirs - works correctly eent for wrong params (virtual cats)
- fix functions_metadata.php - could not be included from inside another function
git-svn-id: http://piwigo.org/svn/trunk@2560 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/functions.php | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php index 8453dad73..af98d1cb3 100644 --- a/admin/include/functions.php +++ b/admin/include/functions.php @@ -798,24 +798,14 @@ SELECT id, dir FROM '.CATEGORIES_TABLE.' WHERE dir IS NOT NULL ;'; - $result = pwg_query($query); - $cat_dirs = array(); - while ($row = mysql_fetch_array($result)) - { - $cat_dirs[$row['id']] = $row['dir']; - } + $cat_dirs = simple_hash_from_query($query, 'id', 'dir'); // caching galleries_url $query = ' SELECT id, galleries_url FROM '.SITES_TABLE.' ;'; - $result = pwg_query($query); - $galleries_url = array(); - while ($row = mysql_fetch_array($result)) - { - $galleries_url[$row['id']] = $row['galleries_url']; - } + $galleries_url = simple_hash_from_query($query, 'id', 'galleries_url'); // categories : id, site_id, uppercats $categories = array(); @@ -823,7 +813,8 @@ SELECT id, galleries_url $query = ' SELECT id, uppercats, site_id FROM '.CATEGORIES_TABLE.' - WHERE id IN ( + WHERE dir IS NOT NULL + AND id IN ( '.wordwrap(implode(', ', $cat_ids), 80, "\n").') ;'; $result = pwg_query($query); |