]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions2.php
force ngettext() count argument type to string
[tt-rss.git] / include / functions2.php
index 6b6f5aa560b630d393b28f42c44e738fad2dcf78..28477a0cfd0c7447f5a0237eae0d5fca6f2d7eaf 100644 (file)
                                $line = $p->hook_render_article($line);
                        }
 
-                       $num_comments = $line["num_comments"];
+                       $num_comments = (int) $line["num_comments"];
                        $entry_comments = "";
 
                        if ($num_comments > 0) {
 
                                if (!$ctype) $ctype = __("unknown type");
 
-                               $filename = substr($url, strrpos($url, "/")+1);
+                               //$filename = substr($url, strrpos($url, "/")+1);
+                               $filename = basename($url);
 
                                $player = format_inline_player($url, $ctype);
 
 
                        foreach ($entries as $entry) {
                                if ($entry["title"])
-                                       $title = "— " . truncate_string($entry["title"], 30);
+                                       $title = " — " . truncate_string($entry["title"], 30);
                                else
                                        $title = "";
 
+                               if ($entry["filename"])
+                                       $filename = truncate_middle(htmlspecialchars($entry["filename"]), 60);
+                               else
+                                       $filename = "";
+
                                $rv .= "<div onclick='window.open(\"".htmlspecialchars($entry["url"])."\")'
-                                       dojoType=\"dijit.MenuItem\">".htmlspecialchars($entry["filename"])."$title</div>";
+                                       dojoType=\"dijit.MenuItem\">".$filename . $title."</div>";
 
                        };