From 7cd449b5eb1462fa8f3dc01586a7dc7a99694cb1 Mon Sep 17 00:00:00 2001 From: mistic100 Date: Fri, 4 Oct 2013 22:02:41 +0000 Subject: [PATCH] add reddit button git-svn-id: http://piwigo.org/svn/extensions/SocialButtons@24758 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin.php | 5 +++ include/install.inc.php | 14 +++++++ include/reddit.inc.php | 44 ++++++++++++++++++++++ language/en_UK/plugin.lang.php | 1 + language/fr_FR/plugin.lang.php | 1 + main.inc.php | 5 +++ template/admin.tpl | 49 +++++++++++++++++++++++++ template/images/reddit_interactive.png | Bin 0 -> 1487 bytes template/images/reddit_logo.png | Bin 0 -> 1759 bytes template/reddit.tpl | 14 +++++++ 10 files changed, 133 insertions(+) create mode 100644 include/reddit.inc.php create mode 100644 template/images/reddit_interactive.png create mode 100644 template/images/reddit_logo.png create mode 100644 template/reddit.tpl 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 0000000000000000000000000000000000000000..cdb37705ab2edef9cb90ec1e99a2f56699b3d993 GIT binary patch literal 1487 zcmV;=1u*)FP)Cs0)v=iJ`_UL4%siltmqj3MR&;e;6NeBW{C+#6O5xjE_r5)H&GV zC{s5T2XpJCLxBl%!?leQ+S1aezuQCaS_-{6vbMGNsQnF0{+wOc*`IEIkF%!JIlkG|D%rz~5pDEjr%MV{A@ zUAV2f{^^7d=F&7tR|c8JSge zwPuq!VE?n@$f2R{PH~|u6bk$L`d0KdKzTk?+-^5Ze4Xf;kHap=i>IYVZhK`%`c73I)G_f zS{kAZYae()0Ib0ZDl01!zQ^$Ju*2a%Vs^|G;827zQjMGu)xos%5K2K~ws( z(q-=et!AZ8qgvIif4J&iQ1rPI-TKy-8yg#U?W%2h|7|gm7TM3~p6mGF$cZywcXf3g zKK5bmi>0x?436P+I@#R}u?Fr0L4eW|viA9WAZp~!5M$gicbk=3omLhi-fb*dJ!+Lk zr~22eLo7}^daV7x!B^_)>ab5f#+vqHUw(l-^f31Qx7hAI;*R!LTUrYh#n4AA&Wd#m zSnOc0EMHd9aD{qkjr9;TH<9}uYaMpGy}!Soy%p3i>pzweGp4LZXk{fztb4?wmdTbD z`~plQN)RYTN7u2MWoFEbSu7FDgr=C@w4SDz?3q=k7j_0p$5ZX4mvwKs~eh^T&{az&RvSTS)S zoVwNSVg69Le;fAm5Zha!R6)DbLUA>FI%dme1$c)YL$$ z@tf1{w6*Vh{oVMt6Nbu)vNYr&C}UxB6_?A!P0KQMz0zRN4}>jZDbALGg$@j$kVUAq z8b*^;RAmCTAbcw1(HfkzHGW&tu&*c{ubGa$30PtL7xDa!H8|2rp z8X(C_sxSZd#p(#86Fl7Q4P5@iL!>0P}~002ovPDHLkV1nHh)FA)> literal 0 HcmV?d00001 diff --git a/template/images/reddit_logo.png b/template/images/reddit_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..620a03144051afa068c5469c4c87101d361785e2 GIT binary patch literal 1759 zcmV<51|a!~P)p^LpwAQcghK zfNoODH=w(e(o7COr%faK1axu%T4gFKGwCUxK+*{)&C9D9e)PhIA^eddZEJ#WW{2Y6 z62ymH>@Hz{sj7;3TrR%)F7O0;cmh2{B%JdJ z<^>=nt5abK7n&qVg{^m?!{E!A_ha6hlJ%(oa!0isYPt8_{kbr!rSRQw85S6jrCrrB z5oAPjAY@m|TABwv-kHFNh}aAJ3j{0mJjSlBuGnNUVbkgK<%YxIz&4vrBkT2=9gj!c z|3Jd^gtYbK4(JX`1RE6YBjCu#<8c#&Y`5FW6?vXlaU53^g)Wg&K#!o;C-gl7xmk&X z8(1!vP3MC+p2u}TQ4~$|3G%oeBGyNvJ!3wb&6*AdiLew{QC|RQAQB`(e16zJVh{*7 z3G%WmJ7wX|q^f?6p0_G|uPrQ@Jzw+B>HR3Bfk;o_a4xh0iRk1LfRLZrtNfLoUIX&@ z`Rm~1GzJHMhIgU;;wwdpH>=f(-Q3)qUh(7bcK_eQ={4f9AIFo^h+J#(Sp5v78#fo$ zM*&rw(lZ0FrogY!6SL zD{?`PSbi*o;}z|9BC%|fF0{pbKEG4~#g5N=(vt|5*9>kRL@Ee&Murq(C?K7n!hk36 zmB2*yeA0Qbz)}ji^_w}6tMwyCW2jk~)$w%_kjq50c~9dCd>Vd!_@;o;$>z$IOG zMP*B1YP3Rx{Hg>V$KeK5ZWehX|8%5E=&1@5U1%o{X@RbDVB*>a+*p7NnJDZd%>Wq? z5K7zOBz>0G2O3QgLy0ScDrcwIRSWWwqos`EHb>tIT%v!094F`qrx z$|J?Ix)2z#)8!*30-2@lNtZzcg*k|X<)K1jic;Y!5d@J{maP3sG;yNl7Q2*Oi;CD( zazT)7i%2e#I#)~?#w`ep74EPU@;(!Rh2|Yq?GoS7y2c3BvxPO0MK!|rArxIUTM$kA zS%+Lk9%U+GBB{eFi`a6i)N+4G9c3agV6Q9lOr52giRkaZtb#SQcJc{q6(9sk?4EG-;9r6GZ+p;p~*-L||H|SPo??6Ns z5>bld1fEfr+vx_D)M>UkcB&wMB0Xo{Lt9+PS=-8BeG<6A3bVyx(YVCjZr6&y=B?{{ zo}L;H*k}Dyv}O=-+ea|0o&r9&Lyxd z)*bJgeC9geH-qoLt%<|A=jBnA$J$d4C#dmg{EC{u4yY;l<%2FaQsH2YxDT{XzdyL zo&~G>i4C&~d#y;=U5ebX(7|g(s=y4X!qg$cm7`KsPC8;Ah!_dIZ6U8EDel7p<>b1w zSo&NT`H3Mx4>i@O!jj164s8h(<-NfxG0Jk1sUjm5yQ#tPKm?8z9g?!wPdE`h+f@CK zb?~nzAxSJ%S#<4+6xE}cbnteRA5ltcMiFFch4|c|U9p3n!jZtR zF9ORBBg;0@Y%V*a2DXV{V{)OnAej`n*q$2;&*s9HH-y5m(4uE9>B)qtBovMXin$u+ zmJWUM#zMdNe|C4-@c*gF6X@Xy^za1!U-6#+0{{_YJs{Q7;s5{u002ovPDHLkV1l1> BOhf +reddit_url = "{$SOCIALBUTT.share_url|escape:javascript}"; +reddit_title = "{$PAGE_TITLE|cat:' | '|cat:$GALLERY_TITLE|escape:javascript}"; +reddit_target = "{$SOCIALBUTT.REDDIT.community|escape:javascript}"; +reddit_newwindow = 1; + + +{else} + + Submit to reddit +{/if} +{/strip} \ No newline at end of file