Changeset 3283
- Timestamp:
- 12/21/13 00:11:59 (9 years ago)
- Location:
- plugins/dcReCaptcha
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcReCaptcha/_define.php
r3282 r3283 24 24 "Benoit de Marne", 25 25 /* Version */ 26 '0.0. 1',26 '0.0.2', 27 27 /* Properties */ 28 28 array( -
plugins/dcReCaptcha/_public.php
r3282 r3283 29 29 ); 30 30 31 if(empty($dcRecaptcha_settings['private_key']) 32 || empty($dcRecaptcha_settings['public_key'])33 || !$dcRecaptcha_settings['comments_form_enable']) {31 # reCAPTCHA is not correctly configured 32 if(empty($dcRecaptcha_settings['private_key']) 33 || empty($dcRecaptcha_settings['public_key'])) { 34 34 return; 35 } 35 } 36 36 37 37 # adding behaviors 38 38 $core->addBehavior('publicBeforeDocument', array('dcReCaptchaBehaviorsPublic','publicBeforeDocument')); 39 $core->addBehavior('publicCommentFormAfterContent', array('dcReCaptchaBehaviorsPublic','publicCommentFormAfterContent'));40 39 $core->addBehavior('publicHeadContent', array('dcReCaptchaBehaviorsPublic','publicHeadContent')); 40 41 if($dcRecaptcha_settings['comments_form_enable']) { 42 $core->addBehavior('publicCommentFormAfterContent', array('dcReCaptchaBehaviorsPublic','publicCommentFormAfterContent')); 43 } 44 45 $core->tpl->addValue('dcReCaptchaForm', array('tplDcReCaptcha', 'dcReCaptchaForm')); 41 46 42 47 class dcReCaptchaBehaviorsPublic … … 86 91 } 87 92 93 class tplDcReCaptcha 94 { 95 public static function dcReCaptchaForm($attr, $content) 96 { 97 global $core; 98 $res = ''; 99 100 if (!isset($_SESSION['recaptcha_ok'])) { 101 102 $dcReCaptcha = new dcReCaptcha($core); 103 $res = '<p id="dcrecaptcha-form">'. 104 $dcReCaptcha->getReCaptchaHtml(). 105 '</p>'; 106 } 107 return $res; 108 109 } 110 } -
plugins/dcReCaptcha/changelog.txt
r3282 r3283 1 dcReCaptcha 0.0.2 - 2013-12-20 2 =========================================================== 3 * ajout le template {{tpl:dcReCaptchaForm}} pour utiliser reCAPTCHA dans le page ContactMe 4 1 5 dcReCaptcha 0.0.1 - 2013-12-19 2 6 =========================================================== -
plugins/dcReCaptcha/inc/class.dc.filter.recaptcha.php
r3282 r3283 141 141 '<form action="'.html::escapeURL($url).'" method="post" id="reCaptcha">'. 142 142 143 '</p>'.144 143 '<p><a href="'.$this->dcReCaptcha->getApiUrl().'">'.__('Get your owns API key').'</a></p>'. 145 144 … … 162 161 '</p>'. 163 162 163 '<p>If you want add reCAPTCHA form with the plugin ContactMe:'. 164 '<ul>'. 165 '<li>insert template {{tpl:dcReCaptchaForm}} to form in file contact_me.html</li>'. 166 '<li>activate the spam filter option in ContactMe</li>'. 167 '</ul>'. 168 '</p>'. 169 164 170 '<p>'.__('reCAPTCHA is a free CAPTCHA service that protects your site against spam.').'</p>'. 165 171
Note: See TracChangeset
for help on using the changeset viewer.