當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。