]> git.wh0rd.org Git - tt-rss.git/commitdiff
add function get_article_labels()
authorAndrew Dolgov <fox@bah.spb.su>
Sun, 18 Jan 2009 11:23:35 +0000 (12:23 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sun, 18 Jan 2009 11:23:35 +0000 (12:23 +0100)
functions.php

index 326fa74b5638d62f5a8b16670685507e908d469d..793fa5f40a48b3a3e577bcde7acd9098e5e701ca 100644 (file)
                }
        }
 
+       function get_article_labels($link, $id) {
+               $result = db_query($link, 
+                       "SELECT DISTINCT label_id,caption 
+                               FROM ttrss_labels2, ttrss_user_labels2 
+                       WHERE id = label_id 
+                               AND article_id = '$id' 
+                               AND owner_uid = ".$_SESSION["uid"]);
+
+               $rv = array();
+
+               while ($line = db_fetch_assoc($result)) {
+                       $rk = array($line["label_id"], $line["caption"]);
+                       array_push($rv, $rk);
+               }
+
+               return $rv;
+       }
+
+
        function label_find_caption($link, $label, $owner_uid) {
                $result = db_query($link, 
                        "SELECT caption FROM ttrss_labels2 WHERE id = '$label'