本文整理匯總了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();
}