From 9f608f4b07be7570a1a08f54b51984051c00e79e Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 15 Feb 2012 18:15:10 -0800 Subject: [PATCH] qcomment addon --- qcomment.tgz | Bin 0 -> 1024 bytes qcomment/qcomment.css | 19 ++++++++++++ qcomment/qcomment.php | 66 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 qcomment.tgz create mode 100755 qcomment/qcomment.css create mode 100755 qcomment/qcomment.php diff --git a/qcomment.tgz b/qcomment.tgz new file mode 100644 index 0000000000000000000000000000000000000000..6e33819d245d92b2fd1d4c9e58dca55274d6ca6a GIT binary patch literal 1024 zcmV+b1poUViwFRdW;{;-1MOCAZ`(Ey_E+my+|;151IMxw%MM)I!?5++x^76ZFKu8j z5@ivlNrj~Hf+7EXByBmC?IOXDWCO+r2ofFdo_pnm*9l)PF;ijV_0ZE84&%mY+#jBv z_8Yx;a60HmR=!3fiiXj!7Z3aKu+fW72U-o{SBz8cUSSiMS!`J9@=D9z^Ho z=Wh|y8{)d^fAvSV$cq>D@kIa62E+bN|KmujL+^#-IEepw|HnV-etVu59v^#f48Nfz z9>E_aNfz+)Y9NgG7c3J&3Pm^@!IxVO2{jt)k&#B_Pb{Q8j=DYb{ZpxOE=KT)EHHek ziVNdhsbUm{n{szGNmvM;5sJg5R-PJb{S$g#R!sasQK!DPev+&@Io8t|w)qAvTe|U;~R&c5QxrddxcH=#Ghte!r zEzy#_YN}7szi6@t^Q{}S-XEdP`y**`_nIVY{Q#6Fh|WrhMXTNRnz}ox6iicsMyRJP zO@WsJq`IeA<`^qb98`{>KywU|!!3pcF<2r!j#hK+OjGj(Fp^+9a)$2+olK3{*C1C* znq!m(m(ZO+Fs6hpKwvuYA07Ds>b}4eU*S6yCQ|y43!F{-0J@fHj@9f6Nn8rk&MpMu z_v)yPjZxsk5~l=Bd_4g^gi|B*zlm?m*BLjDZn;P$Ou!Hq31=CZx3&w^*>oc41XkI$ zSr@W0olGD@RAN)g4V`KQqmy>fw$7NZe_2UuTVh0%Q`=2jD!D35N^bN{KvL?;tP6W` zrDIz7)8Io*Ge5KGXr9`Zfs4&VnhK0VqxWIY2T3P>mE6g#Kt+MYo(qbuFs-Xvkq;Rc z+x8}LzY6Cg(-#1)%k9P10nYRYX}Rt^UWEqZ(6a4%HSI?Nqn#M7kF5#uf$1H)uVKS5 z^Ck`t5{i*7(CQ#~M$=?@wIq+Fh3S~E zqEzbyR;PYF#Y(u7S0z5|!G{|}OT4-zy80JZx~i}l`Ax*lT5cwV$IJil^e(Z>XT4Ca zp0iNwHJSbX`QpphU?-R0(r)9XeEz-bRPEbkTpeGw&BbgImhsm9mDsE(iEeP(wZ-}P z`B!7|U~+$n|NjS<&`S_+;i>okSufta|IVVGegE|b?)~=`@ZQyTq#5vxa->E;ai;XB z-I7%0BRK2ziaY(eL_)s}P82WnQ_qU@B)+T9^*+hIRmB^vd2>wWxi*Mm`(0;U-9JNH uBZ}AV|Lr0=I5;>sI5;>sI5;>sI5;>sI5;>sI5;@`hwwMvZLQS+C;$MPrT}*U literal 0 HcmV?d00001 diff --git a/qcomment/qcomment.css b/qcomment/qcomment.css new file mode 100755 index 00000000..3e5513bb --- /dev/null +++ b/qcomment/qcomment.css @@ -0,0 +1,19 @@ + +#qcomment-label { + float: left; + width: 300px; + margin-top: 10px; +} + +#qcomment-words { + float: left; + margin-top: 10px; + width: 100px; + height: 150px; + +} + +#qcomment-submit { + margin-top: 15px; +} + diff --git a/qcomment/qcomment.php b/qcomment/qcomment.php new file mode 100755 index 00000000..bc4d96ff --- /dev/null +++ b/qcomment/qcomment.php @@ -0,0 +1,66 @@ + + * + */ + +function qcomment_install() { + register_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); + register_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); + +} + + +function qcomment_uninstall() { + unregister_hook('plugin_settings', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings'); + unregister_hook('plugin_settings_post', 'addon/qcomment/qcomment.php', 'qcomment_addon_settings_post'); + +} + + + + + +function qcomment_addon_settings(&$a,&$s) { + + if(! local_user()) + return; + + /* Add our stylesheet to the page so we can make our settings look nice */ + + $a->page['htmlhead'] .= '' . "\r\n"; + + $words = get_pconfig(local_user(),'qcomment','words'); + if($words === false) + $words = t(':-)') . "\n" . t(':-(') . "\n" . t('lol'); + + $s .= '
'; + $s .= '

' . t('Quick Comment Settings') . '

'; + $s .= '
'; + $s .= ''; + $s .= ''; + $s .= '
'; + + $s .= '
'; + $s .= '
'; + + return; + +} + +function qcomment_addon_settings_post(&$a,&$b) { + + if(! local_user()) + return; + + if($_POST['qcomment-submit']) { + set_pconfig(local_user(),'qcomment','words',xmlify($_POST['qcomment-words'])); + info( t('Quick Comment settings saved.') . EOL); + } +} +