aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_functions.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2007-02-27 01:56:16 +0000
committerrvelices <rv-github@modusoptimus.com>2007-02-27 01:56:16 +0000
commit47512ce6a64fa356214c162a8313480c6aed41d2 (patch)
treea0e35e2f89ef789f380adc5b8951444c189de4e7 /include/ws_functions.inc.php
parentbfb4b15d2f75835033d9bbb865edd77dcb282bb6 (diff)
- refactoring page['category'] before 1.7 release
page['category'] is not an id anymore, but an associative array of category info all of page['cat_xxx'] or page['uppercats'] merged into one simplifies calls to make_index_url give plugins a clean start for page variables for version 1.7 git-svn-id: http://piwigo.org/svn/trunk@1861 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/ws_functions.inc.php')
-rw-r--r--include/ws_functions.inc.php17
1 files changed, 6 insertions, 11 deletions
diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php
index e19966673..c8e2a0fe0 100644
--- a/include/ws_functions.inc.php
+++ b/include/ws_functions.inc.php
@@ -386,14 +386,12 @@ LIMIT '.$params['per_page']*$params['page'].','.$params['per_page'];
{
$url = make_index_url(
array(
- 'category' => $cat_id,
- 'cat_name' => $cats[$cat_id]['name'],
+ 'category' => $cats[$cat_id],
)
);
$page_url = make_picture_url(
array(
- 'category' => $cat_id,
- 'cat_name' => $cats[$cat_id]['name'],
+ 'category' => $cats[$cat_id],
'image_id' => $row['id'],
'image_file' => $row['file'],
)
@@ -484,8 +482,7 @@ ORDER BY global_rank';
{
$row['url'] = make_index_url(
array(
- 'category' => $row['id'],
- 'cat_name' => $row['name'],
+ 'category' => $row
)
);
foreach( array('id','nb_images','total_nb_images','nb_categories') as $key)
@@ -599,7 +596,7 @@ LIMIT 1;';
//-------------------------------------------------------- related categories
$query = '
-SELECT id,name,uppercats,global_rank,commentable
+SELECT id, name, uppercats, global_rank, commentable
FROM '.IMAGE_CATEGORY_TABLE.'
INNER JOIN '.CATEGORIES_TABLE.' ON category_id = id
WHERE image_id = '.$image_row['id'].'
@@ -617,8 +614,7 @@ SELECT id,name,uppercats,global_rank,commentable
unset($row['commentable']);
$row['url'] = make_index_url(
array(
- 'category' => $row['id'],
- 'cat_name' => $row['name'],
+ 'category' => $row
)
);
@@ -626,8 +622,7 @@ SELECT id,name,uppercats,global_rank,commentable
array(
'image_id' => $image_row['id'],
'image_file' => $image_row['file'],
- 'category' => $row['id'],
- 'cat_name' => $row['name'],
+ 'category' => $row
)
);
$row['id']=(int)$row['id'];