diff --git a/classes/feeds.php b/classes/feeds.php index 0b46155cf..2826f175e 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -835,8 +835,20 @@ class Feeds extends Handler_Protected { ccache_update($this->link, $feed, $_SESSION["uid"], $cat_view); } +/* if (is_numeric($feed) && $feed > 0) { + $view_settings = db_escape_string($this->link, json_encode(array( + "view_mode" => $view_mode, "order_by" => $order_by))); + + $table = $cat_view ? "ttrss_feed_categories" : "ttrss_feeds"; + + db_query($this->link, "UPDATE $table SET view_settings = '$view_settings' + WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]); + } else { + set_pref($this->link, "_DEFAULT_VIEW_MODE", $view_mode); + set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by); + } */ + set_pref($this->link, "_DEFAULT_VIEW_MODE", $view_mode); - set_pref($this->link, "_DEFAULT_VIEW_LIMIT", $limit); set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by); /* bump login timestamp if needed */ diff --git a/include/functions.php b/include/functions.php index 3bb158c05..1c1b73a37 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1138,7 +1138,7 @@ array_push($ret_arr, $cv); - $result = db_query($link, "SELECT id AS cat_id, value AS unread, + $result = db_query($link, "SELECT id AS cat_id, view_settings, value AS unread, (SELECT COUNT(id) FROM ttrss_feed_categories AS c2 WHERE c2.parent_cat = ttrss_feed_categories.id) AS num_children FROM ttrss_feed_categories, ttrss_cat_counters_cache @@ -1149,6 +1149,13 @@ while ($line = db_fetch_assoc($result)) { $line["cat_id"] = (int) $line["cat_id"]; + /* if ($line["view_settings"]) + $view_settings = @json_decode($line["view_settings"]); + else + $view_settings = null; */ + + $view_settings = null; + if ($line["num_children"] > 0) { $child_counter = getCategoryChildrenUnread($link, $line["cat_id"], $_SESSION["uid"]); } else { @@ -1156,6 +1163,7 @@ } $cv = array("id" => $line["cat_id"], "kind" => "cat", + "vs" => $view_settings, "counter" => $line["unread"] + $child_counter); array_push($ret_arr, $cv); @@ -1465,7 +1473,7 @@ $ret_arr = array(); - $query = "SELECT ttrss_feeds.id, + $query = "SELECT ttrss_feeds.id, view_settings, ttrss_feeds.title, ".SUBSTRING_FOR_DATE."(ttrss_feeds.last_updated,1,19) AS last_updated, last_error, value AS count @@ -1490,8 +1498,16 @@ if (date('Y') - date('Y', strtotime($line['last_updated'])) > 2) $last_updated = ''; + /* if ($line["view_settings"]) + $view_settings = @json_decode($line["view_settings"]); + else + $view_settings = null; */ + + $view_settings = null; + $cv = array("id" => $id, "updated" => $last_updated, + "vs" => $view_settings, "counter" => (int) $count, "has_img" => (int) $has_img); diff --git a/index.php b/index.php index 371c4aff3..6753ed59d 100644 --- a/index.php +++ b/index.php @@ -169,7 +169,7 @@ << - - - + +