当前位置: 首页>>代码示例>>PHP>>正文


PHP CBXPunycode::ToUnicode方法代码示例

本文整理汇总了PHP中CBXPunycode::ToUnicode方法的典型用法代码示例。如果您正苦于以下问题:PHP CBXPunycode::ToUnicode方法的具体用法?PHP CBXPunycode::ToUnicode怎么用?PHP CBXPunycode::ToUnicode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBXPunycode的用法示例。


在下文中一共展示了CBXPunycode::ToUnicode方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: findCorrectFile

 function findCorrectFile($path, &$strWarn, $warning = false)
 {
     $arUrl = CHTTP::ParseURL($path);
     if ($arUrl && is_array($arUrl)) {
         if (isset($arUrl['host'], $arUrl['scheme'])) {
             if (strpos($arUrl['host'], 'xn--') !== false) {
                 // Do nothing
             } else {
                 $originalPath = $path;
                 $path = $arUrl['scheme'] . '://' . $arUrl['host'];
                 $arErrors = array();
                 if (defined("BX_UTF")) {
                     $punicodedPath = CBXPunycode::ToUnicode($path, $arErrors);
                 } else {
                     $punicodedPath = CBXPunycode::ToASCII($path, $arErrors);
                 }
                 if ($pathPunicoded == $path) {
                     return $originalPath;
                 } else {
                     $path = $punicodedPath;
                 }
                 if ($arUrl['port'] && ($arUrl['scheme'] != 'http' || $arUrl['port'] != 80) && ($arUrl['scheme'] != 'https' || $arUrl['port'] != 443)) {
                     $path .= ':' . $arUrl['port'];
                 }
                 $path .= $arUrl['path_query'];
             }
         } else {
             $DOC_ROOT = $_SERVER["DOCUMENT_ROOT"];
             $path = Rel2Abs("/", $path);
             $path_ = $path;
             $io = CBXVirtualIo::GetInstance();
             if (!$io->FileExists($DOC_ROOT . $path)) {
                 if (CModule::IncludeModule('clouds')) {
                     $path = CCloudStorage::FindFileURIByURN($path, "component:player");
                     if ($path == "") {
                         if ($warning) {
                             $strWarn .= $warning . "<br />";
                         }
                         $path = $path_;
                     }
                 } else {
                     if ($warning) {
                         $strWarn .= $warning . "<br />";
                     }
                     $path = $path_;
                 }
             } elseif (strpos($_SERVER['HTTP_HOST'], 'xn--') !== false) {
                 $path = CHTTP::URN2URI($path);
             }
         }
     }
     return $path;
 }
开发者ID:spas-viktor,项目名称:books,代码行数:53,代码来源:component.php

示例2: preg_replace

use Bitrix\Main\Analytics;
Loc::loadMessages(__FILE__);
if (!$USER->CanDoOperation("view_other_settings") || !Analytics\SiteSpeed::isLicenseAccepted()) {
    $APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
CJSCore::Init(array("site_speed", "date"));
$APPLICATION->SetAdditionalCSS("/bitrix/panel/main/site_speed.css");
$APPLICATION->SetTitle(Loc::getMessage("MAIN_SITE_SPEED_TITLE"));
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
?>

<div class="site-speed-page">
	<?php 
$currentHost = preg_replace("/:(80|443)\$/", "", $_SERVER["HTTP_HOST"]);
$currentHost = htmlspecialcharsbx($currentHost);
$currentHostTitle = htmlspecialcharsbx(\CBXPunycode::ToUnicode($currentHost, $errors));
?>
	<div class="site-speed-domains">
		<span class="site-speed-domains-label"><?php 
echo Loc::getMessage("MAIN_SITE_SPEED_DOMAINS_LABEL");
?>
</span>
		<select class="site-speed-domains-select" id="site-speed-domains">
			<option value="<?php 
echo $currentHost;
?>
"><?php 
echo $currentHostTitle;
?>
</option>
		</select>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:site_speed.php

示例3: CAdminMessage

                }
            }
            if (count($arDomains) <= 0) {
                $msg = new CAdminMessage(array('MESSAGE' => Loc::getMessage('SEO_YANDEX_ERROR'), 'HTML' => 'Y'));
                echo $msg->Show();
            } else {
                ?>
<div id="seo_original_text_form_form">
<form name="seo_original_text_form" style="padding:0;margin: 0;">
	<b><?php 
                echo Loc::getMessage('SEO_YANDEX_DOMAIN');
                ?>
: </b><select name="domain">
<?php 
                foreach ($arDomains as $domain) {
                    $domainView = \CBXPunycode::ToUnicode($domain['DOMAIN'], $errors = null);
                    $domainEnc = Converter::getHtmlConverter()->encode($domain['DOMAIN']);
                    $domainViewEnc = Converter::getHtmlConverter()->encode($domainView);
                    ?>
		<option value="<?php 
                    echo $domainEnc;
                    ?>
"><?php 
                    echo $domainViewEnc;
                    ?>
</option>
<?php 
                }
                ?>
	</select><br /><br />
	<textarea style="width: 700px; height: 450px;" name="original_text"></textarea>
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:seo_yandex.php

示例4:

		$domain = false;
}

if(!$domain)
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError(Loc::getMessage("SEO_ERROR_NO_DOMAIN"));
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php");
}

$APPLICATION->SetAdditionalCSS('/freetrix/panel/seo/seo.css');

$engine = new Engine\Google();

$siteDomainEnc = Converter::getHtmlConverter()->encode($arDomain['DOMAIN']);
$siteDomainEncView = Converter::getHtmlConverter()->encode(\CBXPunycode::ToUnicode($arDomain['DOMAIN'], $e = null));
$siteDirEnc = Converter::getHtmlConverter()->encode($arDomain['SITE_DIR']);

try
{
	$arSiteInfo = $engine->getSiteInfo($arDomain['DOMAIN'], $arDomain['SITE_DIR']);
}
catch(Exception $e)
{
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/prolog_admin_after.php");
	ShowError($e->getMessage());
	require($_SERVER["DOCUMENT_ROOT"]."/freetrix/modules/main/include/epilog_admin.php");
}

$bSiteVerified = $arSiteInfo[$domain]['verified'] == 'true';
开发者ID:ASDAFF,项目名称:open_bx,代码行数:30,代码来源:seo_search_google_detail.php

示例5: Fetch

 function Fetch()
 {
     if ($res = parent::Fetch()) {
         global $DB, $CACHE_MANAGER;
         static $arCache;
         if (!is_array($arCache)) {
             $arCache = array();
         }
         if (is_set($arCache, $res["LID"])) {
             $res["DOMAINS"] = $arCache[$res["LID"]];
         } else {
             if (CACHED_b_lang_domain === false) {
                 $res["DOMAINS"] = "";
                 $db_res = $DB->Query("SELECT * FROM b_lang_domain WHERE LID='" . $res["LID"] . "'");
                 while ($ar_res = $db_res->Fetch()) {
                     $domain = $ar_res["DOMAIN"];
                     $arErrorsTmp = array();
                     if ($domainTmp = CBXPunycode::ToUnicode($ar_res["DOMAIN"], $arErrorsTmp)) {
                         $domain = $domainTmp;
                     }
                     $res["DOMAINS"] .= $domain . "\r\n";
                 }
             } else {
                 if ($CACHE_MANAGER->Read(CACHED_b_lang_domain, "b_lang_domain", "b_lang_domain")) {
                     $arLangDomain = $CACHE_MANAGER->Get("b_lang_domain");
                 } else {
                     $arLangDomain = array("DOMAIN" => array(), "LID" => array());
                     $rs = $DB->Query("SELECT * FROM b_lang_domain ORDER BY " . $DB->Length("DOMAIN"));
                     while ($ar = $rs->Fetch()) {
                         $arLangDomain["DOMAIN"][] = $ar;
                         $arLangDomain["LID"][$ar["LID"]][] = $ar;
                     }
                     $CACHE_MANAGER->Set("b_lang_domain", $arLangDomain);
                 }
                 $res["DOMAINS"] = "";
                 if (is_array($arLangDomain["LID"][$res["LID"]])) {
                     foreach ($arLangDomain["LID"][$res["LID"]] as $ar_res) {
                         $domain = $ar_res["DOMAIN"];
                         $arErrorsTmp = array();
                         if ($domainTmp = CBXPunycode::ToUnicode($ar_res["DOMAIN"], $arErrorsTmp)) {
                             $domain = $domainTmp;
                         }
                         $res["DOMAINS"] .= $domain . "\r\n";
                     }
                 }
             }
             $res["DOMAINS"] = Trim($res["DOMAINS"]);
             $arCache[$res["LID"]] = $res["DOMAINS"];
         }
         if (trim($res["DOC_ROOT"]) == "") {
             $res["ABS_DOC_ROOT"] = $_SERVER["DOCUMENT_ROOT"];
         } else {
             $res["ABS_DOC_ROOT"] = Rel2Abs($_SERVER["DOCUMENT_ROOT"], $res["DOC_ROOT"]);
         }
         if ($res["ABS_DOC_ROOT"] !== $_SERVER["DOCUMENT_ROOT"]) {
             $res["SITE_URL"] = (CMain::IsHTTPS() ? "https://" : "http://") . $res["SERVER_NAME"];
         }
     }
     return $res;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:60,代码来源:main.php

示例6: foreach

?>
:</td>
	<td width="60%"><select name="PROTO">
		<option value="0"<?php 
echo $arSitemap['SETTINGS']['PROTO'] == 0 ? ' selected="selected"' : '';
?>
>http</option>
		<option value="1"<?php 
echo $arSitemap['SETTINGS']['PROTO'] == 1 ? ' selected="selected"' : '';
?>
>https</option>
	</select> <b>://</b> <select name="DOMAIN">
<?php 
foreach ($arSite['DOMAINS'] as $domain) {
    $hd = Converter::getHtmlConverter()->encode($domain);
    $hdc = Converter::getHtmlConverter()->encode(CBXPunycode::ToUnicode($domain, $e = null));
    ?>
	<option value="<?php 
    echo $hd;
    ?>
"<?php 
    echo $domain == $arSitemap['SETTINGS']['DOMAIN'] ? ' selected="selected"' : '';
    ?>
><?php 
    echo $hdc;
    ?>
</option>
<?php 
}
?>
</select> <b><?php 
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:seo_sitemap_edit.php

示例7: CAdminMessage

    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
if ($campaign['OWNER_ID'] != $currentUser['id']) {
    $bReadOnly = true;
    $bAllowUpdate = false;
    $message = new CAdminMessage(array("TYPE" => "ERROR", "MESSAGE" => Loc::getMessage('SEO_CAMPAIGN_WRONG_OWNER', array("#USERINFO#" => "(" . $campaign["OWNER_ID"] . ") " . $campaign["OWNER_NAME"]))));
} elseif (!in_array($campaign["SETTINGS"]['Strategy']['StrategyName'], Adv\YandexCampaignTable::$supportedStrategy)) {
    $bReadOnly = true;
    $message = new CAdminMessage(array("TYPE" => "ERROR", "MESSAGE" => Loc::getMessage("SEO_CAMPAIGN_STRATEGY_NOT_SUPPORTED", array("#STRATEGY#" => Loc::getMessage('SEO_CAMPAIGN_STRATEGY_' . $campaign["SETTINGS"]['Strategy']['StrategyName'])))));
}
$bShowStats = $ID > 0 && $bAllowUpdate;
$bShowAuto = $ID > 0 && $bAllowUpdate && IsModuleInstalled("catalog");
if ($ID <= 0) {
    $host = str_replace(array(':80', ':443'), '', $request->getHttpHost());
    $errors = null;
    $host = \CBXPunycode::ToUnicode($host, $errors);
    $banner = array("SETTINGS" => array("CampaignID" => $campaign["SETTINGS"]["CampaignID"], "Title" => "", "Text" => "", "Href" => 'http' . ($request->isHttps() ? 's' : '') . '://' . $host, "Geo" => Main\Config\Option::get('seo', 'yandex_direct_region_last_list', ''), "Phrases" => array(), "MinusKeywords" => array()));
    if ($elementId > 0 && Main\Loader::includeModule('iblock')) {
        $dbElement = \CIBlockElement::getByID($elementId);
        if ($element = $dbElement->fetch()) {
            $banner['SETTINGS']['Href'] .= \CIBlock::replaceDetailUrl($element['DETAIL_PAGE_URL'], $element, false, "E");
        }
    } else {
        $banner['SETTINGS']['Href'] .= '/';
    }
    $banner['SETTINGS']['Href'] .= strpos($banner['SETTINGS']['Href'], "?") >= 0 ? '?' : '&';
    $banner['SETTINGS']['Href'] .= AdvSession::URL_PARAM_CAMPAIGN . '=' . AdvSession::URL_PARAM_CAMPAIGN_VALUE . '&' . AdvSession::URL_PARAM_BANNER . '=' . AdvSession::URL_PARAM_BANNER_VALUE;
}
$banner["SETTINGS"]["Geo"] = explode(",", $banner["SETTINGS"]["Geo"]);
$banner["SETTINGS"]["MinusKeywords"] = implode(", ", $banner["SETTINGS"]["MinusKeywords"]);
$aTabs = array(array("DIV" => "edit_main", "TAB" => Loc::getMessage("SEO_BANNER_TAB_MAIN"), "TITLE" => Loc::getMessage("SEO_BANNER_TAB_MAIN_TITLE")), array("DIV" => "edit_geo", "TAB" => Loc::getMessage("SEO_BANNER_TAB_GEO"), "TITLE" => Loc::getMessage("SEO_BANNER_TAB_GEO_TITLE")), array("DIV" => "edit_keywords", "TAB" => Loc::getMessage("SEO_BANNER_TAB_KEYWORDS"), "TITLE" => Loc::getMessage("SEO_BANNER_TAB_KEYWORDS_TITLE")));
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:seo_search_yandex_direct_banner_edit.php


注:本文中的CBXPunycode::ToUnicode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。