diff options
author | Andrew Dolgov <[email protected]> | 2009-12-24 15:25:06 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2009-12-24 15:25:06 +0300 |
commit | 57937c42b99d94a4046986bbfb59fdf8d765408a (patch) | |
tree | 7e2ea1b319101915806c36ea76b84c4022bceed3 /mobile/classic/index.php | |
parent | 44258fa967a8804a80d84ebd845a8668c18ca890 (diff) |
obsolete cookie storage for collapsed status of feedlist and special categories (bump schema)
Diffstat (limited to 'mobile/classic/index.php')
-rw-r--r-- | mobile/classic/index.php | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/mobile/classic/index.php b/mobile/classic/index.php index 6a3aa5226..4b158395b 100644 --- a/mobile/classic/index.php +++ b/mobile/classic/index.php @@ -27,35 +27,34 @@ $cat_id = db_escape_string($_GET["id"]); - switch ($cat_id) { - case 0: - if ($_COOKIE["ttrss_vf_uclps"] != 1) { - setcookie("ttrss_vf_uclps", 1); - } else { - setcookie("ttrss_vf_uclps", 0); - } - break; - case -1: - if ($_COOKIE["ttrss_vf_vclps"] != 1) { - setcookie("ttrss_vf_vclps", 1); - } else { - setcookie("ttrss_vf_vclps", 0); - } - break; - case -2: - if ($_COOKIE["ttrss_vf_lclps"] != 1) { - setcookie("ttrss_vf_lclps", 1); - } else { - setcookie("ttrss_vf_lclps", 0); - } - break; - default: + if ($cat_id > 0) { db_query($link, "UPDATE ttrss_feed_categories SET collapsed = NOT collapsed WHERE id = '$cat_id' AND owner_uid = " . $_SESSION["uid"]); - break; + } else { + $pref_name = ''; + + switch ($cat_id) { + case -1: + $pref_name = '_COLLAPSED_SPECIAL'; + break; + case -2: + $pref_name = '_COLLAPSED_LABELS'; + break; + case 0: + $pref_name = '_COLLAPSED_UNCAT'; + break; + } + + if ($pref_name) { + if (get_pref($link, $pref_name)) { + set_pref($link, $pref_name, 'false'); + } else { + set_pref($link, $pref_name, 'true'); + } + } } - + header("Location: index.php"); return; } |