function _fb_social_comments_link in Facebook social plugins integration 7.2
Same name and namespace in other branches
- 6.2 plugins/fb_plugin/comments.inc \_fb_social_comments_link()
Pseudo hook_link for this plugin
1 string reference to '_fb_social_comments_link'
- comments.inc in plugins/
fb_plugin/ comments.inc
File
- plugins/
fb_plugin/ comments.inc, line 214
Code
function _fb_social_comments_link($preset, $type, $node, $view_mode) {
$links = array();
if ('teaser' !== $view_mode) {
return $links;
}
if (!fb_social_preset_node_types($preset, $node->type)) {
return $links;
}
if (!$preset->settings['plugin_comments_count']['count']) {
return $links;
}
$link_url = fb_social_url('node/' . $node->nid);
$nr_comments = _fb_social_comments_comments_count($link_url, $preset);
if ($nr_comments) {
$link_title = format_plural($nr_comments, '1 comment', '@count comments');
$links['fb-social-' . $preset->name . 'comments-count'] = array(
'title' => $link_title,
'href' => fb_social_url('node/' . $node->nid),
'html' => TRUE,
);
}
return $links;
}