Getting the exact comment count
-
I’ve been using your plugin for a while now and it has worked great for me.
In fbci.class.php of the latest version (1.2.1) there are several lines that refer to
count($item["comments"])
.If you want to get the exact comment count, you should use
count($item["comments"]["data"])
.This is what I have at around line 135:
if(!isset($item["comments"]) || !isset($item["comments"]["data"])) { $this->test_result .= "<td>" . __('No comment', 'facebook-comments-importer') . "</td>" ; } else { $this->test_result .= "<td>" . sizeof($item["comments"]["data"]) . " " . __('comments', 'facebook-comments-importer') . "</td>" ; } $nb_imported_comments = $this->get_imported_comment_number($post_id); if(!isset($item['link']) || ($post_id == 0)){ $this->test_result .= "<td style=\"color:red\">" . __('Impossible', 'facebook-comments-importer') . "</td>" ; } elseif($nb_imported_comments == 0 && (!isset($item["comments"]) || !isset($item["comments"]["data"]))){ $this->test_result .= "<td>-</td>" ; } elseif($nb_imported_comments == 0){ $this->test_result .= "<td>" . __('Not yet', 'facebook-comments-importer') . "</td>" ; } else { $this->test_result .= "<td style=\"color:green\">" . $nb_imported_comments . " " . __('comments', 'facebook-comments-importer') . "</td>" ; }
Hope it helps ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Getting the exact comment count’ is closed to new replies.