Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added pinterest and bufferapp buttons.

  • Loading branch information...
commit 143fed840ae5fc4023d309a082b370347dab782a 1 parent 6dd7c73
Todor Iliev authored
7 README.md
View
@@ -1,6 +1,6 @@
ITPShare Module for Joomla!
==========================
-( Version 1.8 )
+( Version 1.9 )
--------------------------
@@ -8,6 +8,11 @@ ITPShare Module for Joomla!
Changelog
---------
+v1.9
+-----
+* Added Pinterest button
+* Added BufferApp button
+
v1.8
-----
* Improved Twitter buttons
1  en-GB.mod_itpshare.ini
View
@@ -1,4 +1,3 @@
-
MOD_ITPSHARE="ITPShare"
MOD_ITPSHARE_LOAD_JS_LIB="Load Facebook JS library"
MOD_ITPSHARE_LOAD_JS_LIB_DESC="Pass loading the Facebook JavaScript library 'All.js'. It works only with XFBML. Thus avoiding repeated loading library, if you are using other Facebook widgets. Accelerating the speed of the site and avoid conflicts between the Facebook widgets."
3  en-GB.mod_itpshare.sys.ini
View
@@ -1,2 +1 @@
-
-MOD_ITPSHARE="ITPShare"
+MOD_ITPSHARE="ITPShare"
60 helper.php
View
@@ -537,4 +537,64 @@ public static function getTumblr($params, $url, $title){
return $html;
}
+ public static function getPinterest($params, $url, $title){
+
+ $title = html_entity_decode($title,ENT_QUOTES, "UTF-8");
+
+ $html = "";
+ if($params->get("pinterestButton")) {
+
+ $html .= '<div class="itp-share-pinterest">';
+
+ // Load the JS library
+ if($params->get("loadPinterestJsLib")) {
+ $html .= '<!-- Include ONCE for ALL buttons in the page -->
+<script type="text/javascript">
+(function() {
+ window.PinIt = window.PinIt || { loaded:false };
+ if (window.PinIt.loaded) return;
+ window.PinIt.loaded = true;
+ function async_load(){
+ var s = document.createElement("script");
+ s.type = "text/javascript";
+ s.async = true;
+ if (window.location.protocol == "https:")
+ s.src = "https://assets.pinterest.com/js/pinit.js";
+ else
+ s.src = "http://assets.pinterest.com/js/pinit.js";
+ var x = document.getElementsByTagName("script")[0];
+ x.parentNode.insertBefore(s, x);
+ }
+ if (window.attachEvent)
+ window.attachEvent("onload", async_load);
+ else
+ window.addEventListener("load", async_load, false);
+})();
+</script>
+';
+ }
+
+$html .= '<!-- Customize and include for EACH button in the page -->
+<a href="http://pinterest.com/pin/create/button/?url=' . rawurlencode($url) . '&amp;description=' . rawurlencode($title) . '" class="pin-it-button" count-layout="'.$params->get("pinterestType").'">Pin It</a>';
+ $html .= '</div>';
+ }
+
+ return $html;
+ }
+
+ public static function getBuffer($params, $url, $title){
+
+ $html = "";
+ if($params->get("bufferButton")) {
+
+ $html = '
+ <div class="itp-share-buffer">
+ <a href="http://bufferapp.com/add" class="buffer-add-button" data-text="' . $title . '" data-url="'.$url.'" data-count="'.$params->get("bufferType").'" data-via="'.$params->get("bufferTwitterName").'">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script>
+ </div>
+ ';
+ }
+
+ return $html;
+ }
+
}
16 mod_itpshare.php
View
@@ -1,11 +1,11 @@
<?php
/**
* @package ITPrism Modules
- * @subpackage ITPSocialButtons
+ * @subpackage ITPShare
* @author Todor Iliev
- * @copyright Copyright (C) 2010 Todor Iliev <todor.iliev@itprism.co.uk>. All rights reserved.
+ * @copyright Copyright (C) 2010 Todor Iliev <todor@itprism.com>. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
- * ITPSocialButtons is free software. This version may have been modified pursuant
+ * ITPShare is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
@@ -17,16 +17,20 @@
// Include the syndicate functions only once
require_once dirname(__FILE__).'/helper.php';
-$doc = JFactory::getDocument();
+$moduleClassSfx = htmlspecialchars($params->get('moduleclass_sfx'));
+// Loading style.css
if($params->get("loadCss")) {
+ $doc = JFactory::getDocument();
$doc->addStyleSheet("modules/mod_itpshare/style.css");
}
+// URL
$url = JURI::getInstance();
$url = $url->toString();
$title = $doc->getTitle();
+// Title
$title = htmlentities($title, ENT_QUOTES, "UTF-8");
-
-require(JModuleHelper::getLayoutPath('mod_itpshare'));
+dump($title, "title");
+require JModuleHelper::getLayoutPath('mod_itpshare', $params->get('layout', 'default'));
64 mod_itpshare.xml
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<extension type="module" version="1.7" client="site" method="upgrade">
+<extension type="module" version="2.5" client="site" method="upgrade">
<name>ITPShare</name>
<author>Todor Iliev</author>
<creationDate>January, 2010</creationDate>
@@ -7,12 +7,12 @@
<license>http://www.gnu.org/copyleft/gpl.html</license>
<authorEmail>todor@itprism.com</authorEmail>
<authorUrl>http://itprism.com</authorUrl>
- <version>1.8</version>
+ <version>1.9</version>
<description><![CDATA[
- <p>It is <a href="http://itprism.com/free-joomla-extensions/socialmedia-share-plugin">ITPShare module</a> for Joomla!. This module shows socal media widgets buttons on your site.</p>
+ <p><a href="http://itprism.com/free-joomla-extensions/socialmedia-share-plugin">ITPShare</a> is an extension that adds republish buttons, widgets or goodies on your site. There are social plugins of Twitter, Facebook, Digg, LinkedIn, Stumbleupon, Google Plus, Thumblr, Pinterest, BufferApp,... It will help you to find more readers for your publications.</p>
<p>Invest in the extension improvement. You can <a href="http://itprism.com/sponsorship" title="Sponsoring" target="_blank">sponsor the extension via SMS or PayPal</a>.<p>
- <p>Please, <a href="http://extensions.joomla.org/extensions/social-web/republish/15665" target="_blank">vote for this module</a> on Joomla! Extensions Directory!</p>]]></description>
-
+ <p><a href="http://itprism.com/" target="_blank">Subscribe for the newsletter</a> to receive information about updates and new ITPrism extensions.</p>
+ <p>Please, <a href="http://extensions.joomla.org/extensions/social-web/republish/15665" target="_blank">vote for the extension</a> on Joomla! Extensions Directory</p>]]></description>
<languages>
<language tag="en-GB">en-GB.mod_itpshare.ini</language>
<language tag="en-GB">en-GB.mod_itpshare.sys.ini</language>
@@ -393,6 +393,32 @@
<option value="uk">Ukrainian</option>
<option value="vi">Vietnamese</option>
</field>
+
+ <field name="spacer10" type="spacer" class="text" label="############# PINTEREST SETTINGS #############" />
+ <field name="pinterestButton" type="radio" default="0" label="Pinterest Button" description="Show or hide Pinterest button." >
+ <option value="0">Hide</option>
+ <option value="1">Show</option>
+ </field>
+ <field name="pinterestType" type="list" default="horizontal" label="Pinterest Type" description="The type of the button." >
+ <option value="horizontal">Horizontal</option>
+ <option value="vertical">Vertical</option>
+ <option value="none">None</option>
+ </field>
+
+ <field name="spacer11" type="spacer" class="text" label="############# BUFFER SETTINGS #############" />
+ <field name="bufferButton" type="radio" default="0" label="Buffer Button" description="Show or hide BufferApp.com buttons." >
+ <option value="0">Hide</option>
+ <option value="1">Show</option>
+ </field>
+ <field name="bufferType" type="list" default="horizontal" label="Buffer Type" description="The type of the button." >
+ <option value="horizontal">Horizontal</option>
+ <option value="vertical">Vertical</option>
+ <option value="none">None</option>
+ </field>
+ <field name="bufferTwitterName" type="text" default="" size="80"
+ label="Twitter Username"
+ description="Enter the name of your twitter account you want to be mentioned." />
+
</fieldset>
<fieldset name="advanced">
@@ -410,7 +436,7 @@
<field name="cache_time" type="text" default="900"
label="COM_MODULES_FIELD_CACHE_TIME_LABEL" description="COM_MODULES_FIELD_CACHE_TIME_DESC" />
- <field name="spacer10" type="spacer" class="text" label="############# FACEBOOK LIKE ADVANCED SETTINGS #############" />
+ <field name="spacer11" type="spacer" class="text" label="############# FACEBOOK LIKE ADVANCED SETTINGS #############" />
<field name="facebookLikeAppId" type="text" default="" label="Facebook App ID" description="Enter the ID of the your domain name. For more information read the documentation." />
<field name="facebookLikeSend" type="list" default="0" label="Facebook Send Buttons" description="Specifies whether to include a 'Send button' with the Like button. This only works with the XFBML version." >
<option value="0">No</option>
@@ -425,36 +451,42 @@
<option value="1">JYES</option>
</field>
- <field name="spacer11" type="spacer" class="text" label="############# TUMBLR ADVANCED SETTINGS #############" />
+ <field name="spacer12" type="spacer" class="text" label="############# TUMBLR ADVANCED SETTINGS #############" />
<field name="loadTumblrJsLib" type="radio" default="1" label="Load Tumblr JS library" description="Pass loading the Tumblr JavaScript library 'share.js'. Thus avoiding repeated loading library, if you are using other Tumblr widgets. Accelerating the speed of the site and avoid conflicts between the Tumblr widgets.">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
- <field name="spacer12" type="spacer" class="text" label="############# DIGG ADVANCED SETTINGS #############" />
+ <field name="spacer13" type="spacer" class="text" label="############# DIGG ADVANCED SETTINGS #############" />
<field name="loadDiggJsLib" type="radio" default="1" label="Load Digg JS library" description="Pass loading the Digg JavaScript library 'buttons.js'. Thus avoiding repeated loading library, if you are using other Digg widgets. Accelerating the speed of the site and avoid conflicts between the Digg widgets.">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
- <field name="spacer13" type="spacer" class="text" label="############# GOOGLE PLUS ADVANCED SETTINGS #############" />
+ <field name="spacer14" type="spacer" class="text" label="############# GOOGLE PLUS ADVANCED SETTINGS #############" />
<field name="loadGooglePlusJsLib" type="radio" default="1" label="Load Google JS library" description="Pass loading the Google Plus JavaScript library 'buttons.js'. Thus avoiding repeated loading library, if you are using other Google Plus widgets. Accelerating the speed of the site and avoid conflicts between the Google Plus widgets.">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
- <field name="spacer14" type="spacer" class="text" label="############# ITPShare SETTINGS #############" />
+ <field name="spacer15" type="spacer" class="text" label="############# PINTEREST ADVANCED SETTINGS #############" />
+ <field name="loadPinterestJsLib" type="radio" default="1" label="Load Pinterest JS library" description="Pass loading the Pinterest JavaScript library. Thus avoiding repeated loading library, if you are using other Google Plus widgets. Accelerating the speed of the site and avoid conflicts between the Pinterest widgets.">
+ <option value="0">JNO</option>
+ <option value="1">JYES</option>
+ </field>
+
+ <field name="spacer16" type="spacer" class="text" label="############# ITPShare SETTINGS #############" />
<field name="loadCss" type="radio" default="1" label="Load style.css" description="The style.css is a file that conations button position and some styles of the ReTweetMe button. You can disable the file loading if you have your own styles.">
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
- <field name="spacer15" type="spacer" class="text" label="############# EXTRA BUTTONS #############" />
- <field name="ebuttons1" type="textarea" default="" label="A Button code 1" description="Insert an extra button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
- <field name="ebuttons2" type="textarea" default="" label="A Button code 2" description="Insert an extra button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
- <field name="ebuttons3" type="textarea" default="" label="A Button code 3" description="Insert an extra button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
- <field name="ebuttons4" type="textarea" default="" label="A Button code 4" description="Insert an extra button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
- <field name="ebuttons5" type="textarea" default="" label="A Button code 5" description="Insert an extra button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
+ <field name="spacer17" type="spacer" class="text" label="############# ADDITIONAL BUTTONS #############" />
+ <field name="ebuttons1" type="textarea" default="" label="A Button code 1" description="Insert an additional button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
+ <field name="ebuttons2" type="textarea" default="" label="A Button code 2" description="Insert an additional button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
+ <field name="ebuttons3" type="textarea" default="" label="A Button code 3" description="Insert an additional button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
+ <field name="ebuttons4" type="textarea" default="" label="A Button code 4" description="Insert an additional button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
+ <field name="ebuttons5" type="textarea" default="" label="A Button code 5" description="Insert an additional button ccode that will be included. If you need to specify a URL or title, use {URL} and {TITLE} for that." cols="50" rows="10" filter="raw" />
</fieldset>
</fields>
</config>
10 style.css
View
@@ -52,4 +52,14 @@
.itp-share-reddit a:hover{
text-decoration: none !important;
background: none !important;
+}
+
+.itp-share-pinterest {
+ float:left;
+ margin-top:10px;
+}
+
+.itp-share-buffer {
+ float:left;
+ margin-top:10px;
}
21 tmpl/default.php
View
@@ -1,14 +1,27 @@
-<?php // no direct access
+<?php
+/**
+ * @package ITPrism Modules
+ * @subpackage ITPShare
+ * @author Todor Iliev
+ * @copyright Copyright (C) 2010 Todor Iliev <todor@itprism.com>. All rights reserved.
+ * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
+ * ITPShare is free software. This version may have been modified pursuant
+ * to the GNU General Public License, and as distributed it includes or
+ * is derivative of works licensed under the GNU General Public License or
+ * other free or open source software licenses.
+ */
defined('_JEXEC') or die;?>
-<div class="itp-share-mod<?php echo $params->get('moduleclass_sfx');?>">
+<div class="itp-share-mod<?php echo $moduleClassSfx;?>">
<?php
echo ItpShareHelper::getTwitter($params, $url, $title);
echo ItpShareHelper::getDigg($params, $url, $title);
echo ItpShareHelper::getStumbpleUpon($params, $url, $title);
echo ItpShareHelper::getLinkedIn($params, $url, $title);
- echo ItpShareHelper::getReTweetMeMe($params, $url, $title);
- echo ItpShareHelper::getReddit($params, $url, $title);
echo ItpShareHelper::getTumblr($params, $url, $title);
+ echo ItpShareHelper::getBuffer($params, $url, $title);
+ echo ItpShareHelper::getReddit($params, $url, $title);
+ echo ItpShareHelper::getPinterest($params, $url, $title);
+ echo ItpShareHelper::getReTweetMeMe($params, $url, $title);
echo ItpShareHelper::getFacebookLike($params, $url, $title);
echo ItpShareHelper::getGooglePlusOne($params, $url, $title);
echo ItpShareHelper::getExtraButtons($params, $url, $title);
Please sign in to comment.
Something went wrong with that request. Please try again.