X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=modules%2Fbackend-rpc.php;h=228d45a78eabbdecbb5ae41f54cd30042793f9cf;hb=6a7817c1ad684ea6eb0b02180e6d2040b3cb0a77;hp=f8233a7cd51495abe65a356b7dbed35b330ad4ea;hpb=911d4c0836cf6d1be53be5917739defc91277a7e;p=tt-rss.git diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index f8233a7c..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,6 +939,54 @@ 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, 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 ""; + return; + } + if ($subop == "digest-init") { print ""; @@ -985,32 +994,26 @@ $feeds = array(); foreach ($tmp_feeds as $f) { - if ($f['id'] > 0) array_push($feeds, $f); + 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']; + print ""; - if ($a == $b) { - return 0; - } - return ($a < $b) ? 1 : -1; - } + print ""; + return; + } -// uasort($feeds, 'feeds_sort_by_unread_rev'); -// $feeds = array_slice($feeds, 0, 10); + if ($subop == "catchupFeed") { - print ""; + $feed_id = db_escape_string($_REQUEST['feed_id']); + $is_cat = db_escape_string($_REQUEST['is_cat']); - $headlines = api_get_headlines($link, -4, 20, 0, - '', true, true, false, "all_articles", "updated DESC"); + print ""; - //function api_get_headlines($link, $feed_id, $limit, $offset, - // $filter, $is_cat, $show_excerpt, $show_content, $view_mode) { + catchup_feed($link, $feed_id, $is_cat); - print ""; print ""; + return; }