Beispiel #1
0
 public function getTagHtml()
 {
     if ($this->fields->exists('image') && $this->getParamValue('image') != "") {
         self::$needsJavascript = true;
         $url = $this->getParamValueEx('href', 'url', null, SCSocialUtilities::getStrippedUrl());
         $layout = $this->getParamValue('layout');
         $url = rawurlencode($url);
         $image = rawurlencode($this->getParamValue('image'));
         $desc = rawurlencode($this->getParamValue('desc'));
         $tagButtonText = '<a href="//pinterest.com/pin/create/button/?url=' . $url;
         if ($image) {
             $tagButtonText .= '&media=' . $image;
         }
         if ($desc) {
             $tagButtonText .= '&description=' . $desc;
         }
         $tagButtonText .= '"';
         if ($layout) {
             $tagButtonText .= SCEasyTags::getShareButtonLayout('pinterest', $layout, '"');
         } else {
             $tagButtonText .= $this->getField('data-pin-config', 'pin_count', null, 'none', 'data-pin-config');
         }
         if (strpos($tagButtonText, 'above') !== false) {
             $pinItButton = 'pinit_fg_en_rect_gray_28.png';
             $tagButtonText .= $this->getField('data-pin-height', '', null, '28', 'data-pin-height');
         } else {
             $pinItButton = 'pin_it_button.png';
         }
         $tagButtonText .= ' data-pin-do="buttonPin" ><img src="//assets.pinterest.com/images/pidgets/' . $pinItButton . '" alt="Share on Pinterest"/></a>';
     } else {
         $tagButtonText = '';
     }
     return $tagButtonText;
 }
Beispiel #2
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tag = '<script type="IN/Share"';
     $tag .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-url');
     $tag .= $this->getField('showzero', 'show_zero', 'boolean', 'false', 'data-showzero');
     if ($this->fields->exists('layout')) {
         $tag .= SCEasyTags::getShareButtonLayout('linkedin', $this->fields->get('layout'), '"');
     } else {
         $tag .= $this->getField('counter', null, null, '', 'data-counter');
     }
     $tag .= ' data-onsuccess="jfbc.social.linkedin.share"';
     $tag .= '></script>';
     return $tag;
 }
Beispiel #3
0
 protected function getTagHtml()
 {
     $username = $this->getParamValueEx('username', null, null, '');
     $tag = '<a href="https://twitter.com/' . $username . '" class="twitter-follow-button"';
     //NOTE: vertical count is not yet supported in twitter follow
     if ($this->fields->exists('layout')) {
         $tag .= SCEasyTags::getShareButtonLayout('twitter', $this->fields->get('layout'), '"');
     } else {
         $tag .= $this->getField('count', null, null, '', 'data-count');
     }
     $tag .= $this->getField('lang', null, null, '', 'data-lang');
     $tag .= $this->getField('width', null, null, '', 'data-width');
     $tag .= $this->getField('align', null, null, '', 'data-align');
     $tag .= $this->getField('show-screen-name', null, 'boolean', '', 'data-show-screen-name');
     $tag .= $this->getField('size', null, null, '', 'data-size');
     $tag .= $this->getField('dnt', null, 'boolean', 'false', 'data-dnt');
     $tag .= '>Follow @' . $username . '</a>';
     return $tag;
 }
Beispiel #4
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tag = '<div class="g-plusone"';
     if ($this->fields->exists('layout')) {
         $tag .= SCEasyTags::getShareButtonLayout('google', $this->fields->get('layout'), '"');
     } else {
         $tag .= $this->getField('size', null, null, '', 'data-size');
         $tag .= $this->getField('annotation', null, null, '', 'data-annotation');
     }
     $tag .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-href');
     $tag .= $this->getField('width', null, null, '', 'data-width');
     $tag .= $this->getField('align', null, null, '', 'data-align');
     $tag .= $this->getField('expandTo', null, null, '', 'expandTo');
     $tag .= $this->getField('recommendations', null, 'boolean', 'true', 'data-recommendations');
     $tag .= ' data-callback="plusone_callback"';
     $tag .= '></div>';
     return $tag;
 }
Beispiel #5
0
 protected function getTagHtml()
 {
     JFBCFactory::addStylesheet('jfbconnect.css');
     $tagButtonText = '<a href="http://twitter.com/share" class="twitter-share-button" ';
     $tagButtonText .= $this->getField('href', 'url', null, SCSocialUtilities::getStrippedUrl(), 'data-url');
     if ($this->fields->exists('layout')) {
         $tagButtonText .= SCEasyTags::getShareButtonLayout('twitter', $this->fields->get('layout'), '"');
     } else {
         $tagButtonText .= $this->getField('data-count', 'data_count', null, '', 'data-count');
     }
     $tagButtonText .= $this->getField('via', null, null, '', 'data-via');
     $tagButtonText .= $this->getField('text', null, null, '', 'data-text');
     $tagButtonText .= $this->getField('related', null, null, '', 'data-related');
     $tagButtonText .= $this->getField('lang', null, null, '', 'data-lang');
     $tagButtonText .= $this->getField('counturl', null, null, '', 'data-counturl');
     $tagButtonText .= $this->getField('hashtags', null, null, '', 'data-hashtags');
     $tagButtonText .= $this->getField('size', null, null, '', 'data-size');
     $tagButtonText .= $this->getField('dnt', null, 'boolean', 'false', 'data-dnt');
     $tagButtonText .= '>Tweet</a>';
     return $tagButtonText;
 }
Beispiel #6
0
 private function getGraphContents($regex, &$contents, &$newGraphTags)
 {
     if (preg_match_all($regex, $contents, $matches, PREG_SET_ORDER)) {
         $count = count($matches[0]);
         if ($count == 0) {
             return true;
         }
         $jfbcRenderKey = JFBCFactory::config()->get('social_tag_admin_key');
         foreach ($matches as $match) {
             if (isset($match[1])) {
                 $val = $match[1];
             } else {
                 $val = '';
             }
             $params = SCEasyTags::_splitIntoTagParameters($val);
             $cannotRenderJFBC = SCEasyTags::cannotRenderEasyTag($params, $jfbcRenderKey);
             if ($cannotRenderJFBC) {
                 continue;
             }
             $val = $this->removeRenderKey($val, $jfbcRenderKey);
             $newGraphTags[] = $val;
             $contents = str_replace($match[0], '', $contents);
         }
     }
 }
Beispiel #7
0
 public static function getShareButtonLayout($provider, $layout, $addQuotes = '')
 {
     $layoutParams = '';
     if ($layout == 'box_count') {
         if ($provider == 'facebook') {
             $layoutParams = SCEasyTags::quoteParam($addQuotes, 'layout', 'box_count');
         } else {
             if ($provider == 'google') {
                 $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-annotation', 'bubble');
                 $layoutParams .= SCEasyTags::quoteParam($addQuotes, 'data-size', 'tall');
             } else {
                 if ($provider == 'twitter') {
                     $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-count', 'vertical');
                 } else {
                     if ($provider == 'linkedin') {
                         $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-counter', 'top');
                     } else {
                         if ($provider == 'pinterest') {
                             $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-pin-config', 'above');
                         }
                     }
                 }
             }
         }
     } else {
         if ($layout == 'button_count') {
             if ($provider == 'facebook') {
                 $layoutParams = SCEasyTags::quoteParam($addQuotes, 'layout', 'button_count');
             } else {
                 if ($provider == 'google') {
                     $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-annotation', 'bubble');
                     $layoutParams .= SCEasyTags::quoteParam($addQuotes, 'data-size', 'medium');
                 } else {
                     if ($provider == 'twitter') {
                         $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-count', 'horizontal');
                     } else {
                         if ($provider == 'linkedin') {
                             $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-counter', 'right');
                         } else {
                             if ($provider == 'pinterest') {
                                 $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-pin-config', 'beside');
                             }
                         }
                     }
                 }
             }
         } else {
             if ($provider == 'facebook') {
                 if ($layout == 'standard') {
                     $layoutParams = SCEasyTags::quoteParam($addQuotes, 'layout', 'standard');
                     $layoutParams .= SCEasyTags::quoteParam($addQuotes, 'width', '50');
                     $layoutParams .= SCEasyTags::quoteParam($addQuotes, 'show_faces', 'false');
                 } else {
                     if ($layout == 'button') {
                         $layoutParams = SCEasyTags::quoteParam($addQuotes, 'layout', 'button');
                     }
                 }
             } else {
                 if ($provider == 'google') {
                     $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-annotation', 'none');
                     $layoutParams .= SCEasyTags::quoteParam($addQuotes, 'data-size', 'standard');
                 } else {
                     if ($provider == 'twitter') {
                         $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-count', 'none');
                     } else {
                         if ($provider == 'linkedin') {
                             $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-counter', 'no_count');
                         } else {
                             if ($provider == 'pinterest') {
                                 $layoutParams = SCEasyTags::quoteParam($addQuotes, 'data-pin-config', 'none');
                             }
                         }
                     }
                 }
             }
         }
     }
     return $layoutParams;
 }