コード例 #1
0
ファイル: jfbccontent.php プロジェクト: q0821/esportshop
 private function getLikeBtn($article, $infix = 'article')
 {
     $buttonStyle = $this->configModel->getSetting('social_' . $infix . '_like_layout_style');
     $showFaces = $this->configModel->getSetting('social_' . $infix . '_like_show_faces');
     $showShareButton = $this->configModel->getSetting('social_' . $infix . '_like_show_send_button');
     $width = $this->configModel->getSetting('social_' . $infix . '_like_width');
     $verbToDisplay = $this->configModel->getSetting('social_' . $infix . '_like_verb_to_display');
     $font = $this->configModel->getSetting('social_' . $infix . '_like_font');
     $colorScheme = $this->configModel->getSetting('social_a' . $infix . '_like_color_scheme');
     $showFacebook = $this->configModel->getSetting('social_' . $infix . '_like_show_facebook');
     $showLinkedIn = $this->configModel->getSetting('social_' . $infix . '_like_show_linkedin');
     $showTwitter = $this->configModel->getSetting('social_' . $infix . '_like_show_twitter');
     $showGooglePlus = $this->configModel->getSetting('social_' . $infix . '_like_show_googleplus');
     $showPinterest = $this->configModel->getSetting('social_' . $infix . '_like_show_pinterest');
     //only call opengraph plugin if we show pinterest to remove unnecessary overhead
     $pinImage = $pinText = '';
     if ($showPinterest) {
         $pinImage = $this->getPinterestImage($article);
         $pinText = $this->getPinterestText($article);
     }
     $url = SCArticleContent::getCurrentURL($article, $this->isJoomla);
     $btnHTML = $likeHTML = $likeExtraHTML = $widthField = '';
     //Only set width for standard layout, not box_count or button_count
     if ($buttonStyle == 'standard') {
         $widthField .= ' width=' . $width;
     }
     //show like or with share button
     if ($showFacebook) {
         $likeHTML .= '{JFBCLike layout=' . $buttonStyle . ' show_faces=' . $showFaces . ' share=' . $showShareButton . $widthField . ' action=' . $verbToDisplay . ' font=' . $font . ' colorscheme=' . $colorScheme . ' href=' . $url . $this->renderKeyString . '}';
     } else {
         if ($showShareButton && !$showFacebook) {
             if ($buttonStyle == 'standard' || $buttonStyle == 'button') {
                 $style = 'button';
             } else {
                 if ($buttonStyle == 'box_count') {
                     $style = 'box_count';
                 } else {
                     $style = 'button_count';
                 }
             }
             $likeHTML .= '{JFBCShare layout=' . $style . $widthField . ' href=' . $url . $this->renderKeyString . '}';
         }
     }
     if ($showLinkedIn || $showTwitter || $showGooglePlus || $showPinterest) {
         $likeExtraHTML = SCSocialUtilities::getExtraShareButtons($url, $buttonStyle, false, false, $showTwitter, $showGooglePlus, $this->renderKeyString, $showLinkedIn, '50', $showPinterest, $pinImage, $pinText);
     }
     if (!empty($likeHTML) || !empty($likeExtraHTML)) {
         $btnHTML .= '<div style="position: relative; top:0px; left:0px; z-index: 99;" class="scsocialbuttons ' . $buttonStyle . '">';
         $btnHTML .= $likeExtraHTML;
         $btnHTML .= $likeHTML;
         $btnHTML .= '</div><div style="clear:both"></div>';
     }
     $html = '';
     $intro_text = $this->configModel->getSetting('social_' . $infix . '_like_intro_text');
     if (!empty($intro_text)) {
         $html .= '<div class="scsocialbuttons-intro-text">' . $intro_text . '</div>';
     }
     $html .= $btnHTML;
     return $html;
 }