aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_default.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2006-03-21 01:27:21 +0000
committerrvelices <rv-github@modusoptimus.com>2006-03-21 01:27:21 +0000
commite584310d3a51bcae7be00513a852ad43e22c585b (patch)
tree649befce1fa32157838995e25a720dc0f0dbed3c /include/category_default.inc.php
parent0c08b2561aa95b134499a157dd5a90b89460cff8 (diff)
URL rewriting: fix some old links, calendar simplification and prepare code
for urls without ? (added functions get_root_url and add_url_param) git-svn-id: http://piwigo.org/svn/trunk@1090 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/category_default.inc.php')
-rw-r--r--include/category_default.inc.php58
1 files changed, 15 insertions, 43 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php
index 599c527a9..e7c4b8ddc 100644
--- a/include/category_default.inc.php
+++ b/include/category_default.inc.php
@@ -28,7 +28,7 @@
/**
* This file is included by the main page to show thumbnails for the default
* case
- *
+ *
*/
$page['rank_of'] = array_flip($page['items']);
@@ -52,7 +52,7 @@ SELECT *
while ($row = mysql_fetch_array($result))
{
$row['rank'] = $page['rank_of'][ $row['id'] ];
-
+
array_push($pictures, $row);
}
@@ -72,50 +72,22 @@ if (count($pictures) > 0)
foreach ($pictures as $row)
{
$thumbnail_url = get_thumbnail_src($row['path'], @$row['tn_ext']);
-
+
// message in title for the thumbnail
$thumbnail_title = $row['file'];
if (isset($row['filesize']))
{
$thumbnail_title .= ' : '.$row['filesize'].' KB';
}
-
- // url link on picture.php page
- $url_link = PHPWG_ROOT_PATH.'picture.php?/'.$row['id'];
- switch ($page['section'])
- {
- case 'categories' :
- {
- $url_link.= '/category/'.$page['category'];
- break;
- }
- case 'tags' :
- {
- // TODO
- break;
- }
- case 'search' :
- {
- $url_link.= '/search/'.$page['search'];
- break;
- }
- case 'list' :
- {
- $url_link.= '/list/'.implode(',', $page['list']);
- break;
- }
- default :
- {
- $url_link.= '/'.$page['section'];
- }
- }
-
- if (isset($page['chronology']))
- {
- $url_link.= '/chronology='.$page['chronology'];
- }
-
+ // link on picture.php page
+ $url = duplicate_picture_url(
+ array(
+ 'image_id' => $row['id'],
+ 'image_file' => $row['file']
+ )
+ );
+
$template->assign_block_vars(
'thumbnails.line.thumbnail',
array(
@@ -123,8 +95,8 @@ foreach ($pictures as $row)
'IMAGE_ALT' => $row['file'],
'IMAGE_TITLE' => $thumbnail_title,
'IMAGE_TS' => get_icon($row['date_available']),
-
- 'U_IMG_LINK' => $url_link
+
+ 'U_IMG_LINK' => $url
)
);
@@ -158,7 +130,7 @@ foreach ($pictures as $row)
break;
}
}
-
+
$template->assign_block_vars(
'thumbnails.line.thumbnail.element_name',
array(
@@ -166,7 +138,7 @@ foreach ($pictures as $row)
)
);
}
-
+
if ($user['show_nb_comments']
and isset($page['category'])
and $page['cat_commentable'])