fbcommentbox

The Facebook Comments fbcommentbox function.

Description

fbcommentbox( $content ); 

Parameters (1)

0. $content
The content.

Usage

  1. if ( !function_exists( 'fbcommentbox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'facebook-comments/class-frontend.php'; 
  3.  
  4. // The content. 
  5. $content = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = fbcommentbox($content); 
  9.  

Defined (1)

The function is defined in the following location(s).

/class-frontend.php  
  1. function fbcommentbox($content) { 
  2. $options = get_option('fbcomments'); 
  3. if (!isset($options['html5'])) {$options['html5'] = "off";} 
  4. if (!isset($options['linklove'])) {$options['linklove'] = "off";} 
  5. if (!isset($options['posts'])) {$options['posts'] = "off";} 
  6. if (!isset($options['pages'])) {$options['pages'] = "off";} 
  7. if (!isset($options['homepage'])) {$options['homepage'] = "off";} 
  8. if (!isset($options['count'])) {$options['count'] = "off";} 
  9. if (!isset($options['commentcount'])) {$options['commentcount'] = "";} 
  10. if ( 
  11. (is_single() && $options['posts'] == 'on') || 
  12. (is_page() && $options['pages'] == 'on') || 
  13. ((is_home() || is_front_page()) && $options['homepage'] == 'on')) { 
  14.  
  15. $custom_fields = get_post_custom(); 
  16. if (!empty($custom_fields)) { 
  17. foreach ($custom_fields as $field_key => $field_values) { 
  18. foreach ($field_values as $key => $value) 
  19. $post_meta[$field_key] = $value; // builds array 
  20. if (!isset($post_meta['_disable_fbc'])) {$post_meta['_disable_fbc'] = "off";} 
  21.  
  22. if ($post_meta['_disable_fbc'] !='on') { 
  23. if ($options['count'] == 'on') { 
  24. if ($options['countstyle'] == '') { 
  25. $commentcount = "<p>"; 
  26. } else { 
  27. $commentcount = "<p class=\"".$options['countstyle']."\">"; 
  28. $commentcount .= "<fb:comments-count href=".get_permalink()."></fb:comments-count> ".$options['countmsg']."</p>"; 
  29. if ($options['title'] != '') { 
  30. if ($options['titleclass'] == '') { 
  31. $commenttitle = "<h3>"; 
  32. } else { 
  33. $commenttitle = "<h3 class=\"".$options['titleclass']."\">"; 
  34. $commenttitle .= $options['title']."</h3>"; 
  35. if (!isset($commentcount)) {$commentcount = "";} 
  36. $content .= "<!-- Facebook Comments Plugin for WordPress: http://peadig.com/wordpress-plugins/facebook-comments/ -->".$commenttitle.$commentcount; 
  37.  
  38. if ($options['html5'] == 'on') { 
  39. $content .= "<div class=\"fb-comments\" data-href=\"".get_permalink()."\" data-num-posts=\"".$options['num']."\" data-width=\"".$options['width']."\" data-colorscheme=\"".$options['scheme']."\"></div>"; 
  40.  
  41. } else { 
  42. $content .= "<fb:comments href=\"".get_permalink()."\" num_posts=\"".$options['num']."\" width=\"".$options['width']."\" colorscheme=\"".$options['scheme']."\"></fb:comments>"; 
  43. if ($options['linklove'] != 'no') { 
  44. if ($options['linklove'] != 'off') { 
  45. if (empty($fbcomments[linklove])) { 
  46. $content .= '<p>Powered by <a href="http://peadig.com/wordpress-plugins/facebook-comments/">Facebook Comments</a></p>'; 
  47. return $content;