]> git.wh0rd.org - tt-rss.git/commitdiff
support comments on simplepie properly
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 22 Dec 2012 09:43:48 +0000 (13:43 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sat, 22 Dec 2012 09:43:48 +0000 (13:43 +0400)
include/rssfuncs.php

index eaa975a5af04f4b4f09cc8aca6cf732c3e5cf06f..f844aaeb9825befd20a50562adf002b1a0de2373 100644 (file)
                                $entry_author = mb_substr($entry_author, 0, 250);
 
                                if ($use_simplepie) {
-                                       $num_comments = 0; #FIXME#
+                                       $num_comments = $item->get_item_tags('http://purl.org/rss/1.0/modules/slash/', 'comments');
+
+                                       if (is_array($num_comments) && is_array($num_comments[0])) {
+                                               $num_comments = (int) $num_comments[0]["data"];
+                                       } else {
+                                               $num_comments = 0;
+                                       }
                                } else {
-                                       $num_comments = db_escape_string($item["slash"]["comments"]);
+                                       $num_comments = (int) $item["slash"]["comments"];
                                }
 
-                               if (!$num_comments) $num_comments = 0;
-
                                if ($debug_enabled) {
+                                       _debug("update_rss_feed: num_comments: $num_comments");
                                        _debug("update_rss_feed: looking for tags [1]...");
                                }