add function get_article_labels()

This commit is contained in:
Andrew Dolgov 2009-01-18 12:23:35 +01:00
parent beb760d516
commit 814bff6649
1 changed files with 19 additions and 0 deletions

View File

@ -6008,6 +6008,25 @@
} }
} }
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) { function label_find_caption($link, $label, $owner_uid) {
$result = db_query($link, $result = db_query($link,
"SELECT caption FROM ttrss_labels2 WHERE id = '$label' "SELECT caption FROM ttrss_labels2 WHERE id = '$label'