本文整理汇总了PHP中CBTxt::utf8ToISO方法的典型用法代码示例。如果您正苦于以下问题:PHP CBTxt::utf8ToISO方法的具体用法?PHP CBTxt::utf8ToISO怎么用?PHP CBTxt::utf8ToISO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBTxt
的用法示例。
在下文中一共展示了CBTxt::utf8ToISO方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Th
static function Th( $english ) {
global $_CB_TxtIntStore;
if ( $_CB_TxtIntStore->_mode == 0 ) {
if ( isset( $_CB_TxtIntStore->_strings[$english] ) ) {
return CBTxt::utf8ToISO( $_CB_TxtIntStore->_strings[$english] );
} else {
return $english;
}
} elseif ( $_CB_TxtIntStore->_mode == 1 ) {
if ( isset( $_CB_TxtIntStore->_strings[$english] ) ) {
return CBTxt::utf8ToISO( '*' . $_CB_TxtIntStore->_strings[$english] . '*' );
} else {
return '===>' . str_replace( '%s', '[%s]', $english ) . '<===';
}
} else {
$_CB_TxtIntStore->recordUsedString( $english );
if ( isset( $_CB_TxtIntStore->_strings[$english] ) ) {
return '<span style="color:#CCC;font-style:italic">' . CBTxt::utf8ToISO( $_CB_TxtIntStore->_strings[$english] ) . '</span>';
} else {
return '<span style="color:#FF0000;font-weight:bold">' . '===>' . $english . '<===' . '</span>';
}
}
}
示例2: utf8ToISO
/**
* @deprecated CB 1.2.2 : use CBTxt::utf8ToISO( $string )
* @param string $string
* @return string
*/
function utf8ToISO($string)
{
return CBTxt::utf8ToISO($string);
}
示例3: fieldClass
/**
* Direct access to field for custom operations, like for Ajax
*
* WARNING: direct unchecked access, except if $user is set, then check
* that the logged-in user has rights to edit that $user.
*
* @param moscomprofilerFields $field
* @param moscomprofilerUser $user
* @param array $postdata
* @param string $reason 'profile' for user profile view, 'edit' for profile edit, 'register' for registration, 'search' for searches
* @return string Expected output.
*/
function fieldClass(&$field, &$user, &$postdata, $reason)
{
global $_CB_framework, $_CB_database, $ueConfig, $_GET;
parent::fieldClass($field, $user, $postdata, $reason);
// performs spoofcheck.
if (($field->type == 'primaryemailaddress' && (isset($ueConfig['reg_email_checker']) && $ueConfig['reg_email_checker'] > 0) || $field->params->get('field_check_email', 0) || $_CB_framework->getUi() == 2) && ($reason == 'edit' || $reason == 'register')) {
$function = cbGetParam($_GET, 'function', '');
if ($function == 'checkvalue') {
$email = stripslashes(cbGetParam($postdata, 'value', ''));
$emailISO = CBTxt::utf8ToISO($email);
// ajax sends in utf8, we need to convert back to the site's encoding.
if ($field->type == 'primaryemailaddress' && ((isset($ueConfig['reg_email_checker']) ? $ueConfig['reg_email_checker'] > 1 : false) && ($reason == 'register' || $reason == 'edit' && $user && $emailISO != $user->email) || $_CB_framework->getUi() == 2)) {
if ($_CB_database->isDbCollationCaseInsensitive()) {
$query = "SELECT COUNT(*) AS result FROM #__users WHERE email = " . $_CB_database->Quote(trim($emailISO));
} else {
$query = "SELECT COUNT(*) AS result FROM #__users WHERE LOWER(email) = " . $_CB_database->Quote(strtolower(trim($emailISO)));
}
$_CB_database->setQuery($query);
$dataObj = null;
if ($_CB_database->loadObject($dataObj)) {
if ($function == 'testexists') {
if ($dataObj->result) {
return '<span class="cb_result_ok">' . sprintf(ISOtoUtf8(_UE_EMAIL_EXISTS_ON_SITE), htmlspecialchars($email)) . "</span>";
} else {
return '<span class="cb_result_error">' . sprintf(ISOtoUtf8(_UE_EMAIL_DOES_NOT_EXISTS_ON_SITE), htmlspecialchars($email)) . "</span>";
}
} else {
if ($dataObj->result) {
return '<span class="cb_result_error">' . sprintf(ISOtoUtf8(_UE_EMAIL_ALREADY_REGISTERED), htmlspecialchars($email)) . "</span>";
}
}
}
}
if ($function == 'testexists') {
return ISOtoUtf8(_UE_NOT_AUTHORIZED);
} else {
if ($reason == 'register' || $reason == 'edit' && $user && $emailISO != $user->email || $_CB_framework->getUi() == 2) {
$checkResult = cbCheckMail($_CB_framework->getCfg('mailfrom'), $emailISO);
} else {
return '<span class="cb_result_info">' . sprintf(ISOtoUtf8(CBTxt::T("No changes.")), htmlspecialchars($email)) . "</span>";
}
}
switch ($checkResult) {
case -2:
return '<span class="cb_result_error">' . sprintf(ISOtoUtf8(_UE_EMAIL_NOVALID), htmlspecialchars($email)) . "</span>";
break;
case -1:
return '<span class="cb_result_warning">' . sprintf(ISOtoUtf8(_UE_EMAIL_COULD_NOT_CHECK), htmlspecialchars($email)) . "</span>";
break;
case 0:
if ($ueConfig['reg_confirmation'] == 0) {
return '<span class="cb_result_error">' . sprintf(ISOtoUtf8(_UE_EMAIL_INCORRECT_CHECK), htmlspecialchars($email)) . "</span>";
} else {
return '<span class="cb_result_error">' . sprintf(ISOtoUtf8(_UE_EMAIL_INCORRECT_CHECK_NEEDED), htmlspecialchars($email)) . "</span>";
}
break;
case 1:
return '<span class="cb_result_ok">' . sprintf(ISOtoUtf8(_UE_EMAIL_VERIFIED), htmlspecialchars($email)) . "</span>";
break;
default:
return '<span class="cb_result_error">' . sprintf(CBTxt::T('Unexpected cbCheckMail result: %s'), $checkResult) . '.</span>';
break;
}
}
return null;
} else {
return ISOtoUtf8(_UE_NOT_AUTHORIZED);
}
}