当前位置: 首页>>代码示例>>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;未经允许,请勿转载。