From b8a637f3d2eff88de1d2d76d9014cc0a4086d9d1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 18 Jan 2009 09:47:34 +0100 Subject: implement assign-to-label in subtoolbar --- functions.php | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index 2a3472902..665825e41 100644 --- a/functions.php +++ b/functions.php @@ -4027,7 +4027,7 @@
  •   ".__('Unread')."
  •   ".__('Starred')."
  •   ".__('Published')."
  • -
  • --------
  • +
  • ".__('Mark as read:')."
  •   ".__('Selection')."
  • "; @@ -4045,9 +4045,21 @@ print "
  •   ".__('Entire feed')."
  • "; - print "
  • --------
  • "; - print "
  • ".__('Other actions:')."
  • "; - + //print "
  • --------
  • "; + print "
  • ".__('Assign label:')."
  • "; + + $result = db_query($link, "SELECT id, caption FROM ttrss_labels2 WHERE + owner_uid = '".$_SESSION["uid"]."' ORDER BY caption"); + + while ($line = db_fetch_assoc($result)) { + + $label_id = $line["id"]; + $label_caption = $line["caption"]; + + print "
  • +   $label_caption
  • "; + } + print ""; print ""; @@ -6047,6 +6059,18 @@ } } + function label_find_caption($link, $label, $owner_uid) { + $result = db_query($link, + "SELECT caption FROM ttrss_labels2 WHERE id = '$label' + AND owner_uid = '$owner_uid' LIMIT 1"); + + if (db_num_rows($result) == 1) { + return db_fetch_result($result, 0, "caption"); + } else { + return ""; + } + } + function label_add_article($link, $id, $label, $owner_uid) { $label_id = label_find_id($link, $label, $owner_uid); -- cgit v1.2.3