AAAAsocialsharebuttons.php000066600000044364151372535160011220 0ustar00params->get("fbDynamicLocale", 0)) { $lang = JFactory::getLanguage(); $locale = $lang->getTag(); $this->fbLocale = str_replace("-","_",$locale); } else { $this->fbLocale = $this->params->get("fbLocale", "en_US"); } } /** * Add social buttons into the article * * Method is called by the view * * @param string The context of the content being passed to the plugin. * @param object The content object. Note $article->text is also available * @param object The content params * @param int The 'page' number * @since 1.6 */ public function onContentPrepare($context, &$article, &$params, $limitstart) { $app =& JFactory::getApplication(); /* @var $app JApplication */ if($app->isAdmin()) { return; } $doc = JFactory::getDocument(); /* @var $doc JDocumentHtml */ $docType = $doc->getType(); // Check document type if(strcmp("html", $docType) != 0){ return; } $currentOption = JRequest::getCmd("option"); if( ($currentOption != "com_content") OR !isset($this->params)) { return; } $custom = $this->params->get('custom'); if ($custom) { $ok = strstr ($article->text, '{socialsharebuttons}'); } else { $ok=0; } $this->currentView = JRequest::getCmd("view"); /** Check for selected views, which will display the buttons. **/ /** If there is a specific set and do not match, return an empty string.**/ $showInArticles = $this->params->get('showInArticles'); if(!$showInArticles AND (strcmp("article", $this->currentView) == 0)){ return ""; } // Check for category view $showInCategories = $this->params->get('showInCategories'); if(!$showInCategories AND (strcmp("category", $this->currentView) == 0)){ return; } if($showInCategories AND ($this->currentView == "category")) { $articleData = $this->getArticle($article); $article->id = $articleData['id']; $article->catid = $articleData['catid']; $article->title = $articleData['title']; $article->slug = $articleData['slug']; $article->catslug = $articleData['catslug']; } if(!isset($article) OR empty($article->id) ) { return; } $excludeArticles = $this->params->get('excludeArticles'); if(!empty($excludeArticles)){ $excludeArticles = explode(',', $excludeArticles); } settype($excludeArticles, 'array'); JArrayHelper::toInteger($excludeArticles); // Exluded categories $excludedCats = $this->params->get('excludeCats'); if(!empty($excludedCats)){ $excludedCats = explode(',', $excludedCats); } settype($excludedCats, 'array'); JArrayHelper::toInteger($excludedCats); // Included Articles $includedArticles = $this->params->get('includeArticles'); if(!empty($includedArticles)){ $includedArticles = explode(',', $includedArticles); } settype($includedArticles, 'array'); JArrayHelper::toInteger($includedArticles); if(!in_array($article->id, $includedArticles)) { // Check exluded places if(in_array($article->id, $excludeArticles) OR in_array($article->catid, $excludedCats)){ return ""; } } // Generate content $content = $this->getContent($article, $params); $position = $this->params->get('position'); switch($position){ case 0: $article->text = $content . $article->text . $content; break; case 1: $article->text = $content . $article->text; break; case 2: $article->text = $article->text . $content; break; default: break; } if ($ok) { $article->text = str_replace('{socialsharebuttons}', $content, $article->text); } return; } /** * Generate content * @param object The article object. Note $article->text is also available * @param object The article params * @return string Returns html code or empty string. */ private function getContent(&$article, &$params){ $doc = JFactory::getDocument(); /* @var $doc JDocumentHtml */ $doc->addStyleSheet(JURI::root() . "plugins/content/socialsharebuttons/style/style.css"); $url = JURI::getInstance(); $root= $url->getScheme() ."://" . $url->getHost(); $url = JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug), false); $url = $root.$url; $title= htmlentities($article->title, ENT_QUOTES, "UTF-8"); $html = '
'; $html .= $this->getFacebookLike($this->params, $url, $title); $html .= $this->getFacebookShareMe($this->params, $url, $title); $html .= $this->getTwitter($this->params, $url, $title); $html .= $this->getReTweetMeMe($this->params, $url, $title); $html .= $this->getGooglePlusOne($this->params, $url, $title); $html .= $this->getLinkedIn($this->params, $url, $title); $html .= $this->getBuzz($this->params, $url, $title); $html .= $this->getDigg($this->params, $url, $title); $html .= $this->getStumbpleUpon($this->params, $url, $title); $html .= '
'; $credits = $this->params->get('credits'); if ($credits) { $html .= '
Powered by Web Marketing
'; } else { $html .= ''; } $html .= ''; return $html; } private function getArticle(&$article) { $db = JFactory::getDbo(); $query = " SELECT `#__content`.`id`, `#__content`.`catid`, `#__content`.`alias`, `#__content`.`title`, `#__categories`.`alias` as category_alias FROM `#__content` INNER JOIN `#__categories` ON `#__content`.`catid`=`#__categories`.`id` WHERE `#__content`.`introtext` = " . $db->Quote($article->text); $db->setQuery($query); $result = $db->loadAssoc(); if ($db->getErrorNum() != 0) { JError::raiseError(500, "System error!", $db->getErrorMsg()); } if(!empty($result)) { $result['slug'] = $result['alias'] ? ($result['id'].':'.$result['alias']) : $result['id']; $result['catslug'] = $result['category_alias'] ? ($result['catid'].':'.$result['category_alias']) : $result['catid']; } return $result; } private function getTwitter($params, $url, $title){ $html = ""; if($params->get("twitterButton")) { $html = '
Tweet
'; } return $html; } private function getGooglePlusOne($params, $url, $title){ $type = ""; $language = ""; if($params->get("plusType")) { $type = 'size="' . $params->get("plusType") . '"'; } if($params->get("plusLocale")) { $language = " {lang: '" . $params->get("plusLocale") . "'}"; } $html = ""; if($params->get("plusButton")) { $html = '
'; } return $html; } private function getFacebookLike($params, $url, $title){ $html = ""; if($params->get("facebookLikeButton")) { $faces = (!$params->get("facebookLikeFaces")) ? "false" : "true"; $layout = $params->get("facebookLikeType","button_count"); if(strcmp("box_count", $layout)==0){ $height = "80"; } else { $height = "25"; } if(!$params->get("facebookLikeRenderer")){ // iframe $html = '
'; } else {//XFBML $html = '
'; if($params->get("facebookRootDiv",1)) { $html .= '
'; } if($params->get("facebookLoadJsLib", 1)) { $html .= ''; } $html .= ' get("facebookLikeSend")){ $html .= 'send="true" '; } else { $html .= 'send="false" '; } $html .= 'action="' . $params->get("facebookLikeAction",'like') . '" '; if($params->get("facebookLikeFont")){ $html .= 'font="' . $params->get("facebookLikeFont") . '"'; } $html .= '>
'; } } return $html; } private function getDigg($params, $url, $title){ $title = html_entity_decode($title,ENT_QUOTES, "UTF-8"); $html = ""; if($params->get("diggButton")) { $html = '
'; } return $html; } private function getStumbpleUpon($params, $url, $title){ $html = ""; if($params->get("stumbleButton")) { $html = '
'; } return $html; } private function getLinkedIn($params, $url, $title){ $html = ""; if($params->get("linkedInButton")) { $html = '
'; } return $html; } private function getBuzz($params, $url, $title){ $html = ""; if($params->get("buzzButton")) { $html = '
'; } return $html; } private function getReTweetMeMe($params, $url, $title){ $html = ""; if($params->get("retweetmeButton")) { $html = '
'; } return $html; } private function getFacebookShareMe($params, $url, $title){ $html = ""; if($params->get("facebookShareMeButton")) { $html = '
'; } return $html; } }.htaccess000066600000000177151372535160006363 0ustar00 Order allow,deny Deny from all socialsharebuttons.xml000066600000070343151372535160011225 0ustar00 Content - Social Share Buttons E-max Agosto 2011 Copyright (C) 2010 e-max.it. All rights reserved. http://www.gnu.org/copyleft/gpl.html GNU/GPL webmaster@e-max.it http://www.e-max.it 1.1 PLG_CONTENT_SOCIALSHAREBUTTONS_DESCRIPTION socialsharebuttons.php style index.html language/en-GB/en-GB.plg_content_socialsharebuttons.ini language/en-GB/en-GB.plg_content_socialsharebuttons.sys.ini language/it-IT/it-IT.plg_content_socialsharebuttons.ini language/it-IT/it-IT.plg_content_socialsharebuttons.sys.ini
style/style.css000066600000003502151372535160007572 0ustar00@CHARSET "UTF-8"; .social-share-buttons-share{ display:block !important; } .social-share-buttons-share-tw{ float:left; margin:5px; } .social-share-buttons-share-fbsh{ float:left; margin:5px; } .social-share-buttons-share-fbl{ float:left; margin:5px; } .social-share-buttons-share-digg{ float:left; margin:5px; } .social-share-buttons-share-su{ float:left; margin:5px; } .social-share-buttons-share-lin{ float:left; margin:5px; } .social-share-buttons-share-buzz{ float:left; margin:5px; } .social-share-buttons-share-gone{ float:left; margin:5px; } .social-share-buttons-share-retweetme{ float:left; margin:5px; } div.sharemebutton{ padding: 0px 0px 0px 0px; float: right; width: 56px; max-height: 195px; text-align: center;} td.sharemebutton{ padding-right: 0px; padding-top: 10px; padding-bottom:0px; margin-bottom:0px; margin-top: 0px; vertical-align:top; } td.space_right{padding: 0px 0px 0px 0px;} div.sharemebuttont{ padding: 0px 2px 0px 0px; float: right; } td.sharemebuttont{ padding-right: 0px; padding-top: 10px; padding-bottom:0px; margin-bottom:0px; margin-top: 0px; vertical-align:top; } td.space_right{ padding: 0px 0px 0px 0px;} div.sharemebuttonf{ padding: 2px 2px 0px 0px; float: right;} td.sharemebuttonf{ padding-right: 2px; padding-top: 10px; padding-bottom:0px; margin-bottom:0px; margin-top: 0px; vertical-align:top;} .fb_share_large .fb_sharecount_zero { -moz-border-radius: 2px 2px 2px 2px; background: url("http://static.fbshare.me/f_only.png") no-repeat scroll 20px 5px #3B5998; display: block; height: 47px; margin-bottom: 2px; width: 53px; } .social_share_buttons_credits { width: 100%; text-align: center; font-size: 90%; text-decoration: none; }style/.htaccess000066600000000177151372535160007523 0ustar00 Order allow,deny Deny from all style/index.html000066600000000035151372535160007713 0ustar00 index.html000066600000000035151372535160006553 0ustar00