本文整理汇总了PHP中Komento::getCaptcha方法的典型用法代码示例。如果您正苦于以下问题:PHP Komento::getCaptcha方法的具体用法?PHP Komento::getCaptcha怎么用?PHP Komento::getCaptcha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Komento
的用法示例。
在下文中一共展示了Komento::getCaptcha方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
$captchaGroup = $system->config->get( 'show_captcha', '' );
if( !is_array( $captchaGroup ) )
{
$captchaGroup = explode( ',', $captchaGroup );
}
$usergids = $system->my->getUsergroups();
$requiresCaptcha = false;
foreach( $usergids as $gid )
{
if( in_array( $gid, $captchaGroup ) )
{
$requiresCaptcha = true;
break;
}
}
if( $system->config->get( 'antispam_captcha_enable' ) && $requiresCaptcha ) { ?>
<div class="kmt-form-captcha">
<?php if( $system->config->get( 'antispam_captcha_type' ) == 0 || ( $system->config->get( 'antispam_captcha_type') == 1 && $system->config->get('antispam_recaptcha_public_key') && $system->config->get('antispam_recaptcha_private_key') ) ) {
echo Komento::getCaptcha()->getHTML();
} else {
if( $system->config->get( 'antispam_captcha_type') == 1 && ( !$system->config->get('antispam_recaptcha_public_key') || !$system->config->get('antispam_recaptcha_private_key') ) ) {
echo JText::_( 'COM_KOMENTO_RECAPTCHA_MISSING_KEYS' );
}
} ?>
</div>
<?php }
示例2: reloadCaptcha
function reloadCaptcha()
{
$ajax = Komento::getAjax();
$reload = Komento::getCaptcha()->getReloadSyntax();
$ajax->success( $reload );
$ajax->send();
}