Tipafriend and freecap
From TYPO3Wiki
Contents |
How to use sr_freecap with tipafriend
To get better captchas you can use tipafriend with the extension sr_freecap.
What you need
You'll need this extensions:
- tipafriend
- captcha
- sr_freecap
Edit: class.tx_tipafriend.php
- Insert
if (t3lib_extMgm::isLoaded('sr_freecap') ) {
require_once(t3lib_extMgm::extPath('sr_freecap').'pi2/class.tx_srfreecap_pi2.php');
$this->freeCap = t3lib_div::makeInstance('tx_srfreecap_pi2');
}
directly under
function main_tipafriend($content,$conf){
(line ~60)
- Replace
$markerArray['###CAPTCHA_HTML###']=$captchaHTMLoutput;
with:
if (is_object($this->freeCap)) {
$markerArray = array_merge($markerArray, $this->freeCap->makeCaptcha());
} else {
$subpartArray['###CAPTCHA_INSERT###'] = "";
}
(line ~210)
- Replace
($captchaStr===-1 || ($captchaStr && $tipData['captchaResponse']===$captchaStr))
with:
$this->freeCap->checkWord($tipData['captchaResponse'])
(line ~275)
Edit: tipafriend_template.tmpl
- Replace
###CAPTCHA_HTML###<input type="text" size=30 name="TIPFORM[captchaResponse]" value="">
with:
<label for="tx_your_extension_id_pi1_captcha_response">###SR_FREECAP_NOTICE###</label> ###SR_FREECAP_CANT_READ### <input type="text" size="15" id="TIPFORM[captchaResponse]" name="TIPFORM[captchaResponse]" title="###SR_FREECAP_NOTICE###" value=""> ###SR_FREECAP_IMAGE###
Warning
This works under tipafriend v1.2.3! Other versions not tested yet.