diff --git a/admin.php b/admin.php index 9fb26e3..5df4990 100644 --- a/admin.php +++ b/admin.php @@ -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'], diff --git a/include/install.inc.php b/include/install.inc.php index ee737a0..6afebb0 100644 --- a/include/install.inc.php +++ b/include/install.inc.php @@ -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']); } } diff --git a/language/en_UK/plugin.lang.php b/language/en_UK/plugin.lang.php index 8824b51..45fdbcc 100644 --- a/language/en_UK/plugin.lang.php +++ b/language/en_UK/plugin.lang.php @@ -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'; ?> \ No newline at end of file diff --git a/language/fr_FR/plugin.lang.php b/language/fr_FR/plugin.lang.php index c353e3e..75514fd 100644 --- a/language/fr_FR/plugin.lang.php +++ b/language/fr_FR/plugin.lang.php @@ -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'; ?> \ No newline at end of file diff --git a/main.inc.php b/main.inc.php index 1aed52f..e4e2c75 100644 --- a/main.inc.php +++ b/main.inc.php @@ -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 '.$conf['gallery_title'].')', + 'copyright' => ' (from '.$conf['gallery_title'].')', ); $buttons = array(); @@ -170,14 +170,12 @@ function socialbutt_add_button() { case 'index': foreach ($buttons as $button) { - // $template->add_index_button('