]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix several more bugs in mobile category browsing (refs #213)
authorAndrew Dolgov <fox@bah.spb.su>
Wed, 23 Jul 2008 04:45:46 +0000 (05:45 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Wed, 23 Jul 2008 04:45:46 +0000 (05:45 +0100)
mobile/functions.php

index 062ed22d933401cd46b72015c892afa5a8f39391..070559eefa246eace503889ca1b69f256d7c77d3 100644 (file)
                        print "<form method=\"GET\" action=\"tt-rss.php\">";
                        print "<input type=\"hidden\" name=\"go\" value=\"vf\">";
                        print "<input type=\"hidden\" name=\"id\" value=\"$feed\">";
+                       print "<input type=\"hidden\" name=\"cat\" value=\"$cat_view\">";
 
                        print "<ul class=\"headlines\">";
 
                                        $published_pic = "<img class='marked' src=\"../images/pub_unset.gif\">";
                                }
 
-                               $content_link = "<a href=\"?go=view&id=$id&ret_feed=$feed&feed=$feed_id\">" .
+                               $content_link = "<a href=\"?go=view&id=$id&cat=$cat_view&ret_feed=$feed&feed=$feed_id\">" .
                                        $line["title"] . "</a>";
 
                                if (get_pref($link, 'HEADLINES_SMART_DATE')) {
                                print "<input type=\"checkbox\" name=\"sel_ids[$id]\" 
                                        onchange=\"toggleSelectRow(this, $id)\">";
 
-                               print "<a href=\"?go=vf&id=$feed&ts=$id\">$marked_pic</a>";
-                               print "<a href=\"?go=vf&id=$feed&tp=$id\">$published_pic</a>";
+                               print "<a href=\"?go=vf&id=$feed&ts=$id&cat=$cat_view\">$marked_pic</a>";
+                               print "<a href=\"?go=vf&id=$feed&tp=$id&cat=$cat_view\">$published_pic</a>";
 
                                print $content_link;
        
                $id = db_escape_string($_GET["id"]);
                $feed_id = db_escape_string($_GET["feed"]);
                $ret_feed_id = db_escape_string($_GET["ret_feed"]);
+               $cat_view = db_escape_string($_GET["cat"]);
 
                $result = db_query($link, "SELECT rtl_content FROM ttrss_feeds
                        WHERE id = '$feed_id' AND owner_uid = " . $_SESSION["uid"]);
                                #                               print "<img class=\"feedIcon\" src=\"../icons/$feed_id.ico\">";
                                #                       }
 
-                       $feed_link = "<a href=\"tt-rss.php?go=vf&id=$ret_feed_id\">Feed</a>";
-                       
+                       if (!$cat_view) {
+                               $feed_title = getFeedTitle($link, $ret_feed_id);
+                       } else {
+                               $feed_title = getCategoryTitle($link, $ret_feed_id);
+                               $feed_title_native = getFeedTitle($link, $feed_id);
+                       }
+
+                       if ($feed_title_native) {
+                               $feed_link = "<a href=\"tt-rss.php?go=vf&id=$feed_id\">$feed_title_native</a>";
+                               $feed_link .= " in <a href=\"tt-rss.php?go=vf&id=$ret_feed_id&cat=$cat_view\">
+                                       $feed_title</a>";
+                       } else {
+                               $feed_link = "<a href=\"tt-rss.php?go=vf&id=$ret_feed_id\">$feed_title</a>";
+                       }
+
                        print "<a href=\"" . $line["link"] . "\">" . 
                                truncate_string($line["title"], 30) . "</a>";
                        print " <span id=\"headingAddon\">$parsed_updated ($feed_link)</span>";