summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-22 13:43:48 +0400
committerAndrew Dolgov <[email protected]>2012-12-22 13:43:48 +0400
commit83e6e313be6de7d6e3f155a13c821ab82da12575 (patch)
tree721d950d11291dbc27ce04bc2d5464d9f6d3782a
parent35cb2b8f67368be40f8f5365a3987bf9f1a5ff60 (diff)
support comments on simplepie properly
-rw-r--r--include/rssfuncs.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index eaa975a5a..f844aaeb9 100644
--- a/include/rssfuncs.php
+++ b/include/rssfuncs.php
@@ -678,14 +678,19 @@
$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]...");
}