Official support hours: from 9 AM — 6 PM Monday to Friday (GMT +2).
The support staff may not reply on technical inquiries on weekends; all requests will be answered necessarily during working days. Reply time: depending on the complexity of your issue, the answer can be provided between a few hours up to 48 hours. In the particular instances we will notify you if extra time will be required to solve the issue.

×

Notice

The forum is in read only mode.

Invisible Captcha in JComments templates

4 years 2 months ago #1169 by Eugene S.
Invisible Captcha in JComments templates was created by Eugene S.
If you want to enable Invisible Captcha in JComments, please patch RoundTheme template:

/SITEROOT/components/com_jcomments/tpl/rnd_templatename/tpl_form.php:

Find the following lines:
<?php
		}
		if ($this->getVar('comments-form-captcha', 0) == 1) {
			$html = $this->getVar('comments-form-captcha-html');
            if ($html == 'recaptcha') {
                    // Recaptcha
                $recaptcha = JCaptcha::getInstance('recaptcha', array('namespace' => 'anything'));
                echo $recaptcha->display('recaptcha', 'dynamic_recaptcha_1','g-recaptcha');
            }
			elseif ($html != '') {
?>

<div class="rnd-form-row">
	<label class="rnd-form-label" for="comments-form-captcha"><?php echo JText::_('FORM_CAPTCHA'); ?></label>
	<div class="rnd-form-controls">
		<img class="captcha" onclick="jcomments.clear('captcha');" id="comments-form-captcha-image" src="<?php echo $link; ?>" width="121" height="60" alt="<?php echo JText::_('FORM_CAPTCHA'); ?>" /><br />
		<div class="rnd-margin-small-top">
			<span class="captcha rnd-button rnd-button-small" data-rnd-tooltip title="<?php echo JText::_('FORM_CAPTCHA_REFRESH'); ?>" onclick="jcomments.clear('captcha');"><i class="rnd-icon-refresh"></i></span>
			<input class="captcha rnd-form-width-small" id="comments-form-captcha" type="text" name="captcha_refid" value="" size="5" tabindex="6" />
		</div>
	</div>
</div>	

And replace them to these lines:
<?php
		}
		if ($this->getVar('comments-form-captcha', 0) == 1) {
			$html = $this->getVar('comments-form-captcha-html');
			if ($html == 'kcaptcha') {
				$link = JCommentsFactory::getLink('captcha');
?>
<p>
	<span>
		<img class="captcha" onclick="jcomments.clear('captcha');" id="comments-form-captcha-image" src="<?php echo $link; ?>" width="121" height="60" alt="<?php echo JText::_('FORM_CAPTCHA'); ?>" /><br />
		<span class="captcha" onclick="jcomments.clear('captcha');"><?php echo JText::_('FORM_CAPTCHA_REFRESH'); ?></span><br />
		<input class="captcha" id="comments-form-captcha" type="text" name="captcha_refid" value="" size="5" tabindex="6" /><br />
	</span>
</p>
<?php
			} else {
				$recaptcha = JCaptcha::getInstance($html, array('namespace' => 'jcomments'));
				echo $recaptcha->display('recaptcha', 'dynamic_recaptcha_1','g-recaptcha');
?>

Like our extensions for Kunena?
Add your voice to the JED listing with a 100 score review: bit.ly/2cIg8pF
Thanks!
Moderators: Eugene S.

Partners