當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utils_Unicode::lessenAsByte方法代碼示例

本文整理匯總了PHP中Utils_Unicode::lessenAsByte方法的典型用法代碼示例。如果您正苦於以下問題:PHP Utils_Unicode::lessenAsByte方法的具體用法?PHP Utils_Unicode::lessenAsByte怎麽用?PHP Utils_Unicode::lessenAsByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Utils_Unicode的用法示例。


在下文中一共展示了Utils_Unicode::lessenAsByte方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SyndicateToEolin

/**
 * @brief Syndicating routine.
 * @see Tag, User, DBModel, Model_Context
 */
function SyndicateToEolin($entryId, $entry, $mode)
{
    $context = Model_Context::getInstance();
    $blogid = $context->getProperty('blog.id');
    $rpc = new XMLRPC();
    $rpc->url = 'http://ping.eolin.com/';
    $summary = array('blogURL' => $context->getProperty('uri.default'), 'syncURL' => $context->getProperty('uri.default') . "/plugin/abstractToEolin?entryId={$entryId}");
    if ($mode == 'create') {
        $summary['blogTitle'] = $context->getProperty('blog.title');
        $summary['language'] = $context->getProperty('blog.language');
        $summary['permalink'] = $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$entry['slogan']}" : $entry['id']);
        $summary['title'] = Utils_Unicode::lessenAsByte($entry['title'], 255);
        $summary['content'] = Utils_Unicode::lessenAsByte(stripHTML(getEntryContentView($blogid, $entry['id'], $entry['content'], $entry['contentformatter'])), 1023, '');
        $summary['author'] = User::authorName($entry['userid'], $entryId);
        $summary['tags'] = Tag::getTagsWithEntryId($blogid, $entry);
        $summary['location'] = $entry['location'];
        $summary['written'] = Timestamp::getRFC1123($entry['published']);
    }
    return $rpc->call("sync.{$mode}", $summary);
}
開發者ID:ragi79,項目名稱:Textcube,代碼行數:24,代碼來源:index.php

示例2: validate

 private function validate()
 {
     if (is_null($this->id)) {
         $this->id = $this->getNextId();
     }
     $this->category = Utils_Unicode::lessenAsByte($this->category, 11);
     $this->content = Utils_Unicode::lessenAsByte($this->content, 512);
     if (empty($this->author)) {
         $this->author = User::getName();
     }
     $this->author = Utils_Unicode::lessenAsByte($this->author, 32);
     if (!Validator::isInteger($this->blogid, 1)) {
         return $this->error('blogid');
     }
     if (!Validator::timestamp($this->created)) {
         return $this->error('created');
     }
     return true;
 }
開發者ID:Avantians,項目名稱:Textcube,代碼行數:19,代碼來源:Line.php

示例3: lessenAsEncoding

 static function lessenAsEncoding($str, $length = 255, $tail = '...')
 {
     $context = Model_Context::getInstance();
     if ($context->getProperty('database.utf8') != true) {
         return Utils_Unicode::lessen($str, $length, $tail);
     } else {
         return Utils_Unicode::lessenAsByte($str, $length, $tail);
     }
 }
開發者ID:ragi79,項目名稱:Textcube,代碼行數:9,代碼來源:Unicode.php


注:本文中的Utils_Unicode::lessenAsByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。