Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author sourceaddons

    (@sourceaddons)

    Hi try
    do_shortcode(‘[facebookall_comments]’);
    Thanks

    Thread Starter Patryk

    (@patrykos360)

    Hi i try ‘<?php do_shortcode(‘[facebookall_comments]’);?>’

    but sil not work on my page : http://darkdesign.org/camilla-lackberg-kamieniarz

    at the bottom of the page on letters:
    Skomentuj na Facebooku

    some other idea?

    Plugin Author sourceaddons

    (@sourceaddons)

    Hi,
    please check again in your file
    or try to add
    <?php echo facebookall_get_fb_comments();?>
    Thanks

    Hi, thanx for the php shortcode but now i have double comment box, how to remove the first one???

    This is facebookall_share.php im assuming i have to change here something.

    * Adding comments.
     */
    
    function facebookall_get_fb_comments() {
      $fball_settings = get_option('fball_settings');
      if ($fball_settings['enablecomments'] == '1') {
    		  $comment_script = '<div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId='.$fball_settings['comment_appid'].'";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, "script", "facebook-jssdk"));</script>';
        $show_comments = '';
          if (!empty($fball_settings['comment_title'])) {
    	    $show_comments .= '<div style="margin:0"><b>'.ucfirst($fball_settings['comment_title']).'</b></div>';
    	  }
       if ($fball_settings['comment_color'] == '0') {$colorscheme = 'dark';}
       else {$colorscheme = 'light';}
       $show_comments .= $comment_script.'<div class="fb-comments" data-href="'. facebookall_get_current_url() .'" data-width="'.$fball_settings['comment_width'].'" data-num-posts="'.$fball_settings['comment_numpost'].'" data-colorscheme="'.$colorscheme.'"></div>';
       return $show_comments;
      }
      else {
        $show_comments ="";
        return $show_comments;
      }
    }
    
    /*
     * Showing comments.
     */
    function facebookall_add_fb_comments($content){
      $fball_settings = get_option('fball_settings');
      global $post;
      $html = facebookall_get_fb_comments();
      if((isset( $fball_settings['comment_homepage']) && is_front_page()) || ( isset( $fball_settings['comment_posts'] ) && is_single() ) || ( isset( $fball_settings['comment_pages'] ) && is_page() ) || ( isset( $fball_settings['comment_postecerpts'] ) && has_excerpt() ) || ( isset( $fball_settings['comment_archives'] ) && is_archive() ) || ( isset( $fball_settings['comment_feed'] ) && is_feed() ) ) {
        if(isset($fball_settings['comment_top'] ) && isset($fball_settings['comment_bottom'])) {
          $content = $html.'<br/>'.$content.'<br/>'.$html;
        }
        else {
          if(isset($fball_settings['comment_top'])){
            $content = $html.$content;
          }
          elseif (isset($fball_settings['comment_bottom'])){
            $content = $content.$html;
          }
        }
      }
      return $content;
    }
    add_filter('the_content', 'facebookall_add_fb_comments');
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php Dysplay FB Comments’ is closed to new replies.