From d9dde1d67aab87b461328b731b7b0e772f040565 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 24 Nov 2005 08:05:20 +0100 Subject: [PATCH] test button for label editor --- backend.php | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ prefs.js | 13 +++++++++++++ tt-rss.css | 4 ++++ 3 files changed, 73 insertions(+) diff --git a/backend.php b/backend.php index 327030e3..0ee60a3f 100644 --- a/backend.php +++ b/backend.php @@ -1726,6 +1726,58 @@ $subop = $_GET["subop"]; + if ($subop == "test") { + + $expr = $_GET["expr"]; + $descr = $_GET["descr"]; + + print "
"; + + print "

Label «$descr»

"; + +// print "

Expression: $expr

"; + + $result = db_query($link, + "SELECT count(id) AS num_matches + FROM ttrss_entries,ttrss_user_entries + WHERE ($expr) AND + ttrss_user_entries.ref_id = ttrss_entries.id AND + owner_uid = " . $_SESSION["uid"]); + + $num_matches = db_fetch_result($result, 0, "num_matches");; + + if ($num_matches > 0) { + + print "

Query returned $num_matches matches, first 5:

"; + + $result = db_query($link, + "SELECT title, + (SELECT title FROM ttrss_feeds WHERE id = feed_id) AS feed_title + FROM ttrss_entries,ttrss_user_entries + WHERE ($expr) AND + ttrss_user_entries.ref_id = ttrss_entries.id + AND owner_uid = " . $_SESSION["uid"] . " + ORDER BY date_entered DESC LIMIT 5"); + + print ""; + + } else { + print "

Query didn't return any matches.

"; + } + + print "
"; + + print "
+
"; + return; + } + if ($subop == "editSave") { $sql_exp = $_GET["s"]; @@ -1780,6 +1832,8 @@ owner_uid = ".$_SESSION["uid"]." ORDER by description"); + print "
PLACEHOLDER
"; + if (db_num_rows($result) != 0) { print "

"; @@ -1859,6 +1913,8 @@ if ($subop == "edit") { print "Edit label: +