summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-05-21 05:28:51 +0100
committerAndrew Dolgov <[email protected]>2006-05-21 05:28:51 +0100
commit86b682ce2f0b7f20b7cc032df1845f56729fbe82 (patch)
tree1bbf75c7197ec9a721971f3708f3c9c8791f45a8 /functions.php
parentea0e4caf8080e9f285f10f277eb7d42998b10d1a (diff)
search dialog improvements, main toolbar overhaul
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index d9df9ca3a..765ff8ce5 100644
--- a/functions.php
+++ b/functions.php
@@ -1639,4 +1639,49 @@
function checkbox_to_sql_bool($val) {
return ($val == "on") ? "true" : "false";
}
+
+ function getFeedCatTitle($link, $id) {
+ if ($id == -1) {
+ return "Special";
+ } else if ($id < -10) {
+ return "Labels";
+ } else if ($id > 0) {
+ $result = db_query($link, "SELECT ttrss_feed_categories.title
+ FROM ttrss_feeds, ttrss_feed_categories WHERE ttrss_feeds.id = '$id' AND
+ cat_id = ttrss_feed_categories.id");
+ if (db_num_rows($result) == 1) {
+ return db_fetch_result($result, 0, "title");
+ } else {
+ return "Unknown category ($id)";
+ }
+ } else {
+ return "getFeedCatTitle($id) failed";
+ }
+
+ }
+
+ function getFeedTitle($link, $id) {
+ if ($id == -1) {
+ return "Starred articles";
+ } else if ($id < -10) {
+ $label_id = -10 - $id;
+ $result = db_query($link, "SELECT description FROM ttrss_labels WHERE id = '$label_id'");
+ if (db_num_rows($result) == 1) {
+ return db_fetch_result($result, 0, "description");
+ } else {
+ return "Unknown label ($label_id)";
+ }
+
+ } else if ($id > 0) {
+ $result = db_query($link, "SELECT title FROM ttrss_feeds WHERE id = '$id'");
+ if (db_num_rows($result) == 1) {
+ return db_fetch_result($result, 0, "title");
+ } else {
+ return "Unknown feed ($id)";
+ }
+ } else {
+ return "getFeedTitle($id) failed";
+ }
+
+ }
?>