diff --git a/admin.php b/admin.php index 6c2bd93..c174f2b 100644 --- a/admin.php +++ b/admin.php @@ -38,6 +38,11 @@ if (isset($_POST['submit'])) 'layout' => $_POST['pinterest']['layout'], 'img_size' => $_POST['pinterest']['img_size'], ), + 'reddit' => array( + 'enabled' => isset($_POST['reddit']['enabled']), + 'type' => $_POST['reddit']['type'], + 'community' => $_POST['reddit']['community'], + ), ); conf_update_param('SocialButtons', serialize($conf['SocialButtons'])); diff --git a/include/install.inc.php b/include/install.inc.php index 55196ca..1b42e30 100644 --- a/include/install.inc.php +++ b/include/install.inc.php @@ -37,6 +37,11 @@ function socialbutt_install() 'layout' => 'horizontal', 'img_size' => 'Original', ), + 'reddit' => array( + 'enabled' => true, + 'type' => 'interactive', + 'community' => null, + ), ); if (isset($conf['TumblrShare'])) @@ -75,6 +80,15 @@ function socialbutt_install() ); } + if (empty($new_conf['reddit'])) + { + $new_conf['reddit'] = array( + 'enabled' => false, + 'type' => 'interactive', + 'community' => null, + ); + } + if (!isset($new_conf['on_index'])) { $new_conf['on_index'] = true; diff --git a/include/reddit.inc.php b/include/reddit.inc.php new file mode 100644 index 0000000..e852808 --- /dev/null +++ b/include/reddit.inc.php @@ -0,0 +1,44 @@ +set_filename('reddit_button', realpath(SOCIALBUTT_PATH .'template/reddit.tpl')); + $buttons[] = 'reddit_button'; +} + +?> \ No newline at end of file diff --git a/language/en_UK/plugin.lang.php b/language/en_UK/plugin.lang.php index 3c19e7b..cb6260b 100644 --- a/language/en_UK/plugin.lang.php +++ b/language/en_UK/plugin.lang.php @@ -12,6 +12,7 @@ $lang['Top bubble'] = 'Top bubble'; $lang['Display buttons'] = 'Display buttons'; $lang['on photo and album'] = 'on photo and album'; $lang['only on photo'] = 'only on photo'; +$lang['Community'] = 'Community'; $lang['Light mode'] = 'Light mode'; $lang['When light mode is activated no external script is loaded, it speeds up the load of the page and disables user tracking but also disables annotations and in-page popups.'] = 'When light mode is activated no external script is loaded, it speeds up the load of the page and disables user tracking but also disables annotations and in-page popups.'; ?> \ No newline at end of file diff --git a/language/fr_FR/plugin.lang.php b/language/fr_FR/plugin.lang.php index dc911fb..851c5c9 100644 --- a/language/fr_FR/plugin.lang.php +++ b/language/fr_FR/plugin.lang.php @@ -14,6 +14,7 @@ $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'; +$lang['Community'] = 'Communauté'; $lang['Light mode'] = 'Mode léger'; $lang['When light mode is activated no external script is loaded, it speeds up the load of the page and disables user tracking but also disables annotations and in-page popups.'] = 'Quand le mode léger est activé aucun script externe n\'est chargé, celà accélère le chargement de la page est désactive le tracking des utilisateurs mais désactive aussi les annotations et les popups détaillés.'; ?> \ No newline at end of file diff --git a/main.inc.php b/main.inc.php index f4d3ef7..a78d7ec 100644 --- a/main.inc.php +++ b/main.inc.php @@ -152,6 +152,11 @@ function socialbutt_add_button() include_once(SOCIALBUTT_PATH . 'include/pinterest.inc.php'); socialbutt_pinterest($basename, $root_url, $tpl_vars, $buttons); } + if ($conf['SocialButtons']['reddit']['enabled']) + { + include_once(SOCIALBUTT_PATH . 'include/reddit.inc.php'); + socialbutt_reddit($basename, $root_url, $tpl_vars, $buttons); + } unset_make_full_url(); diff --git a/template/admin.tpl b/template/admin.tpl index ce95864..64f5ed8 100644 --- a/template/admin.tpl +++ b/template/admin.tpl @@ -336,6 +336,55 @@ jQuery(".showInfo").tipTip({ {* *} +
{* *} + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ {'Button type'|@translate} +
+ + + +
+
{* *} +
diff --git a/template/images/reddit_interactive.png b/template/images/reddit_interactive.png new file mode 100644 index 0000000..cdb3770 Binary files /dev/null and b/template/images/reddit_interactive.png differ diff --git a/template/images/reddit_logo.png b/template/images/reddit_logo.png new file mode 100644 index 0000000..620a031 Binary files /dev/null and b/template/images/reddit_logo.png differ diff --git a/template/reddit.tpl b/template/reddit.tpl new file mode 100644 index 0000000..671352a --- /dev/null +++ b/template/reddit.tpl @@ -0,0 +1,14 @@ +{strip} +{if not $SOCIALBUTT.light && $SOCIALBUTT.REDDIT.type == 'interactive'} + + +{else} + + Submit to reddit +{/if} +{/strip} \ No newline at end of file