summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2007-08-09 13:45:30 +0100
committerAndrew Dolgov <[email protected]>2007-08-09 13:45:30 +0100
commite4f4b46f9d5d42dc53c4e2c5489da31a8ce10c26 (patch)
tree9acf4c2e0310cd942969eb0ee4488c65f9d6e322 /modules
parentffba8297eaada358f913d327816d4b7d91f3375b (diff)
published feeds work
Diffstat (limited to 'modules')
-rw-r--r--modules/backend-rpc.php31
-rw-r--r--modules/pref-feeds.php19
2 files changed, 50 insertions, 0 deletions
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 3ca471377..1e757ca72 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -69,6 +69,22 @@
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
}
+ if ($subop == "publ") {
+ $pub = $_GET["pub"];
+ $id = db_escape_string($_GET["id"]);
+
+ if ($pub == "1") {
+ $mark = "true";
+ } else {
+ $pub = "false";
+ }
+
+ // FIXME this needs collision testing
+
+ $result = db_query($link, "UPDATE ttrss_user_entries SET published = $pub
+ WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
+ }
+
if ($subop == "updateFeed") {
$feed_id = db_escape_string($_GET["feed"]);
@@ -179,6 +195,21 @@
print "</rpc-reply>";
}
+ if ($subop == "publishSelected") {
+
+ $ids = split(",", db_escape_string($_GET["ids"]));
+ $cmode = sprintf("%d", $_GET["cmode"]);
+
+ publishArticlesById($link, $ids, $cmode);
+
+ print "<rpc-reply>";
+ print "<counters>";
+ getAllCounters($link);
+ print "</counters>";
+ print_runtime_info($link);
+ print "</rpc-reply>";
+ }
+
if ($subop == "sanityCheck") {
print "<rpc-reply>";
if (sanity_check($link)) {
diff --git a/modules/pref-feeds.php b/modules/pref-feeds.php
index 9ef88e8fa..b5070c7e9 100644
--- a/modules/pref-feeds.php
+++ b/modules/pref-feeds.php
@@ -1043,5 +1043,24 @@
class=\"button\" onclick=\"gotoExportOpml()\"
value=\"".__('Export OPML')."\">";
+
+ print "<h3>Published articles</h3>";
+
+ if (!get_pref($link, "_PREFS_PUBLISH_KEY")) {
+ set_pref($link, "_PREFS_PUBLISH_KEY", generate_publish_key());
+ }
+
+ print "<p>".__('Published articles are exported as a public RSS feed and can be subscribed by anyone who knows the address specified below.')."</p>";
+
+ $url_path = 'http://' . $_SERVER["HTTP_HOST"] . \
+ parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
+
+ $url_path .= "?op=publish&key=" . get_pref($link, "_PREFS_PUBLISH_KEY");
+
+ print "<p><a id=\"pubGenAddress\" target=\"_new\" href=\"$url_path\">$url_path</a></p>";
+
+ print "<p><input type=\"submit\" onclick=\"return pubRegenKey()\"
+ value=\"".__('Generate another address')."\"></p>";
+
}
?>