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


PHP idna_convert::decode方法代码示例

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


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

示例1: flattenTree

function flattenTree($rootNode, $type, $allMessages, &$flattenedTree)
{
    $status = 'ok';
    $flattenedTree = array();
    $IDN = new idna_convert();
    foreach ($rootNode as $treeNode) {
        if (!isset($treeNode['message'])) {
            $flattenedSubtree = null;
            $result = flattenTree($treeNode, $type, $allMessages, $flattenedSubtree);
            foreach ($flattenedSubtree as $subtreeNode) {
                $flattenedTree[] = $subtreeNode;
                if ('warn' == $result && 'ok' == $status) {
                    $status = 'warn';
                } elseif ('error' == $result) {
                    $status = 'error';
                }
            }
        } elseif ('WARNING' == $treeNode['level'] || 'ERROR' == $treeNode['level'] || ('INFO' == $treeNode['level'] || 'NOTICE' == $treeNode['level']) && $allMessages) {
            if (is_null($treeNode['formatstring'])) {
                $caption = "-";
            } else {
                $caption = sprintf($treeNode['formatstring'], $IDN->decode($treeNode['arg0']), $IDN->decode($treeNode['arg1']), $IDN->decode($treeNode['arg2']), $IDN->decode($treeNode['arg3']), $IDN->decode($treeNode['arg4']), $IDN->decode($treeNode['arg5']), $IDN->decode($treeNode['arg6']), $IDN->decode($treeNode['arg7']), $IDN->decode($treeNode['arg8']), $IDN->decode($treeNode['arg9']));
            }
            $className = '';
            switch ($treeNode['level']) {
                case 'WARNING':
                    $className = 'warn';
                    break;
                case 'ERROR':
                    $className = 'error';
                    break;
                case 'NOTICE':
                    $className = 'notice';
                    break;
            }
            $flattenedTreeItem = array('type' => $type, 'class' => $className, 'caption' => $caption, 'subtree' => array());
            if (!is_null($treeNode['description'])) {
                $flattenedTreeItem['description'] = $treeNode['description'];
            }
            $flattenedTree[] = $flattenedTreeItem;
            if ('WARNING' == $treeNode['level'] && 'ok' == $status) {
                $status = 'warn';
            } elseif ('ERROR' == $treeNode['level']) {
                $status = 'error';
            }
        }
    }
    return $status;
}
开发者ID:kelixin,项目名称:dnscheck,代码行数:49,代码来源:getResult.php

示例2: punydecode

 public function punydecode($inputtext)
 {
     require_once 'assets/php/vendors/idna_convert_060/idna_convert.class.php';
     require_once 'assets/php/vendors/idna_convert_060/transcode_wrapper.php';
     $IDN = new idna_convert();
     return $IDN->decode($this->response['inputtext']);
 }
开发者ID:Roewe,项目名称:encoder,代码行数:7,代码来源:Request.php

示例3: DecodePunycodeIDN

 /** 
  * Decode IDN Punycode to UTF-8 domain name 
  * 
  * @param string $value Punycode 
  * @return string Domain name in UTF-8 charset 
  * 
  * @author Igor V Belousov <igor@belousovv.ru> 
  * @copyright 2013 Igor V Belousov 
  * @license http://opensource.org/licenses/LGPL-2.1 LGPL v2.1 
  * @link http://belousovv.ru/myscript/phpIDN 
  */
 public static function DecodePunycodeIDN($value)
 {
     Yii::import('application.vendors.punicode.*');
     require_once Yii::getPathOfAlias('application.vendors.punicode') . '/idna_convert.class.php';
     $IDN = new idna_convert();
     // Encode it to its punycode presentation
     $output = $IDN->decode($value);
     return $output;
 }
开发者ID:Aplay,项目名称:Fastreview_site,代码行数:20,代码来源:Helper.php

示例4: checkIdna

 public static function checkIdna($ref)
 {
     $content = '';
     if ($ref == "") {
         $content .= "<font color=grey>неизвестно</font>";
     } else {
         $content .= "<a target=_blank href=\"" . $ref . "\">";
         if (stristr(urldecode($ref), "xn--")) {
             $IDN = new idna_convert(array('idn_version' => 2008));
             $content .= $IDN->decode(urldecode($ref));
         } else {
             $content .= urldecode($ref);
         }
         $content .= "</a>";
     }
     return $content;
 }
开发者ID:buildshop,项目名称:bs-common,代码行数:17,代码来源:StatsHelper.php

示例5: decodeIDN

 /**
  * Converts given punycode to the IDN.
  * @param $value punycode to be converted.
  * @return string resulting IDN.
  * @since 1.1.13
  */
 private function decodeIDN($value)
 {
     require_once Yii::getPathOfAlias('system.vendors.idna_convert') . DIRECTORY_SEPARATOR . 'idna_convert.class.php';
     $idnaConvert = new idna_convert();
     return $idnaConvert->decode($value);
 }
开发者ID:lucifurious,项目名称:yii,代码行数:12,代码来源:CUrlValidator.php

示例6: isset

header('Content-Type: text/html; charset=utf-8');
require_once 'idna_convert.class.php';
$idn_version = isset($_REQUEST['idn_version']) && $_REQUEST['idn_version'] == 2003 ? 2003 : 2008;
$IDN = new idna_convert(array('idn_version' => $idn_version));
$version_select = '<select size="1" name="idn_version"><option value="2003">IDNA 2003</option><option value="2008"';
if ($idn_version == 2008) {
    $version_select .= ' selected="selected"';
}
$version_select .= '>IDNA 2008</option></select>';
if (isset($_REQUEST['encode'])) {
    $decoded = isset($_REQUEST['decoded']) ? stripslashes($_REQUEST['decoded']) : '';
    $encoded = $IDN->encode($decoded);
}
if (isset($_REQUEST['decode'])) {
    $encoded = isset($_REQUEST['encoded']) ? stripslashes($_REQUEST['encoded']) : '';
    $decoded = $IDN->decode($encoded);
}
$lang = 'en';
if (isset($_REQUEST['lang'])) {
    if ('de' == $_REQUEST['lang'] || 'en' == $_REQUEST['lang']) {
        $lang = $_REQUEST['lang'];
        $add .= '<input type="hidden" name="lang" value="' . $lang . '" />' . "\n";
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>phlyLabs Punycode Converter</title>
<meta name="author" content="phlyLabs" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
开发者ID:kimkucheol,项目名称:xe-core,代码行数:31,代码来源:example.php

示例7: actionDetail

 public function actionDetail($detail)
 {
     $group = $_GET['group'];
     if (file_exists("detail.dat") and $group != "false") {
         $group = "true";
     }
     if ($group != "true") {
         echo "<table id=table align=center width=100% cellpadding=5 cellspacing=1 border=0><tr class=h><td width=35>Время</td><td>Referer</td><td width=90>IP-адрес <a class=d href=\"?detail=" . $detail . "&group=true\"\"\">&plusmn;</a></td><td>Хост</td><td>User-Agent</td><td>Страница</td></tr>";
         // $r = mysql_query("SELECT tm,refer,ip,proxy,host,lang,user,req FROM cms_surf WHERE dt='" . $detail . "' ORDER BY i DESC");
         $sql = "SELECT tm,refer,ip,proxy,host,lang,user,req FROM cms_surf WHERE dt='" . $detail . "' ORDER BY i DESC";
         $command = Yii::app()->db->createCommand($sql);
         foreach ($command->queryAll() as $row) {
             //while ($row = mysql_fetch_row($r)) {
             if ($s == "s2") {
                 $s = "s1";
                 echo "<tr class=s1>";
             } else {
                 $s = "s2";
                 echo "<tr class=s2>";
             }
             echo "<td>" . $row['tm'] . "</td>";
             echo "<td align=left style='overflow: hidden;text-overflow: ellipsis;'>";
             $refer = $this->Ref($row['refer']);
             if (is_array($refer)) {
                 list($engine, $query) = $refer;
                 if ($engine == "G" and !empty($query) and stristr($row['refer'], "/url?")) {
                     $row['refer'] = str_replace("/url?", "/search?", $row['refer']);
                 }
                 echo_se($engine);
                 if (empty($query)) {
                     $query = "<font color=grey>неизвестно</font>";
                 }
                 echo ": <a target=_blank href=\"" . $row['refer'] . "\">" . $query . "</a></td>";
             } else {
                 if ($refer == "") {
                     echo "<font color=grey>неизвестно</font>";
                 } else {
                     echo "<a target=_blank href=\"" . $row['refer'] . "\">";
                     if (stristr(urldecode($row['refer']), "xn--")) {
                         $IDN = new idna_convert(array('idn_version' => 2008));
                         echo $IDN->decode(urldecode($row['refer']));
                     } else {
                         echo urldecode($row['refer']);
                     }
                     echo "</a></td>";
                 }
             }
             if ($row['ip'] != "unknown") {
                 echo "<td><a target=_blank href=\"?item=ip&qs=" . $row['ip'] . "\">" . $row['ip'] . "</a>";
             } else {
                 echo "<td><font color=grey>неизвестно</font>";
             }
             if ($row['proxy'] != "") {
                 echo "<br><a target=_blank href=\"?item=ip&qs=" . $row['proxy'] . "\">через proxy</a>";
             }
             echo "</td>";
             if ($row['host'] == "") {
                 echo "<td><font color=grey>неизвестно</font>";
             } else {
                 echo "<td><a target=_blank href=\"http://www.tcpiputils.com/browse/ip-address/" . ($row['proxy'] != "" ? $row['proxy'] : $row['ip']) . "\">" . $row['host'] . "</a>";
             }
             if ($row['lang'] != "") {
                 echo "<br>Язык: " . (!empty(StatsHelper::$LANG[mb_strtoupper($row['lang'])]) ? StatsHelper::$LANG[mb_strtoupper($row['lang'])] : "<font color=grey>неизвестно</font>");
                 if (file_exists("/stats/flags/" . mb_strtolower(StatsHelper::$LANG[mb_strtoupper($row['lang'])]) . ".gif")) {
                     echo " <img align=absmiddle src=/stats/flags/" . mb_strtolower(StatsHelper::$LANG[mb_strtoupper($row['lang'])]) . ".gif width=16 height=12>";
                 }
             }
             echo "</td>";
             echo "<td align=left style='overflow: hidden;text-overflow: ellipsis;'>";
             if (!$this->is_robot($row['user'], $row['host'])) {
                 $brw = StatsHelper::GetBrowser($row['user']);
                 if ($brw != "") {
                     echo "<img src=/stats/browsers/{$brw} width=16 height=16 align=absmiddle> ";
                 }
             }
             echo $row['user'] . "</td>";
             echo "<td align=left style='overflow: hidden;text-overflow: ellipsis;' nowrap><a target=_blank href=" . $row['req'] . ">" . $row['req'] . "</a></td>";
             echo "</tr>";
         }
         echo "<tr class=h><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>";
         //norm(0);
     } else {
         echo "<table id=table align=center width=100% cellpadding=5 cellspacing=1 border=0><tr class=h><td width=90>IP-адрес <a class=d href=\"?detail=" . $detail . "&group=false\"\"\">&plusmn;</a></td><td>Хост</td><td>User-Agent</td><td width=30%>Referer</td><td width=35>Время</td><td>Страница</td></tr>";
         $sql = "SELECT tm,refer,ip,proxy,host,lang,user,req FROM cms_surf WHERE dt='" . $detail . "' ORDER BY i DESC";
         $command = Yii::app()->db->createCommand($sql);
         foreach ($command->queryAll() as $r) {
             //print_r($r);
             //die;
             //$rs = mysql_query("SELECT tm,refer,ip,proxy,host,lang,user,req FROM cms_surf WHERE dt='" . $detail . "' ORDER BY i DESC");
             // while ($r = mysql_fetch_row($rs))
             $row[$r['ip']][] = array($r['tm'], $r['refer'], $r['ip'], $r['proxy'], $r['host'], $r['lang'], $r['user']);
             foreach ($row as $ip => $val) {
                 if ($s == "s2") {
                     $s = "s1";
                     echo "<tr class=s1>";
                 } else {
                     $s = "s2";
                     echo "<tr class=s2>";
                 }
                 if ($ip != "unknown") {
//.........这里部分代码省略.........
开发者ID:buildshop,项目名称:bs-common,代码行数:101,代码来源:DefaultController.php

示例8: urldecode

        <tr>
            <th>Дата</th>
            <th>Последние <?php 
echo $n;
?>
 других сайта</th>
            <th>Время / Страница</th>
        </tr>
    </thead>
    <?php 
foreach ($items as $ref) {
    echo "<tr>";
    echo "<td title=" . StatsHelper::$MONTH[substr($ref['dt'], 4, 2)] . ">" . StatsHelper::$DAY[$ref['day']] . StatsHelper::dtconv($ref['dt']) . "</td>";
    echo "<td class='textL'><a target=_blank href=\"" . $ref['refer'] . "\">";
    if (stristr(urldecode($ref['refer']), "xn--")) {
        $IDN = new idna_convert(array('idn_version' => 2008));
        echo $IDN->decode(urldecode($ref['refer']));
    } else {
        echo urldecode($ref['refer']);
    }
    echo "</a></td>";
    echo "<td class='textL'>" . $ref['tm'] . " <a target=_blank href=" . $ref['req'] . ">" . $ref['req'] . "</a></td></tr>";
}
?>

</table>
<?php 
Yii::app()->tpl->closeWidget();
?>

开发者ID:buildshop,项目名称:bs-common,代码行数:29,代码来源:last_site.php

示例9: csp_is_multisite

    define('CSP_PO_BASE_URL', WP_PLUGIN_URL . CSP_PO_PLUGINPATH);
    //Bugfix: ensure valid JSON requests at IDN locations!
    //Attention: Google Chrome and Safari behave in different way (shared WebKit issue or all other are wrong?)!
    if (stripos($_SERVER['HTTP_USER_AGENT'], 'chrome') !== false || stripos($_SERVER['HTTP_USER_AGENT'], 'safari') !== false || version_compare(phpversion(), '5.2.1', '<')) {
        if (function_exists("admin_url")) {
            define('CSP_PO_ADMIN_URL', rtrim(strtolower(admin_url()), '/'));
        } else {
            define('CSP_PO_ADMIN_URL', rtrim(strtolower(get_option('siteurl')) . '/wp-admin/', '/'));
        }
    } else {
        if (!class_exists('idna_convert')) {
            require_once 'includes/idna_convert.class.php';
        }
        $idn = new idna_convert();
        if (function_exists("admin_url")) {
            define('CSP_PO_ADMIN_URL', $idn->decode(rtrim(strtolower(admin_url()), '/'), 'utf8'));
        } else {
            define('CSP_PO_ADMIN_URL', $idn->decode(rtrim(strtolower(get_option('siteurl')) . '/wp-admin/', '/'), 'utf8'));
        }
    }
    define('CSP_PO_BASE_PATH', WP_PLUGIN_DIR . CSP_PO_PLUGINPATH);
    define('CSP_PO_MIN_REQUIRED_WP_VERSION', '2.5');
    define('CSP_PO_MIN_REQUIRED_PHP_VERSION', '4.4.2');
    register_activation_hook(__FILE__, 'csp_po_install_plugin');
}
function csp_is_multisite()
{
    return isset($GLOBALS['wpmu_version']) || function_exists('is_multisite') && is_multisite() || function_exists('wp_get_mu_plugins') && count(wp_get_mu_plugins()) > 0;
}
if (function_exists('csp_po_install_plugin')) {
    //rewrite and extend the error messages displayed at failed activation
开发者ID:rexin,项目名称:zhibei-tib,代码行数:31,代码来源:codestyling-localization.php

示例10: urldecode

     if ($num & 1) {
         echo "\t<p class='odrow'>\n";
     } else {
         echo "\t<p class='evrow'>\n";
     }
     echo "\n                    {$num}. {$url}<br />\n                        ";
 }
 //  clean url
 if ($idna && strstr($url, "xn--")) {
     require_once "{$include_dir}/idna_converter.php";
     // Initialize the converter class
     $IDN = new idna_convert(array('idn_version' => 2008));
     // The input string, if input is not UTF-8 or UCS-4, it must be converted before
     //$input = utf8_encode($url);
     // Decode it to its readable presentation
     $url = $IDN->decode($url);
 }
 $url = urldecode($db_con->real_escape_string($url));
 $compurl = parse_url("" . $url);
 if ($compurl['path'] == '') {
     $url = $url . "/";
 }
 $sql_query = "SELECT site_ID from " . $mysql_table_prefix . "sites where url='{$url}'";
 $result = $db_con->query($sql_query);
 if ($debug && $db_con->errno) {
     $err_row = __LINE__ - 2;
     printf("<p><span class='red'>&nbsp;MySQL failure: %s&nbsp;\n<br /></span></p>", $db_con->error);
     if (__FUNCTION__) {
         printf("<p><span class='red'>&nbsp;Found in script: " . __FILE__ . "&nbsp;&nbsp;row: {$err_row}&nbsp;&nbsp;in function():&nbsp;" . __FUNCTION__ . "&nbsp;<br /></span></p>");
     } else {
         printf("<p><span class='red'>&nbsp;Found in script: " . __FILE__ . "&nbsp;&nbsp;row: {$err_row}&nbsp;<br /></span></p>");
开发者ID:hackersforcharity,项目名称:rachelpiOS,代码行数:31,代码来源:url_backup.php

示例11: handle_url_tag

function handle_url_tag($url, $link = '', $bbcode = false)
{
    $return = ($hook = get_hook('ps_handle_url_tag_start')) ? eval($hook) : null;
    if ($return != null) {
        return $return;
    }
    $full_url = str_replace(array(' ', '\'', '`', '"'), array('%20', '', '', ''), $url);
    if (strpos($url, 'www.') === 0) {
        // If it starts with www, we add http://
        $full_url = 'http://' . $full_url;
    } else {
        if (strpos($url, 'ftp.') === 0) {
            // Else if it starts with ftp, we add ftp://
            $full_url = 'ftp://' . $full_url;
        } else {
            if (!preg_match('#^([a-z0-9]{3,6})://#', $url)) {
                // Else if it doesn't start with abcdef://, we add http://
                $full_url = 'http://' . $full_url;
            }
        }
    }
    if (defined('FORUM_SUPPORT_PCRE_UNICODE') && defined('FORUM_ENABLE_IDNA')) {
        static $idn;
        static $cached_encoded_urls = null;
        if (is_null($cached_encoded_urls)) {
            $cached_encoded_urls = array();
        }
        // Check in cache
        $cache_key = md5($full_url);
        if (isset($cached_encoded_urls[$cache_key])) {
            $full_url = $cached_encoded_urls[$cache_key];
        } else {
            if (!isset($idn)) {
                $idn = new idna_convert();
                $idn->set_parameter('encoding', 'utf8');
                $idn->set_parameter('strict', false);
            }
            $full_url = $idn->encode($full_url);
            $cached_encoded_urls[$cache_key] = $full_url;
        }
    }
    // Ok, not very pretty :-)
    if (!$bbcode) {
        if (defined('FORUM_SUPPORT_PCRE_UNICODE') && defined('FORUM_ENABLE_IDNA')) {
            $link_name = $link == '' || $link == $url ? $url : $link;
            if (preg_match('!^(https?|ftp|news){1}' . preg_quote('://xn--', '!') . '!', $link_name)) {
                $link = $idn->decode($link_name);
            }
        }
        $link = $link == '' || $link == $url ? utf8_strlen($url) > 55 ? utf8_substr($url, 0, 39) . ' … ' . utf8_substr($url, -10) : $url : stripslashes($link);
    }
    $return = ($hook = get_hook('ps_handle_url_tag_end')) ? eval($hook) : null;
    if ($return != null) {
        return $return;
    }
    if ($bbcode) {
        if (defined('FORUM_SUPPORT_PCRE_UNICODE') && defined('FORUM_ENABLE_IDNA')) {
            if (preg_match('!^(https?|ftp|news){1}' . preg_quote('://xn--', '!') . '!', $link)) {
                $link = $idn->decode($link);
            }
        }
        if ($full_url == $link) {
            return '[url]' . $link . '[/url]';
        } else {
            return '[url=' . $full_url . ']' . $link . '[/url]';
        }
    } else {
        return '<a href="' . $full_url . '">' . $link . '</a>';
    }
}
开发者ID:ZerGabriel,项目名称:punbb,代码行数:70,代码来源:parser.php

示例12: array

<?php

$rewrite = array();
$ttl = substr($_SERVER['REQUEST_URI'], 1, strpos($_SERVER['REQUEST_URI'], '.') - 1);
$table = array('Й' => 'y', 'й' => 'y', 'Ц' => 'c', 'ц' => 'c', 'У' => 'u', 'у' => 'u', 'К' => 'k', 'к' => 'k', 'Е' => 'e', 'е' => 'e', 'Н' => 'n', 'н' => 'n', 'Г' => 'g', 'г' => 'g', 'Ш' => 'sh', 'ш' => 'sh', 'Щ' => 'sch', 'щ' => 'sch', 'З' => 'z', 'з' => 'z', 'Х' => 'h', 'х' => 'h', 'ъ' => '', 'Ъ' => '', 'Ф' => 'f', 'ф' => 'f', 'Ы' => 'y', 'ы' => 'y', 'В' => 'v', 'в' => 'v', 'А' => 'a', 'а' => 'a', 'П' => 'p', 'п' => 'p', 'Р' => 'r', 'р' => 'r', 'О' => 'o', 'о' => 'o', 'Л' => 'l', 'л' => 'l', 'Д' => 'd', 'д' => 'd', 'Ж' => 'zh', 'ж' => 'zh', 'Э' => 'e', 'э' => 'e', 'Я' => 'ya', 'я' => 'ya', 'Ч' => 'ch', 'ч' => 'ch', 'С' => 's', 'с' => 's', 'М' => 'm', 'м' => 'm', 'И' => 'i', 'и' => 'i', 'Т' => 't', 'т' => 't', 'Ь' => '', 'ь' => '', 'Б' => 'b', 'б' => 'b', 'Ю' => 'yu', 'ю' => 'yu', ' ' => '-', '.' => '', ',' => '', '?' => '', '!' => '', 'І' => 'i', 'і' => 'i', 'Ї' => 'yi', 'ї' => 'yi');
include_once 'idna_convert.class.php';
$idn = new idna_convert();
$h = $idn->decode($_SERVER['HTTP_HOST']);
$h = substr($h, 0, strpos($h, '.'));
$dh = opendir('./articles/');
while (false !== ($file = readdir($dh))) {
    if ($file != '.' && $file != '..' && substr($file, -4) == '.txt') {
        $handle = fopen("./articles/{$file}", "r");
        $buffer = trim(fgets($handle));
        fclose($handle);
        $b2 = trim(mb_strtolower(preg_replace('/[^\\w\\d\\p{Cyrillic}]+/u', '-', iconv('cp1251', 'utf-8', $buffer)), 'UTF-8'), '-');
        if ($ttl == strtr($buffer, $table) || $b2 == $h) {
            if (!in_array($_SERVER['REQUEST_URI'], $rewrite) && preg_match('#^(www\\.)?mcdvo\\.com\\.ua$#', $_SERVER['HTTP_HOST'])) {
                header("HTTP/1.1 301 Moved Permanently");
                header("Location: http://" . $idn->encode($b2) . '.mcdvo.com.ua/');
                exit;
            }
            $content = file_get_contents('articles/' . $file);
            $title = substr($content, 0, strpos($content, "\n"));
            $content = '<p>' . str_replace("\n", "\n<br />", substr($content, strpos($content, "\n") + 1)) . "</p>";
            break;
        }
    }
}
?>
<!DOCTYPE html>
开发者ID:Zzepish,项目名称:IvanShikalovWebSIte,代码行数:31,代码来源:articles.php

示例13: getInstanceFromServerType

 public static function getInstanceFromServerType($type,$componentName) {
     // SalesPlatform.ru begin
     require_once 'includes/SalesPlatform/NetIDNA/idna_convert.class.php';
     // SalesPlatform.ru end
     $db = PearDatabase::getInstance();
     $query = 'SELECT * FROM '.self::tableName.' WHERE server_type=?';
     $params = array($type);
     $result = $db->pquery($query,$params);
     try{
     $modelClassName = Vtiger_Loader::getComponentClassName('Model', $componentName, 'Settings:Vtiger');
     }catch(Exception $e) {
         $modelClassName = self;
     }
     $instance = new $modelClassName();
     if($db->num_rows($result) > 0 ){
         $rowData = $db->query_result_rowdata($result,0);
         $instance->setData($rowData);
     }
     // SalesPlatform.ru begin
     $idn = new idna_convert();
     $mail_server_username = $idn->decode($instance->get('server_username'));
     $from_email_field = $idn->decode($instance->get('from_email_field'));
     $instance->set('server_username', $mail_server_username);
     $instance->set('from_email_field', $from_email_field);
     // SalesPlatform.ru end
     return $instance;
 }
开发者ID:Wasage,项目名称:werpa,代码行数:27,代码来源:Systems.php

示例14:

}
if ($pdf_orientation == 'L' or $pdf_orientation == 'l') {
    $pdf_width = 285;
} else {
    $pdf_width = 195;
}
//Titel
$this->SetFont('Arial', '', 12);
$this->Cell($pdf_width - 15, 2, utf8_decode($fromname), 0, 1, 'C');
$this->SetFont('Arial', 'B', 8);
// Include the class
//include_once('idna_convert.class.php');
if (!class_exists('idna_convert')) {
    $path = clm_core::$path . DS . "includes" . DS . "idna_convert.class" . '.php';
    require_once $path;
}
// Instantiate it (depending on the version you are using) with
$IDN = new idna_convert();
// The input string
$input = $_SERVER['HTTP_HOST'];
// Encode it to its punycode presentation
$output = $IDN->decode($input);
$this->Cell($pdf_width - 15, 5, utf8_decode($output), 0, 1, 'C');
//Logo der Organisation (Landesverband, Verein, ...; über Einstellungen vorgegeben)  rechts
$file_headers = @get_headers($org_logo);
if ($org_logo != '' and $file_headers[0] != 'HTTP/1.1 404 Not Found') {
    $this->Image($org_logo, $pdf_width - 20, 6, 15);
}
//Linie mit Zeilenumbruch
$this->Line(15, 20, $pdf_width, 20);
$this->Ln(5);
开发者ID:ChessLeagueManager,项目名称:com_clm,代码行数:31,代码来源:pdf_header.php

示例15: gen_users_list

function gen_users_list(&$tpl, $reseller_id)
{
    global $sql;
    global $cr_user_id;
    $query = <<<SQL_QUERY
        select
            admin_id
        from
            admin
        where
                admin_type = 'user'
            and
                created_by = ?
        order by
            admin_id
SQL_QUERY;
    $ar = exec_query($sql, $query, array($reseller_id));
    if ($ar->RowCount() == 0) {
        set_page_message(tr('You have no user records.'));
        header("Location: domain_alias.php");
        die;
        $tpl->assign('USER_ENTRY', '');
        return false;
    }
    $i = 1;
    while ($ad = $ar->FetchRow()) {
        // Process all founded users
        $admin_id = $ad['admin_id'];
        $selected = '';
        // Get domain data
        $query = <<<SQL_QUERY

            select
                domain_id,
                IFNULL(domain_name, '') as domain_name
            from
                domain
            where
                domain_admin_id = ?
SQL_QUERY;
        $dr = exec_query($sql, $query, array($admin_id));
        $dd = $dr->FetchRow();
        $domain_id = $dd['domain_id'];
        $domain_name = $dd['domain_name'];
        if ('' == $cr_user_id && $i == 1) {
            $selected = 'selected';
        } else {
            if ($cr_user_id == $domain_id) {
                $selected = 'selected';
            }
        }
        $IDN = new idna_convert();
        $domain_name = $IDN->decode($domain_name);
        $domain_name = utf8_decode($domain_name);
        $tpl->assign(array('USER' => $domain_id, 'USER_DOMAIN_ACCOUN' => $domain_name, 'SELECTED' => $selected));
        $i++;
        $tpl->parse('USER_ENTRY', '.user_entry');
    }
    //End of loop
    return true;
}
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:61,代码来源:add_alias.php


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