summaryrefslogtreecommitdiffstats
path: root/phpfspot.class.php
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2007-06-06 20:38:10 +0000
committerAndreas Unterkircher <unki@netshadow.at>2007-06-06 20:38:10 +0000
commitf5ebd8bd36353e5920031e7424ae02c212060b1b (patch)
treeef1d8c04b020d26e1180ac849eb23a1701937aea /phpfspot.class.php
parent89f91f657ec8ee7f53c974292c0f3dd91e9e785e (diff)
sort images by time like f-spot does
git-svn-id: file:///var/lib/svn/phpfspot/trunk@31 fa6a889d-dae6-447d-9e79-4ba9a3039384
Diffstat (limited to 'phpfspot.class.php')
-rw-r--r--phpfspot.class.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index 27a0079..5b18be5 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -176,14 +176,20 @@ class PHPFSPOT {
$selected = substr($selected, 0, strlen($selected)-1);
$result = $this->db->db_query("
SELECT DISTINCT photo_id
- FROM photo_tags
- WHERE tag_id IN (". $selected .")
+ FROM photo_tags pt
+ INNER JOIN photos p
+ ON p.id=pt.photo_id
+ WHERE pt.tag_id IN (". $selected .")
+ ORDER BY p.time ASC
");
}
else {
$result = $this->db->db_query("
SELECT DISTINCT photo_id
- FROM photo_tags
+ FROM photo_tags pt
+ INNER JOIN photos p
+ ON p.id=pt.photo_id
+ ORDER BY p.time ASC
");
}