mirror of
https://github.com/Piwigo/Piwigo-Social-Buttons.git
synced 2026-08-07 01:12:48 +02:00
use Piwigo 2.5 template methods, share complete link, option to disable on albums
git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@21232 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -10,6 +10,7 @@ if (isset($_POST['submit']))
|
||||
{
|
||||
$conf['SocialButtons'] = array(
|
||||
'position' => $_POST['position'],
|
||||
'on_index' => get_boolean($_POST['on_index']),
|
||||
'twitter' => array(
|
||||
'enabled' => isset($_POST['twitter']['enabled']),
|
||||
'size' => $_POST['twitter']['size'],
|
||||
|
||||
@@ -9,6 +9,7 @@ function socialbutt_install()
|
||||
{
|
||||
$default_config = array(
|
||||
'position' => 'toolbar',
|
||||
'on_index' => true,
|
||||
'twitter' => array(
|
||||
'enabled' => true,
|
||||
'size' => 'small',
|
||||
@@ -63,6 +64,7 @@ function socialbutt_install()
|
||||
else
|
||||
{
|
||||
$new_conf = unserialize($conf['SocialButtons']);
|
||||
|
||||
if (empty($new_conf['pinterest']))
|
||||
{
|
||||
$new_conf['pinterest'] = array(
|
||||
@@ -70,9 +72,14 @@ function socialbutt_install()
|
||||
'layout' => 'horizontal',
|
||||
'img_size' => 'Original',
|
||||
);
|
||||
$conf['SocialButtons'] = serialize($new_conf);
|
||||
conf_update_param('SocialButtons', $conf['SocialButtons']);
|
||||
}
|
||||
if (!isset($new_conf['on_index']))
|
||||
{
|
||||
$new_conf['on_index'] = true;
|
||||
}
|
||||
|
||||
$conf['SocialButtons'] = serialize($new_conf);
|
||||
conf_update_param('SocialButtons', $conf['SocialButtons']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,4 +9,7 @@ $lang['Inline text'] = 'Inline text';
|
||||
$lang['Button type'] = 'Button type';
|
||||
$lang['Right bubble'] = 'Right bubble';
|
||||
$lang['Top bubble'] = 'Top bubble';
|
||||
$lang['Display buttons'] = 'Display buttons';
|
||||
$lang['on photo and album pages'] = 'on photo and album pages';
|
||||
$lang['only on photo pages'] = 'only on photo pages';
|
||||
?>
|
||||
@@ -11,4 +11,7 @@ $lang['Shared picture size'] = 'Taille des photos partagées';
|
||||
$lang['Via'] = 'Via';
|
||||
$lang['Right bubble'] = 'Bulle à droite';
|
||||
$lang['Top bubble'] = 'Bulle en haut';
|
||||
$lang['Display buttons'] = 'Afficher les boutons';
|
||||
$lang['on photo and album'] = 'sur les photos et les albums';
|
||||
$lang['only on photo'] = 'uniquement sur les photos';
|
||||
?>
|
||||
+6
-8
@@ -102,7 +102,7 @@ function socialbutt_add_button()
|
||||
{
|
||||
$share_url = $root_url.ltrim(duplicate_picture_url(), './');
|
||||
}
|
||||
else if ($basename == 'index')
|
||||
else if ($basename == 'index' and $conf['SocialButtons']['on_index'])
|
||||
{
|
||||
$conf['SocialButtons']['position'] = 'index';
|
||||
$share_url = $root_url.ltrim(duplicate_index_url(array(), array('start')), './');
|
||||
@@ -117,7 +117,7 @@ function socialbutt_add_button()
|
||||
$tpl_vars = array(
|
||||
'share_url' => $share_url,
|
||||
'position' => $conf['SocialButtons']['position'],
|
||||
'copyright' => ' (from <a href="'.$root_url.'">'.$conf['gallery_title'].'</a>)',
|
||||
'copyright' => ' (from <a href="'.$share_url.'">'.$conf['gallery_title'].'</a>)',
|
||||
);
|
||||
$buttons = array();
|
||||
|
||||
@@ -170,14 +170,12 @@ function socialbutt_add_button()
|
||||
{
|
||||
case 'index':
|
||||
foreach ($buttons as $button) {
|
||||
// $template->add_index_button('<li>'.$button.'</li>', 100);
|
||||
$template->concat('PLUGIN_INDEX_ACTIONS', "\n<li>".$button."</li>");
|
||||
$template->add_index_button('<li>'.$button.'</li>', 100);
|
||||
}
|
||||
break;
|
||||
case 'toolbar':
|
||||
foreach ($buttons as $button) {
|
||||
// $template->add_picture_button($button, 100);
|
||||
$template->concat('PLUGIN_PICTURE_ACTIONS', "\n".$button);
|
||||
$template->add_picture_button($button, 100);
|
||||
}
|
||||
break;
|
||||
default;
|
||||
@@ -192,12 +190,12 @@ function socialbutt_add_button_prefilter($content)
|
||||
{
|
||||
case 'top':
|
||||
$search = '<div id="theImage">';
|
||||
$add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON}{/foreach}</div>';
|
||||
$add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';
|
||||
break;
|
||||
|
||||
case 'bottom':
|
||||
$search = '{$ELEMENT_CONTENT}';
|
||||
$add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON}{/foreach}</div>';
|
||||
$add = '<div>{foreach from=$SOCIALBUTT_BUTTONS item=BUTTON}{$BUTTON} {/foreach}</div>';
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,15 @@ jQuery("input.enable").change(function() {
|
||||
<label><input type="radio" name="position" value="toolbar" {if $position=='toolbar'}checked="checked"{/if}/> {'Toolbar'|@translate}</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="property">
|
||||
<td>
|
||||
{'Display buttons'|@translate}
|
||||
</td>
|
||||
<td>
|
||||
<label><input type="radio" name="on_index" value="true" {if $on_index}checked="checked"{/if}/> {'on photo and album'|@translate}</label><br>
|
||||
<label><input type="radio" name="on_index" value="false" {if not $on_index}checked="checked"{/if}/> {'only on photo'|@translate}</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
{if $SOCIALBUTT.FACEBOOK.layout=='none'}
|
||||
{html_style}{literal}
|
||||
.fb-like span { height: 22px !important; overflow: hidden !important; margin-right:10px; }
|
||||
.fb-like span { height: 22px !important; overflow: hidden !important; }
|
||||
.fb-like iframe { top: -41px; }
|
||||
{/literal}{/html_style}
|
||||
{assign var=facebook_layout value='box_count'}
|
||||
|
||||
Reference in New Issue
Block a user