X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=modules%2Fbackend-rpc.php;h=228d45a78eabbdecbb5ae41f54cd30042793f9cf;hb=6a7817c1ad684ea6eb0b02180e6d2040b3cb0a77;hp=976fac15c09327241be6f4ac28664b18cb35923b;hpb=c1b5cd23e068d269a2736ac4759fbaa09243f4dd;p=tt-rss.git
diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php
index 976fac15..228d45a7 100644
--- a/modules/backend-rpc.php
+++ b/modules/backend-rpc.php
@@ -156,12 +156,11 @@
if ($subop == "getAllCounters") {
print "";
- print "";
+ print "";
+ print "]]>";
print_runtime_info($link);
print "";
@@ -183,14 +182,9 @@
$result = db_query($link, "UPDATE ttrss_user_entries SET marked = $mark
WHERE ref_id = '$id' AND owner_uid = " . $_SESSION["uid"]);
- print "";
- getGlobalCounters($link);
- getVirtCounters($link);
- getLabelCounters($link);
- if (get_pref($link, 'ENABLE_FEED_CATS')) {
- getCategoryCounters($link);
- }
- print "";
+ print "";
return;
}
@@ -201,13 +195,9 @@
$result = db_query($link, "DELETE FROM ttrss_user_entries
WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
- print "";
- getGlobalCounters($link);
- getVirtCounters($link);
- if (get_pref($link, 'ENABLE_FEED_CATS')) {
- getCategoryCounters($link);
- }
- print "";
+ print "";
return;
}
@@ -219,13 +209,9 @@
SET feed_id = orig_feed_id, orig_feed_id = NULL
WHERE ref_id IN ($ids) AND owner_uid = " . $_SESSION["uid"]);
- print "";
- getGlobalCounters($link);
- getVirtCounters($link);
- if (get_pref($link, 'ENABLE_FEED_CATS')) {
- getCategoryCounters($link);
- }
- print "";
+ print "";
return;
}
@@ -237,13 +223,9 @@
archive_article($link, $id, $_SESSION["uid"]);
}
- print "";
- getGlobalCounters($link);
- getVirtCounters($link);
- if (get_pref($link, 'ENABLE_FEED_CATS')) {
- getCategoryCounters($link);
- }
- print "";
+ print "";
return;
}
@@ -274,14 +256,9 @@
print "";
- print "";
- getGlobalCounters($link);
- getVirtCounters($link);
- getLabelCounters($link);
- if (get_pref($link, 'ENABLE_FEED_CATS')) {
- getCategoryCounters($link);
- }
- print "";
+ print "";
if ($note != 'undefined') {
$note_size = strlen($note);
@@ -301,9 +278,9 @@
update_rss_feed($link, $feed_id);
print "";
- print "";
- getFeedCounter($link, $feed_id);
- print "";
+ print "";
print "";
return;
@@ -316,31 +293,14 @@
print "";
- print "";
+ print "";
+ print "]]>";
print_runtime_info($link);
@@ -358,9 +318,10 @@
catchupArticlesById($link, $ids, $cmode);
print "";
- print "";
- getAllCounters($link, $_REQUEST["omode"]);
- print "";
+ print "";
+
print_runtime_info($link);
print "";
@@ -375,9 +336,9 @@
markArticlesById($link, $ids, $cmode);
print "";
- print "";
- getAllCounters($link, $_REQUEST["omode"]);
- print "";
+ print "";
print_runtime_info($link);
print "";
@@ -392,9 +353,9 @@
publishArticlesById($link, $ids, $cmode);
print "";
- print "";
- getAllCounters($link, $_REQUEST["omode"]);
- print "";
+ print "";
print_runtime_info($link);
print "";
@@ -649,9 +610,9 @@
print "";
- print "";
- getAllCounters($link, $omode);
- print "";
+ print "";
print "";
return;
@@ -686,9 +647,9 @@
print "";
- print "";
- getAllCounters($link, $omode);
- print "";
+ print "";
print "";
return;
@@ -978,22 +939,48 @@
return;
}
+ if ($subop == "digest-get-contents") {
+ $article_id = db_escape_string($_REQUEST['article_id']);
+
+ $result = db_query($link, "SELECT content
+ FROM ttrss_entries, ttrss_user_entries
+ WHERE id = '$article_id' AND ref_id = id AND owner_uid = ".$_SESSION['uid']);
+
+ print "";
+
+ print "";
+
+ print "";
+
+ return;
+ }
+
if ($subop == "digest-update") {
$feed_id = db_escape_string($_REQUEST['feed_id']);
$offset = db_escape_string($_REQUEST['offset']);
+ $seq = db_escape_string($_REQUEST['seq']);
if (!$feed_id) $feed_id = -4;
if (!$offset) $offset = 0;
-
-
print "";
+ print "$seq";
+
$headlines = api_get_headlines($link, $feed_id, 10, $offset,
- '', ($feed_id == -4), true, true, "unread", "updated DESC");
+ '', ($feed_id == -4), true, false, "unread", "updated DESC");
//function api_get_headlines($link, $feed_id, $limit, $offset,
// $filter, $is_cat, $show_excerpt, $show_content, $view_mode) {
+ print "";
+
print "";
print "";
@@ -1010,19 +997,6 @@
if ($f['id'] > 0 || $f['id'] == -4) array_push($feeds, $f);
}
- function feeds_sort_by_unread_rev($a, $b) {
- $a = $a['unread'];
- $b = $b['unread'];
-
- if ($a == $b) {
- return 0;
- }
- return ($a < $b) ? 1 : -1;
- }
-
- //uasort($feeds, 'feeds_sort_by_unread_rev');
- //$feeds = array_slice($feeds, 0, 10);
-
print "";
print "";