[TYPO3] Tutorial: tipafriend + freecap

Fabian Koenig koenig at bluhouse.de
Thu Apr 26 12:47:11 CEST 2007


Hi!

I'ver written a small (bad style) "ToDo"-List tu use freecap 
(captcha-Extension) with tipafriend, 'cause I can't find any HowTo.




===class.tx_tipafriend.php===
1. Insert following directly under "function 
main_tipafriend($content,$conf){":
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');
}
(line ~60)



2. Replace "$markerArray['###CAPTCHA_HTML###']=$captchaHTMLoutput;" with:
			if (is_object($this->freeCap)) {
				$markerArray = array_merge($markerArray, $this->freeCap->makeCaptcha());
			} else {
				$subpartArray['###CAPTCHA_INSERT###'] = '';
			}
(line ~210)



3. Replace "($captchaStr===-1 || ($captchaStr && 
$tipData['captchaResponse']===$captchaStr))" with:
			$this->freeCap->checkWord($tipData['captchaResponse'])
(line ~275)



===tipafriend_template.tmpl===
1. Replace "###CAPTCHA_HTML###<input type="text" size=30 
name="TIPFORM[captchaResponse]" value="">" with:
			<div class="tx-your-extension-id-pi1-captcha">
				<label 
for="tx_your_extension_id_pi1_captcha_response">###SR_FREECAP_NOTICE###</label>
				###SR_FREECAP_CANT_READ###
				<br />
				<input type="text" size="15" id="TIPFORM[captchaResponse]" 
name="TIPFORM[captchaResponse]" title="###SR_FREECAP_NOTICE###" value="">
				###SR_FREECAP_IMAGE###
			</div>




Hopt it helps...
Fabian


More information about the TYPO3-english mailing list