- Forum
- Products for Joomla
- JComments templates
- RND Jcarteggio
- Invisible Captcha in JComments templates
Invisible Captcha in JComments templates
- Eugene S.
-
Topic Author
- Offline
- Administrator
-
4 years 2 months ago #1169
by Eugene S.
Like our extensions for Kunena?
Add your voice to the JED listing with a 100 score review: bit.ly/2cIg8pF
Thanks!
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:
And replace them to these lines:
/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.