From 9de6ced109e3f37824cca26948f2a9f8bade4e7e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 13 Apr 2011 15:09:00 +0400 Subject: [PATCH] mobile: properly handle going back from article to flat category list --- mobile/article.php | 7 ++++--- mobile/functions.php | 11 +++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mobile/article.php b/mobile/article.php index 2379e939..cbdad84d 100644 --- a/mobile/article.php +++ b/mobile/article.php @@ -7,11 +7,11 @@ require_once "../config.php"; require_once "functions.php"; - require_once "../functions.php"; + require_once "../functions.php"; require_once "../sessions.php"; - require_once "../version.php"; + require_once "../version.php"; require_once "../db-prefs.php"; $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); @@ -23,7 +23,8 @@ $id = db_escape_string($_REQUEST["id"]); $feed_id = db_escape_string($_REQUEST["feed"]); $cat_id = db_escape_string($_REQUEST["cat"]); + $is_cat = db_escape_string($_REQUEST["is_cat"]); - render_article($link, $id, $feed_id, $cat_id); + render_article($link, $id, $feed_id, $cat_id, $is_cat); ?> diff --git a/mobile/functions.php b/mobile/functions.php index 6e5d1daf..542420af 100644 --- a/mobile/functions.php +++ b/mobile/functions.php @@ -388,7 +388,7 @@ $icon_url = "../images/blank_icon.gif"; } - print "
  • + print "
  • "; print $line["title"]; print "
  • "; @@ -429,7 +429,7 @@ } - function render_article($link, $id, $feed_id, $cat_id) { + function render_article($link, $id, $feed_id, $cat_id, $is_cat) { $query = "SELECT title,link,content,feed_id,comments,int_id, marked,unread,published, @@ -455,11 +455,14 @@ $title = $line["title"]; $article_link = $line["link"]; - $feed_title = getFeedTitle($link, $feed_id, false); + if (!$is_cat) + $feed_title = getFeedTitle($link, $feed_id); + else + $feed_title = getCategoryTitle($link, $feed_id); print "
    "; + myBackLabel='$feed_title' myBackHref='feed.php?id=$feed_id&cat=$cat_id&is_cat=$is_cat'>"; print "

    $title

    "; -- 2.39.5