aboutsummaryrefslogtreecommitdiffstats
path: root/include/category_default.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/category_default.inc.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/include/category_default.inc.php b/include/category_default.inc.php
index 409829282..6eba15e8c 100644
--- a/include/category_default.inc.php
+++ b/include/category_default.inc.php
@@ -38,7 +38,7 @@
$array_cat_directories = array();
$query = '
-SELECT DISTINCT(id),file,date_available
+SELECT DISTINCT(id),file,date_available,category_id
,tn_ext,name,filesize,storage_category_id,average_rate
FROM '.IMAGES_TABLE.' AS i
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=ic.image_id
@@ -113,7 +113,15 @@ while ($row = mysql_fetch_array($result))
}
$thumbnail_title .= ' : '.$filesize.' KB';
// url link on picture.php page
- $url_link = PHPWG_ROOT_PATH.'picture.php?cat='.$page['cat'];
+ $url_link = PHPWG_ROOT_PATH.'picture.php?';
+ if ($page['cat'] == 'random')
+ {
+ $url_link.= 'cat='.$row['category_id'];
+ }
+ else
+ {
+ $url_link.= 'cat='.$page['cat'];
+ }
$url_link.= '&image_id='.$row['id'];
if ($page['cat'] == 'search')
{