Mittwoch, 9. September 2009

Integration of tinCaptcha into ccnewsletter


  1. Download and install plg_tincaptcha_0.1.1.zip and com_tincaptcha_0.1.1.zip from http://joomlacode.org/gf/project/tincaptcha/frs/



  2. Download, unpack and install ccNewsletter_104Stable_UNZIP_FIRST.zip from http://extensions.chillcreations.com/


  3. Edit components/com_ccnewsletter/views/ccnewsletter/tmpl/default.php of your Joomla installation and add the following lines below the Email input field:

    <tr>
    <td width="150">
    <label for="captcha">
    <?php echo JText::_( 'TIN_CAPTCHA' );?>:
    </label>
    </td>
    <td>
    <img src="index.php?option=com_tincaptcha&task=captcha_display" onclick="this.src='index.php?option=com_tincaptcha&task=captcha_display&t='+(new Date()).getTime()" alt="Click to refresh image"/>
    <input type="text" name="captcha" id="captcha" size="10" value="" />
    </td>
    <td>

    </td>
    </tr>
    <tr>
    <td colspan="2">
    If code cannot be deciphered, click on the image to generate a new code <br/> &nbsp;
    </td>
    </tr>

    after the lines:

    <td>
    <input type="text" name="email" id="email1" size="32" maxlength="250" value="<?php echo $this->email;?>" />
    </td>
    </tr>



  4. Edit components/com_ccnewsletter/controller.php of your Joomla installation and add the following lines:

    $captchk = plgSystemTincaptcha::check(JRequest::getVar('captcha', '', 'post'));

    if ($captchk !== true)
    {
    // show info
    echo plgSystemTincaptcha::check(JRequest::getVar('captcha', '', 'post'));
    break;
    }

    after the line:

    $params = &JComponentHelper::getParams( 'com_ccnewsletter' );




  5. Check it out!

Keine Kommentare: