add linkedin

git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@25178 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2013-10-27 14:34:59 +00:00
parent ceb22bb2a7
commit 4baf275ea1
14 changed files with 118 additions and 18 deletions
+4
View File
@@ -42,6 +42,10 @@ if (isset($_POST['submit']))
'type' => $_POST['reddit']['type'],
'community' => $_POST['reddit']['community'],
),
'linkedin' => array(
'enabled' => isset($_POST['linkedin']['enabled']),
'counter' => $_POST['linkedin']['counter'],
),
);
conf_update_param('SocialButtons', serialize($conf['SocialButtons']));
+12
View File
@@ -41,6 +41,10 @@ function socialbutt_install()
'type' => 'interactive',
'community' => null,
),
'linkedin' => array(
'enabled' => true,
'counter' => 'right',
),
);
if (isset($conf['TumblrShare']))
@@ -87,6 +91,14 @@ function socialbutt_install()
);
}
if (empty($new_conf['linkedin']))
{
$new_conf['linkedin'] = array(
'enabled' => false,
'counter' => 'right',
);
}
if (!isset($new_conf['on_index']))
{
$new_conf['on_index'] = true;
+42
View File
@@ -0,0 +1,42 @@
<?php
defined('SOCIALBUTT_PATH') or die('Hacking attempt!');
function socialbutt_linkedin($basename, $root_url, &$tpl_vars, &$buttons)
{
global $conf, $template, $user;
$linkedin_langs = array(
'en_US','fr_FR','es_ES','ru_RU','de_DE','it_IT','pt_BR','ro_RO','tr_TR','ja_JP',
'in_ID','ms_MY','ko_KR','sv_SE','cs_CZ','nl_NL','pl_PL','no_NO','da_DK'
);
// if the link is in the toolbar, we must use smaller buttons
if ($conf['SocialButtons']['position'] == 'index' or $conf['SocialButtons']['position'] == 'toolbar')
{
if ($conf['SocialButtons']['linkedin']['counter'] == 'top')
{
$conf['SocialButtons']['linkedin']['counter'] = 'right';
}
}
// config
$tpl_vars['LINKEDIN'] = $conf['SocialButtons']['linkedin'];
// button language
if ( in_array($user['language'], $linkedin_langs) )
{
$tpl_vars['LINKEDIN']['lang'] = $user['language'];
}
else
{
$tpl_vars['LINKEDIN']['lang'] = 'en_US';
}
$template->set_filename('linkedin_button', realpath(SOCIALBUTT_PATH .'template/linkedin.tpl'));
$buttons[] = 'linkedin_button';
}
?>
+5
View File
@@ -171,6 +171,11 @@ function socialbutt_add_button()
include_once(SOCIALBUTT_PATH . 'include/reddit.inc.php');
socialbutt_reddit($basename, $root_url, $tpl_vars, $buttons);
}
if ($conf['SocialButtons']['linkedin']['enabled'])
{
include_once(SOCIALBUTT_PATH . 'include/linkedin.inc.php');
socialbutt_linkedin($basename, $root_url, $tpl_vars, $buttons);
}
unset_make_full_url();
+25
View File
@@ -377,6 +377,31 @@ jQuery(".showInfo").tipTip({
</table>
</div> {* <!-- pinterest --> *}
<div class="socialbutt {if not $linkedin.enabled}disabled{else}enabled{/if}"> {* <!-- linkedin --> *}
<table>
<thead>
<tr><td colspan="2">
<label title="{if $linkedin.enabled}{'Disable'|@translate}{else}{'Enable'|@translate}{/if}">
<img src="{$SOCIALBUTT_PATH}template/images/linkedin_logo.png"/>
<input class="enable" style="display:none;" type="checkbox" name="linkedin[enabled]" {if $linkedin.enabled}checked="checked"{/if}/>
</label>
</td></tr>
</thead>
<tbody>
<tr class="property not-light">
<td>
{'Annotation'|@translate}
</td>
<td>
<label><input type="radio" name="linkedin[counter]" value="none" {if $linkedin.counter=='none'}checked="checked"{/if}/> {'None'|@translate}</label><br>
<label><input type="radio" name="linkedin[counter]" value="right" {if $linkedin.counter=='right'}checked="checked"{/if}/> {'Right bubble'|@translate}</label><br>
<label><input type="radio" name="linkedin[counter]" value="top" {if $linkedin.counter=='top'}checked="checked"{/if}/> {'Top bubble'|@translate}</label>
</td>
</tr>
</tbody>
</table>
</div> {* <!-- linkedin --> *}
<br>
<div class="submit">
+4 -3
View File
@@ -1,12 +1,13 @@
{strip}
{if $SOCIALBUTT.light}
<a title="Share on Facebook" href="http://www.facebook.com/sharer.php?s=100&p[url]={$SOCIALBUTT.share_url|urlencode}&p[title]={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}
{if $SOCIALBUTT.basename=='picture'}
<a href="http://www.facebook.com/sharer.php?s=100&p[url]={$SOCIALBUTT.share_url|urlencode}&p[title]={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}&p[summary]={$COMMENT_IMG|cat:$SOCIALBUTT.copyright|urlencode}&p[images][0]={$SOCIALBUTT.source|urlencode}"
&p[summary]={$COMMENT_IMG|cat:$SOCIALBUTT.copyright|urlencode}&p[images][0]={$SOCIALBUTT.source|urlencode}"
{else}
<a href="http://www.facebook.com/sharer.php?s=100&p[url]={$SOCIALBUTT.share_url|urlencode}&p[title]={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}&p[summary]={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
&p[summary]={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
{/if}
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=500,width=500');return false;" target="_blank" rel="nofollow">
<img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/facebook_{$SOCIALBUTT.FACEBOOK.color}.png" alt="Share on Facebook"></a>
<img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/facebook_{$SOCIALBUTT.FACEBOOK.color}.png" alt="Facebook"></a>
{else}
{footer_script}jQuery('body').prepend('<div id="fb-root"></div>');{/footer_script}
{combine_script id='facebook_jssdk' load='footer' path='https://connect.facebook.net/'|cat:$SOCIALBUTT.FACEBOOK.lang|cat:'/all.js#xfbml=1'}
+3 -3
View File
@@ -1,8 +1,8 @@
{strip}
{if $SOCIALBUTT.light}
<a title="Google +" href="https://plus.google.com/share?url={$SOCIALBUTT.share_url|urlencode}&hl={$SOCIALBUTT.GOOGLE.lang}" rel="nofollow"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=390,width=480');return false;" target="_blank">
<img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/google_{$SOCIALBUTT.GOOGLE.size}.png" alt="Share on Google+"></a>
<a title="Share on Google +" href="https://plus.google.com/share?url={$SOCIALBUTT.share_url|urlencode}&hl={$SOCIALBUTT.GOOGLE.lang}"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=390,width=480');return false;" target="_blank" rel="nofollow">
<img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/google_{$SOCIALBUTT.GOOGLE.size}.png" alt="Google+"></a>
{else}
{combine_script id='google_plusone' load='footer' path='https://apis.google.com/js/plusone.js'}
<script type="text/javascript">window.___gcfg = {ldelim}lang: '{$SOCIALBUTT.GOOGLE.lang}'};</script>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

+11
View File
@@ -0,0 +1,11 @@
{strip}
{if $SOCIALBUTT.light}
<a title="Share on LinkedIn" href="https://www.linkedin.com/shareArticle?url={$SOCIALBUTT.share_url|urlencode}&title={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE}"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=390,width=480');return false;" target="_blank" rel="nofollow">
<img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/linkedin.png" alt="LinkedIn"></a>
{else}
{combine_script id='linkedin_share' load='footer' path='https://platform.linkedin.com/in.js'}
<script type="text/javascript">lang: {$SOCIALBUTT.LINKEDIN.lang}</script>
<script type="IN/Share" data-url="{$SOCIALBUTT.share_url}" data-counter="{$SOCIALBUTT.TWITTER.counter}" data-title="{$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE}"></script>
{/if}
{/strip}
+3 -3
View File
@@ -1,9 +1,9 @@
{strip}
<a href="http://pinterest.com/pin/create/button/?url={$SOCIALBUTT.share_url|urlencode}&media={$SOCIALBUTT.source|urlencode}&description={$PAGE_TITLE|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}" rel="nofollow"
<a title="Share on Pinterest" href="http://pinterest.com/pin/create/button/?url={$SOCIALBUTT.share_url|urlencode}&media={$SOCIALBUTT.source|urlencode}&description={$PAGE_TITLE|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}"
{if $SOCIALBUTT.light}
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank" rel="nofollow"
{else}
class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}"
class="pin-it-button" count-layout="{$SOCIALBUTT.PINTEREST.layout}" rel="nofollow"
{combine_script id='pinterest_pinit' load='footer' path='https://assets.pinterest.com/js/pinit.js'}
{/if}
><img border="0" src="http://assets.pinterest.com/images/PinExt.png" title="Pin It"/></a>
+2 -2
View File
@@ -8,7 +8,7 @@
</script>
<script type="text/javascript" src="http://{$SOCIALBUTT.REDDIT.lang}.reddit.com/static/button/button1.js"></script>
{else}
<a href="http://{$SOCIALBUTT.REDDIT.lang}.reddit.com/submit?url={$SOCIALBUTT.share_url|urlencode}&title={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}&target={$SOCIALBUTT.REDDIT.community|urlencode}" rel="nofollow" target="_blank">
<img src="http://www.reddit.com/static/{$SOCIALBUTT.REDDIT.type}.gif" alt="Submit to reddit"></a>
<a title="Share on reddit" href="http://{$SOCIALBUTT.REDDIT.lang}.reddit.com/submit?url={$SOCIALBUTT.share_url|urlencode}&title={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}&target={$SOCIALBUTT.REDDIT.community|urlencode}" rel="nofollow" target="_blank">
<img src="http://www.reddit.com/static/{$SOCIALBUTT.REDDIT.type}.gif" alt="reddit"></a>
{/if}
{/strip}
+3 -3
View File
@@ -1,14 +1,14 @@
{strip}
{if $SOCIALBUTT.basename=='picture'}
{capture assign="inline_tags"}{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first},{/if}{$tag.name}{/foreach}{/capture}
<a href="http://www.tumblr.com/share/photo?source={$SOCIALBUTT.source|urlencode}&caption={$PAGE_TITLE|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}"
<a title="Share on tumblr" href="http://www.tumblr.com/share/photo?source={$SOCIALBUTT.source|urlencode}&caption={$PAGE_TITLE|cat:' '|cat:$SOCIALBUTT.copyright|urlencode}&clickthru={$SOCIALBUTT.share_url|urlencode}&tags={$inline_tags|urlencode}"
{else}
<a href="http://www.tumblr.com/share/link?url={$SOCIALBUTT.share_url|urlencode}&name={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}&description={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
<a title="Share on tumblr" href="http://www.tumblr.com/share/link?url={$SOCIALBUTT.share_url|urlencode}&name={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}&description={$CONTENT_DESCRIPTION|cat:$SOCIALBUTT.copyright|urlencode}"
{/if}
{if $SOCIALBUTT.light}
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=430,width=500');return false;" target="_blank" rel="nofollow"
{else}
{combine_script id='tumblr_share' load='footer' path='http://platform.tumblr.com/v1/share.js'}
{/if}
><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Share on Tumblr"></a>
><img src="http://platform.tumblr.com/v1/{$SOCIALBUTT.TUMBLR.type}.png" alt="Tumblr"></a>
{/strip}
+4 -4
View File
@@ -1,11 +1,11 @@
{strip}
<a href="https://twitter.com/share?url={$SOCIALBUTT.share_url|urlencode}&text={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}{if $SOCIALBUTT.TWITTER.via}&via={$SOCIALBUTT.TWITTER.via}{/if}" rel="nofollow"
<a title="Share on Twitter" href="https://twitter.com/share?url={$SOCIALBUTT.share_url|urlencode}&text={$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|urlencode}{if $SOCIALBUTT.TWITTER.via}&via={$SOCIALBUTT.TWITTER.via}{/if}"
{if $SOCIALBUTT.light}
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank"
onclick="javascript:window.open(this.href, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=470,width=600');return false;" target="_blank" rel="nofollow"
{else}
data-url="{$SOCIALBUTT.share_url}" data-lang="{$SOCIALBUTT.TWITTER.lang}" data-via="{$SOCIALBUTT.TWITTER.via}"
data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button"
data-size="{$SOCIALBUTT.TWITTER.size}" data-count="{$SOCIALBUTT.TWITTER.count}" class="twitter-share-button" rel="nofollow"
{combine_script id='twitter_widgets' load='footer' path='https://platform.twitter.com/widgets.js'}
{/if}
><img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Share on Twitter"></a>
><img src="{$ROOT_PATH}{$SOCIALBUTT_PATH}template/images/twitter_{$SOCIALBUTT.TWITTER.size}.png" alt="Twitter"></a>
{/strip}