From 75c510323be9682951412510d82f97d838dcb3bf Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 14 Nov 2010 21:50:13 +0300 Subject: remove google gears --- modules/backend-rpc.php | 214 ------------------------------------------------ modules/pref-prefs.php | 3 +- 2 files changed, 2 insertions(+), 215 deletions(-) (limited to 'modules') diff --git a/modules/backend-rpc.php b/modules/backend-rpc.php index 23706ea3d..286831804 100644 --- a/modules/backend-rpc.php +++ b/modules/backend-rpc.php @@ -713,220 +713,6 @@ return; } - if ($subop == "download") { - $stage = (int) $_REQUEST["stage"]; - $cidt = (int)db_escape_string($_REQUEST["cidt"]); - $cidb = (int)db_escape_string($_REQUEST["cidb"]); - $sync = db_escape_string($_REQUEST["sync"]); - //$amount = (int) $_REQUEST["amount"]; - //$unread_only = db_escape_string($_REQUEST["unread_only"]); - //if (!$amount) $amount = 50; - - /* Amount is not used by the frontend offline.js anymore, it goes by - * date_qpart below + cidb/cidt IDs */ - - $amount = 2000; - $unread_only = true; - - print ""; - - $sync = split(";", $sync); - - print ""; - - if (count($sync) > 0) { - if (strtotime($sync[0])) { - $last_online = db_escape_string($sync[0]); - - print ""; - - for ($i = 1; $i < count($sync); $i++) { - $e = split(",", $sync[$i]); - - if (count($e) == 3) { - - $id = (int) $e[0]; - $unread = bool_to_sql_bool((bool) $e[1]); - $marked = (bool)$e[2]; - - if ($marked) { - $marked = bool_to_sql_bool($marked); - $marked_qpart = "marked = $marked,"; - } - - $query = "UPDATE ttrss_user_entries SET - $marked_qpart - unread = $unread, - last_read = '$last_online' - WHERE ref_id = '$id' AND - (last_read IS NULL OR last_read < '$last_online') AND - owner_uid = ".$_SESSION["uid"]; - - $result = db_query($link, $query); - - print ""; - - } - } - - /* Maybe we need to further update local DB for this client */ - - $query = "SELECT ref_id,unread,marked FROM ttrss_user_entries - WHERE last_read >= '$last_online' AND - owner_uid = ".$_SESSION["uid"] . " LIMIT 1000"; - - $result = db_query($link, $query); - - while ($line = db_fetch_assoc($result)) { - $unread = (int) sql_bool_to_bool($line["unread"]); - $marked = (int) sql_bool_to_bool($line["marked"]); - - print ""; - } - - } - } - - print ""; - - if ($stage == 0) { - print ""; - - $result = db_query($link, "SELECT id, title, cat_id FROM - ttrss_feeds WHERE owner_uid = ".$_SESSION["uid"]); - - while ($line = db_fetch_assoc($result)) { - - $has_icon = (int) feed_has_icon($line["id"]); - - print ""; - } - - print ""; - - print ""; - - $result = db_query($link, "SELECT id, title, collapsed FROM - ttrss_feed_categories WHERE owner_uid = ".$_SESSION["uid"]); - - print ""; - - print ""; - - print ""; - - while ($line = db_fetch_assoc($result)) { - print ""; - } - - print ""; - - print ""; - - $result = db_query($link, "SELECT * FROM - ttrss_labels2 WHERE owner_uid = ".$_SESSION["uid"]); - - while ($line = db_fetch_assoc($result)) { - print ""; - } - - - print ""; - - } - - if ($stage > 0) { - print ""; - - $limit = 10; - $skip = $limit*($stage-1); - - print ""; - - if ($amount > 0) $amount -= $skip; - - if ($amount > 0) { - - $limit = min($limit, $amount); - - if ($unread_only) { - $unread_qpart = "(unread = true OR marked = true) AND "; - } - - if ($cidt && $cidb) { - $cid_qpart = "(ttrss_entries.id > $cidt OR ttrss_entries.id < $cidb) AND "; - } - - if (DB_TYPE == "pgsql") { - $date_qpart = "updated >= NOW() - INTERVAL '1 week' AND"; - } else { - $date_qpart = "updated >= DATE_SUB(NOW(), INTERVAL 1 WEEK) AND"; - } - - $result = db_query($link, - "SELECT DISTINCT ttrss_entries.id,ttrss_entries.title, - guid,link,comments, - feed_id,content,updated,unread,marked FROM - ttrss_user_entries,ttrss_entries,ttrss_feeds - WHERE $unread_qpart $cid_qpart $date_qpart - ttrss_feeds.id = feed_id AND - ref_id = ttrss_entries.id AND - ttrss_user_entries.owner_uid = ".$_SESSION["uid"]." - ORDER BY updated DESC LIMIT $limit OFFSET $skip"); - - if (function_exists('json_encode')) { - - while ($line = db_fetch_assoc($result)) { - print "
"; - } - } - - } - - print "
"; - - } - - print "
"; - - return; - } - if ($subop == "digest-get-contents") { $article_id = db_escape_string($_REQUEST['article_id']); diff --git a/modules/pref-prefs.php b/modules/pref-prefs.php index e291e5c11..004227939 100644 --- a/modules/pref-prefs.php +++ b/modules/pref-prefs.php @@ -14,7 +14,8 @@ $subop = $_REQUEST["subop"]; $prefs_blacklist = array("HIDE_FEEDLIST", "SYNC_COUNTERS", "ENABLE_LABELS", - "ENABLE_SEARCH_TOOLBAR", "HIDE_READ_FEEDS", "ENABLE_FEED_ICONS"); + "ENABLE_SEARCH_TOOLBAR", "HIDE_READ_FEEDS", "ENABLE_FEED_ICONS", + "ENABLE_OFFLINE_READING"); $profile_blacklist = array("ALLOW_DUPLICATE_POSTS", "PURGE_OLD_DAYS", "PURGE_UNREAD_ARTICLES", "DIGEST_ENABLE", "DIGEST_CATCHUP", -- cgit v1.2.3