updated copyright year on webpage
[photo-tags.git] / getjson.php
index 3e4cf4d4e9470245a2997c030c200ca27e8e9eb8..63daf0bc33d9b8c181e5d8ac1df70874e0a161a5 100644 (file)
@@ -25,7 +25,7 @@ if (isset($_REQUEST["S"]))
   }
  else if (isset($_REQUEST["NP"]))
   {
-    /* get +- 5 pics from ordered list to show next to a large image */
+    /* get +- 3 pics from ordered list to show next to a large image */
 
     /* first create a temp table with all images and then use rowid to get +-5 images */
 
@@ -55,8 +55,8 @@ if (isset($_REQUEST["S"]))
       {
        $ID=intval($_REQUEST["ID"]);
        $result = $DB->query("SELECT * FROM NEXTPREV".
-                            " WHERE rowid > (select rowid from NEXTPREV where id=$ID) -5".
-                            "   AND rowid < (select rowid from NEXTPREV where id=$ID) +5");
+                            " WHERE rowid > (select rowid from NEXTPREV where id=$ID) -3".
+                            "   AND rowid < (select rowid from NEXTPREV where id=$ID) +3");
       }
     else
       {
@@ -67,9 +67,16 @@ if (isset($_REQUEST["S"]))
  else if (isset($_REQUEST["ID"]) && !isset($_REQUEST["C"]))
   {
     $id  = intval($_REQUEST["ID"]);
-    $result = $DB->query("SELECT base_uri, filename, id FROM photos".
+    $result = $DB->query("SELECT base_uri, filename, id, description, time FROM photos".
                         " WHERE id=$id");
   }
+ else if (isset($_REQUEST["IDT"]))
+   {  /* tags of a single image */
+    $id  = intval($_REQUEST["IDT"]);
+    $result = $DB->query("SELECT t.name as name FROM photo_tags pt ".
+                        " LEFT JOIN tags t on t.id=pt.tag_id".
+                        " WHERE pt.photo_id=$id");
+  }
  else if (isset($_REQUEST["CLOUD"]))
   {
     $result = $DB->query("SELECT t.name as name, count(*) as count FROM photo_tags pt ".