summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-23 07:42:37 +0100
committerAndrew Dolgov <[email protected]>2009-01-23 07:42:37 +0100
commit6b2ee18deff50122f49919f98b504dff175efd67 (patch)
treeba7e7a4d3a1db04006ebd60a0cc26e0c59542248 /functions.php
parent79c88e11a0b9fdd9c3e98008e77509a69d7fbc9a (diff)
new function: label_create
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/functions.php b/functions.php
index 0fb1fc287..af3dfe809 100644
--- a/functions.php
+++ b/functions.php
@@ -6004,6 +6004,28 @@
db_query($link, "COMMIT");
}
+ function label_create($link, $caption) {
+
+ db_query($link, "BEGIN");
+
+ $result = false;
+
+ $result = db_query($link, "SELECT id FROM ttrss_labels2
+ WHERE caption = '$caption' AND owner_uid = ". $_SESSION["uid"]);
+
+ if (db_num_rows($result) == 0) {
+ $result = db_query($link,
+ "INSERT INTO ttrss_labels2 (caption,owner_uid)
+ VALUES ('$caption', '".$_SESSION["uid"]."')");
+
+ $result = db_affected_rows($link, $result) != 0;
+ }
+
+ db_query($link, "COMMIT");
+
+ return $result;
+ }
+
function print_labels_headlines_dropdown($link, $feed_id) {
print "<li onclick=\"javascript:addLabel()\">
&nbsp;&nbsp;".__("Create label...")."</li>";