diff options
author | Andreas Unterkircher <unki@netshadow.at> | 2007-06-06 04:14:30 +0000 |
---|---|---|
committer | Andreas Unterkircher <unki@netshadow.at> | 2007-06-06 04:14:30 +0000 |
commit | 4e4feabf9fc563af3e39af741c078bb3a9afedb8 (patch) | |
tree | b9fd5ec5e2563aa08588f08dfce45f4942643ade | |
parent | 495fee6e4ea622177353c74425d546aedf467991 (diff) |
if user has not selected tags right now, display all images
git-svn-id: file:///var/lib/svn/phpfspot/trunk@22 fa6a889d-dae6-447d-9e79-4ba9a3039384
-rw-r--r-- | phpfspot.class.php | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php index 168d081..6a2edc3 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -188,18 +188,25 @@ class PHPFSPOT { public function getAllTagPhotos() { - $selected = ""; - foreach($_SESSION['selected_tags'] as $tag) - $selected.= $tag .","; - $selected = substr($selected, 0, strlen($selected)-1); - $tagged_photos = Array(); - $result = $this->db->db_query(" - SELECT DISTINCT photo_id - FROM photo_tags - WHERE tag_id IN (". $selected .") - "); + if(isset($_SESSION['selected_tags'])) { + $selected = ""; + foreach($_SESSION['selected_tags'] as $tag) + $selected.= $tag .","; + $selected = substr($selected, 0, strlen($selected)-1); + $result = $this->db->db_query(" + SELECT DISTINCT photo_id + FROM photo_tags + WHERE tag_id IN (". $selected .") + "); + } + else { + $result = $this->db->db_query(" + SELECT DISTINCT photo_id + FROM photo_tags + "); + } while($row = $this->db->db_fetch_object($result)) { array_push($tagged_photos, $row['photo_id']); |