[TYPO3] Tutorial: tipafriend and sr_freecap

otto at webspinnerij.nl otto at webspinnerij.nl
Thu Apr 26 14:03:50 CEST 2007


Fabian,

I really like to thank you for this.
It is much better than the original capcha and you made it like a walk in
the park.

Keep up this kind of tutorial

Otto

-----Oorspronkelijk bericht-----
Van: typo3-english-bounces at lists.netfielders.de
[mailto:typo3-english-bounces at lists.netfielders.de] Namens Fabian Koenig
Verzonden: donderdag 26 april 2007 12:49
Aan: typo3-english at lists.netfielders.de
Onderwerp: [TYPO3] Tutorial: tipafriend and sr_freecap

I've written a small "ToDo"-List for using "sr_freecap" 
(captcha-extension) with "tipafriend", because I can't find any HowTo.
(my english is bad, sorry..)




===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###</lab
el>
                 ###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>





Hope it helps..
Fabian
_______________________________________________
TYPO3-english mailing list
TYPO3-english at lists.netfielders.de
http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english





More information about the TYPO3-english mailing list