]> git.wh0rd.org Git - tt-rss.git/commitdiff
mobile: properly handle going back from article to flat category list
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 13 Apr 2011 11:09:00 +0000 (15:09 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 13 Apr 2011 11:09:00 +0000 (15:09 +0400)
mobile/article.php
mobile/functions.php

index 2379e9395949e58be5629c78c6335781c3db2e66..cbdad84da329dc969ea4f16faae88105f3cee8e8 100644 (file)
@@ -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);
 ?>
 
index 6e5d1dafe0beb043b6c734aa4310870c6fc17830..542420afeb9daa66de3ee3a44c372ebeee6d56c9 100644 (file)
                                $icon_url = "../images/blank_icon.gif";
                        }
 
-                       print "<li class='$class'><a href='article.php?id=$id&feed=$feed_id&cat=$cat_id'>
+                       print "<li class='$class'><a href='article.php?id=$id&feed=$feed_id&cat=$cat_id&is_cat=$is_cat'>
                                <img class='tinyIcon' src='$icon_url'>";
                        print $line["title"];
                        print "</a></li>";
 
        }
 
-       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,
                        $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 "<div class=\"panel\" id=\"article-$id\" title=\"$title\"
                                selected=\"true\"
-                               myBackLabel='$feed_title' myBackHref='feed.php?id=$feed_id&cat=$cat_id'>";
+                               myBackLabel='$feed_title' myBackHref='feed.php?id=$feed_id&cat=$cat_id&is_cat=$is_cat'>";
 
                        print "<h2><a target='_blank' href='$article_link'>$title</a></h2>";