aboutsummaryrefslogtreecommitdiffstats
path: root/include/section_init.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-11-29 14:06:16 +0000
committernikrou <nikrou@piwigo.org>2009-11-29 14:06:16 +0000
commitad796f152f38a37c3c9be438ee9a79ba7b307ebd (patch)
tree4862e6895ff5bee4f38914d942cda31ffa66b7c1 /include/section_init.inc.php
parentc96097529e49943eddba78d70e23e38c0eac494d (diff)
Feature_1255:
- bug fix : function pwg_db_get_recent_period_expression - add extra fields for select based on "order by" git-svn-id: http://piwigo.org/svn/trunk@4387 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/section_init.inc.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index c6576f1ea..e9bb7730a 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -292,7 +292,7 @@ SELECT id
// Main query
$query = '
-SELECT DISTINCT(image_id)
+SELECT DISTINCT(image_id)'.get_extra_fields($conf['order_by']).'
FROM '.IMAGE_CATEGORY_TABLE.'
INNER JOIN '.IMAGES_TABLE.' ON id = image_id
WHERE
@@ -326,7 +326,7 @@ else
if (!empty($items) )
{
$query = '
-SELECT DISTINCT image_id
+SELECT DISTINCT image_id'.get_extra_fields($conf['order_by']).'
FROM '.IMAGE_CATEGORY_TABLE.' INNER JOIN '.IMAGES_TABLE.' ON image_id=id
WHERE image_id IN ('.implode(',', $items).')
'.$forbidden.
@@ -443,7 +443,7 @@ SELECT image_id
}
$query = '
-SELECT DISTINCT(id)
+SELECT DISTINCT(id)'.get_extra_fields($conf['order_by'].'
FROM '.IMAGES_TABLE.'
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
WHERE
@@ -481,7 +481,7 @@ SELECT DISTINCT(id)
$page['super_order_by'] = true;
$conf['order_by'] = ' ORDER BY hit DESC, file ASC';
$query = '
-SELECT DISTINCT(id)
+SELECT DISTINCT(id), hit, file
FROM '.IMAGES_TABLE.'
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
WHERE hit > 0
@@ -508,7 +508,7 @@ SELECT DISTINCT(id)
$conf['order_by'] = ' ORDER BY average_rate DESC, id ASC';
$query ='
-SELECT DISTINCT(id)
+SELECT DISTINCT(id), average_rate
FROM '.IMAGES_TABLE.'
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
WHERE average_rate IS NOT NULL
@@ -531,7 +531,7 @@ SELECT DISTINCT(id)
else if ($page['section'] == 'list')
{
$query ='
-SELECT DISTINCT(id)
+SELECT DISTINCT(id)'.get_extra_fields($conf['order_by'].'
FROM '.IMAGES_TABLE.'
INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id = ic.image_id
WHERE image_id IN ('.implode(',', $page['list']).')