summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpfspot.class.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index f572759..2c3170c 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -636,6 +636,10 @@ class PHPFSPOT {
ON pt1.photo_id=pt". ($i+2) .".photo_id
";
}
+ $query_str.= "
+ INNER JOIN photos p
+ ON pt1.photo_id=p.id
+ ";
$query_str.= "WHERE pt1.tag_id=". $_SESSION['selected_tags'][0];
for($i = 1; $i < count($_SESSION['selected_tags']); $i++) {
$query_str.= "
@@ -1633,21 +1637,19 @@ class PHPFSPOT {
{
switch($_SESSION['sort_order']) {
case 'date_asc':
- return "ORDER BY p.time ASC";
+ return " ORDER BY p.time ASC";
break;
case 'date_desc':
- return "ORDER BY p.time DESC";
+ return " ORDER BY p.time DESC";
break;
case 'name_asc':
- return "ORDER BY p.name ASC";
+ return " ORDER BY p.name ASC";
break;
case 'name_desc':
- return "ORDER BY p.name DESC";
+ return " ORDER BY p.name DESC";
break;
}
- return $_SESSION['sort_order'];
-
} // get_sort_order()
}