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


PHP zmf::text方法代码示例

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


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

示例1: actionView

 public function actionView()
 {
     $id = zmf::val('id', 2);
     if (!$id) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     $info = $this->loadModel($id);
     $pageSize = 30;
     $comments = Comments::getCommentsByPage($id, 'posts', 1, $pageSize);
     $tags = Tags::getByIds($info['tagids']);
     $relatePosts = Posts::getRelations($id, 5);
     if (!zmf::actionLimit('visit-Posts', $id, 5, 60)) {
         Posts::updateCount($id, 'Posts', 1, 'hits');
     }
     $size = '600';
     if ($this->isMobile) {
         $size = '640';
     }
     $info['content'] = zmf::text(array(), $info['content'], true, $size);
     $data = array('info' => $info, 'comments' => $comments, 'tags' => $tags, 'relatePosts' => $relatePosts, 'loadMore' => count($comments) == $pageSize ? 1 : 0);
     $this->favorited = Favorites::checkFavored($id, 'post');
     $this->pageTitle = $info['title'];
     $this->selectNav = 'posts';
     $this->render('view', $data);
 }
开发者ID:ph7pal,项目名称:momo,代码行数:25,代码来源:PostsController.php

示例2: foreach

<div class="main-page">
    <?php 
echo zmf::text(array(), $info['content']);
?>
</div>
<div class="aside-page">
    <?php 
if (!empty($allInfos)) {
    ?>
    <div class="list-group">
        <?php 
    foreach ($allInfos as $val) {
        ?>
        <?php 
        echo CHtml::link($val['title'], array('siteinfo/view', 'code' => $val['code']), array('class' => 'list-group-item ' . ($code == $val['code'] ? 'active' : '')));
        ?>
        <?php 
    }
    ?>
    </div>
    <?php 
}
?>
</div>
开发者ID:ph7pal,项目名称:naodong,代码行数:24,代码来源:siteinfo.php

示例3:

</script>
<?php 
$cs = Yii::app()->clientScript;
$cs->registerScriptFile(Yii::app()->baseUrl . '/ueditor/umeditor.js', CClientScript::POS_END);
$cs->registerScriptFile(Yii::app()->baseUrl . '/ueditor/lang/zh-cn/zh-cn.js', CClientScript::POS_END);
$cs->registerScriptFile(Yii::app()->baseUrl . '/common/uploadify/jquery.uploadify-3.1.min.js', CClientScript::POS_END);
?>
<textarea id="<?php 
echo CHtml::activeId($model, $attri);
?>
" name="<?php 
echo CHtml::activeName($model, $attri);
?>
" style="width:500px;height:200px;">
<?php 
echo zmf::text(array('action' => 'edit', 'encode' => 'yes'), $content);
?>
</textarea>
<textarea id="input_tmp" name="input_tmp" style="display: none"></textarea>
<input id="textareaid" type="hidden" value="<?php 
echo CHtml::activeId($model, $attri);
?>
"/>
<script>
var tipImgUploadUrl="<?php 
echo $upurl;
?>
";
var allowImgTypes="<?php 
echo zmf::config('imgAllowTypes');
?>
开发者ID:ph7pal,项目名称:mei,代码行数:31,代码来源:editor_bd.php

示例4: array

$this->breadcrumbs = array(CHtml::link('首页', zmf::config('baseurl')), '脑洞大开' => array('index/index'), $info['title'] ? $info['title'] : '详情');
?>
<div class="main-page">
  <?php 
if ($info['title'] != '') {
    ?>
<h1 class="item-title"><?php 
    echo $info['title'];
    ?>
</h1><?php 
}
?>
  <div id="content">
    <?php 
echo zmf::text($info['content']);
?>
    
  </div>
  <p class="text-center"><?php 
echo CHtml::link($info['favors'] . ' 赞', 'javascript:;', array('class' => 'btn btn-' . ($this->favored ? 'success' : 'default'), 'action' => 'favor', 'action-data' => $info['id'], 'action-type' => 'naodong', 'id' => 'favor-naodong-' . $info['id']));
?>
</p>
  <?php 
if (!empty($preInfo)) {
    ?>
  <p>上一篇:<?php 
    echo CHtml::link($preInfo['title'], array('index/view', 'id' => $preInfo['id']));
    ?>
</p>
  <?php 
开发者ID:ph7pal,项目名称:naodong,代码行数:30,代码来源:view.php

示例5: foreach

<h1><?php 
echo $info['title'];
?>
</h1>
<div class="zmf-border-bottom">
    <?php 
echo zmf::text(array(), $info['content'], false);
?>
</div>
<?php 
if (!empty($allInfos)) {
    ?>
<h4>相关文章</h4>
<div class="list-group">
    <?php 
    foreach ($allInfos as $val) {
        ?>
    <?php 
        echo CHtml::link($val['title'], array('siteinfo/view', 'code' => $val['code']), array('class' => 'list-group-item ' . ($code == $val['code'] ? 'active' : '')));
        ?>
    <?php 
    }
    ?>
</div>
<?php 
}
开发者ID:ph7pal,项目名称:mei,代码行数:26,代码来源:siteinfo.php

示例6: array

    echo $info['title'];
    ?>
</h1><?php 
}
?>
        <?php 
if (!empty($userInfo)) {
    ?>
<p class="author"><?php 
    echo CHtml::link($userInfo['truename'], array('index/media', 'id' => $userInfo['id']));
    ?>
</p><?php 
}
?>
        <?php 
echo zmf::text($info['content'], NULL, false);
?>
        
    </div>
    <?php 
if (!empty($preInfo) || !empty($nextInfo)) {
    ?>
    <ul class="ui-list ui-list-link ui-border-t preNext">
        <?php 
    if (!empty($preInfo)) {
        ?>
        <li class="ui-list-info ui-nowrap" data-href="<?php 
        echo Yii::app()->createUrl('index/view', array('id' => $preInfo['id']));
        ?>
">上一篇:<?php 
        echo $preInfo['title'];
开发者ID:ph7pal,项目名称:naodong,代码行数:31,代码来源:view.php

示例7: array

        <p class="title"><?php 
if ($from == 'poipost') {
} else {
    if ($data['poiTitle']) {
        echo '<span class="pull-left">' . CHtml::link($data['poiTitle'], array('position/view', 'id' => $data['logid'])) . '</span>' . zmf::starCss($data['score']);
    }
}
?>
</p>
        <p class="author"><?php 
$this->renderPartial('/common/_user', array('uid' => $data['uid'], 'uname' => $_uname, 'type' => 'l', 'lcss' => ''));
?>
</p>        
        <div class="content-detail hidden">
            <?php 
echo zmf::text(array(), $data['content']);
?>
        </div>
        <div class="content-substr">
            <div class="toggle-area">
                <?php 
echo zmf::tipSubStr($data['content'], 140, 1, '...<a href="javascript:;" class="more">查看详情</a>');
?>
            </div>            
        </div>
        <p class="color-grey"><?php 
echo $formatTime;
?>
&nbsp;<?php 
echo CHtml::link($data['comments'] . '条评论', 'javascript:;', array('action' => 'get-contents', 'action-data' => $data['id'], 'action-type' => 'comments', 'action-target' => 'comments-poipost-' . $data['id'], 'action-classify' => 'poipost'));
?>
开发者ID:ph7pal,项目名称:wedding,代码行数:31,代码来源:_view.php

示例8: actionCreate


//.........这里部分代码省略.........
         $model->classify = Posts::CLASSIFY_WEDDING;
         //文章分类
     }
     if (isset($_POST['ajax']) && $_POST['ajax'] === 'posts-form') {
         echo CActiveForm::validate($model);
         Yii::app()->end();
     }
     if (isset($_POST['Posts'])) {
         //判断是否应被禁止
         //todo,应排除编辑
         //            $forbidInfo = Posts::isForbidden($_POST['Posts']['content'], 'post');
         //            if ($forbidInfo['status'] != Posts::STATUS_PASSED) {
         //                //todo,增加用户非法操作次数
         //                $_POST['Posts']['status'] = Posts::STATUS_STAYCHECK;
         //            }
         //处理文本
         $filter = Posts::handleContent($_POST['Posts']['content']);
         $_POST['Posts']['content'] = $filter['content'];
         foreach ($_POST['Posts'] as $k => $val) {
             $_POST['Posts'][$k] = zmf::filterInput($val, 't');
         }
         if (Yii::app()->session['checkHasBadword'] == 'yes') {
             $_POST['Posts']['status'] = Posts::STATUS_STAYCHECK;
         }
         if (!$model->isNewRecord) {
             $_POST['Posts']['updateTime'] = zmf::now();
             $isNew = false;
         } else {
             $isNew = true;
         }
         unset(Yii::app()->session['checkHasBadword']);
         if (!empty($filter['attachids'])) {
             $attkeys = array_filter(array_unique($filter['attachids']));
             if (!empty($attkeys)) {
                 $_POST['Posts']['faceimg'] = $attkeys[0];
                 //默认将文章中的第一张图作为封面图
             }
         } else {
             $_POST['Posts']['faceimg'] = '';
             //否则将封面图置为空(有可能编辑后没有图片了)
         }
         //相关标签
         $tags = $_POST['tagnames'];
         $tags = !empty($tags) ? array_unique(array_filter($tags)) : array();
         $model->attributes = $_POST['Posts'];
         if ($model->save()) {
             //将上传的图片置为通过
             Attachments::model()->updateAll(array('status' => Posts::STATUS_DELED), 'logid=:logid AND classify=:classify', array(':logid' => $model->id, ':classify' => 'posts'));
             if (!empty($attkeys)) {
                 $attstr = join(',', $attkeys);
                 if ($attstr != '') {
                     Attachments::model()->updateAll(array('status' => Posts::STATUS_PASSED, 'logid' => $model->id), 'id IN(' . $attstr . ')');
                 }
             }
             //相关标签
             $tagids = array();
             if (!empty($tags)) {
                 foreach ($tags as $str) {
                     $_tmp = explode('-', $str);
                     if ($_tmp[1] > 0) {
                         //添加对应关系
                         if (Tags::addRelation($_tmp[1], $model->id, 'posts')) {
                             $tagids[] = $_tmp[1];
                         }
                     } else {
                         //查找是否有对应话题
                         $_tagid = Tags::findAndAdd($_tmp[0], 'posts', $model->id);
                         if ($_tagid) {
                             $tagids[] = $_tagid;
                         }
                     }
                 }
                 $tagids = !empty($tagids) ? array_unique(array_filter($tagids)) : array();
                 $tagStr = join(',', $tagids);
                 if ($tagStr != '') {
                     Posts::model()->updateByPk($model->id, array('tagids' => $tagStr));
                 }
             }
             $this->redirect(array('view', 'id' => $model->id));
         }
     }
     //未认证用户不能创建团队
     if (!$this->userInfo['creditStatus']) {
         $this->message(0, '请完善资料并提交个人认证', Yii::app()->createurl('users/config', array('type' => 'info')));
     }
     //文章分类
     $cols = Column::allCols(1, 0, 1, Posts::CLASSIFY_WEDDING);
     if (!$model->isNewRecord) {
         $model->content = zmf::text(array('action' => 'edit'), $model->content, false, 600);
     }
     //获取所有受推荐地区
     $topAreas = Area::getTops(0);
     $areas = CHtml::listData($topAreas, 'id', 'title');
     //推荐的标签
     $suggestTags = Tags::getTops('posts');
     //我所加入的团队
     $groups = WeddingGroup::getUserGroup($this->uid);
     $this->pageTitle = '新增作品 - ' . zmf::config('sitename');
     $this->render('create', array('model' => $model, 'cols' => $cols, 'action' => $action, 'areas' => $areas, 'suggestTags' => $suggestTags, 'groups' => $groups));
 }
开发者ID:ph7pal,项目名称:wedding,代码行数:101,代码来源:PostsController.php

示例9: array

<?php

$a = Yii::app()->getController()->getAction()->id;
$this->menu = array('文章列表' => array('link' => array('siteInfo/index'), 'active' => in_array($a, array('index'))), '新增文章' => array('link' => array('siteInfo/create'), 'active' => in_array($a, array('create', 'update'))), '更新文章' => array('link' => array('siteInfo/update', 'id' => $model->id), 'active' => in_array($a, array('create', 'update'))), '文章详情' => array('link' => array('siteInfo/view', 'id' => $model->id), 'active' => in_array($a, array('view'))), '文章预览' => array('link' => array('/site/info', 'code' => $model->code)));
?>
<h1><?php 
echo $model->title;
?>
</h1>
<p class="help-block">    
    <?php 
echo zmf::formatTime($model->cTime);
?>
</p>
<?php 
echo zmf::text(array(), $model->content, false);
开发者ID:ph7pal,项目名称:momo,代码行数:16,代码来源:view.php


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