Пример #1
0
        </h2>
    </div>
    <div class="panel-body">
        <ul class="avatar-list">
        	<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $tfocus, 'itemView' => '_tview', 'template' => "{items}\n{pager}"));
?>
        </ul>
    </div>
</div>

<div class="panel panel-default low">
    <div class="panel-heading">
        <h2 class="panel-title">粉丝 
        	<span class="badge"><?php 
echo Focus::countTfocus($model->id);
?>
</span>
        	<span class="pull-right"><a href="<?php 
echo Yii::app()->createUrl('/set/profile', array('id' => $model->id, 'type' => 'fans'));
?>
">全部粉丝</a></span>
        </h2>
    </div>
    <div class="panel-body">
        <ul class="avatar-list">
        	<?php 
$this->widget('zii.widgets.CListView', array('dataProvider' => $ffocus, 'itemView' => '_fview', 'template' => "{items}\n{pager}"));
?>
        </ul>
    </div>
Пример #2
0
 public function actionInfo($id)
 {
     $model = $this->loadModel($id);
     $isFocus = Focus::isFocus($id, 0, 'no');
     $html = '<div class="media media-user"><div class="media-left">';
     $html .= '<a href="' . $model->url . '">';
     $html .= '<img src="' . Profile::avatarByUserId($id) . '" alt="' . $model->username . '"/></a></div>';
     $html .= '<div class="media-body"><h2 class="media-heading"><span class="fa fa-mars"></span> ';
     $html .= '<a href="' . $model->url . '">' . User::getNameById($model->id) . '</a>';
     $html .= '<div class="time">最后登录:' . date('Y-m-d H:i:s', $model->profile->last_visit_time) . '<br>';
     $html .= '粉丝:' . Focus::countTfocus($id) . ' (排名:' . Focus::fansRank($id) . ')</div></div>';
     $html .= '<div class="media-footer"><a class="btn btn-xs ' . ($isFocus ? "btn-danger" : "btn-success") . ' btn-follow" href="' . Yii::app()->createUrl('/set/FocusEasy/', array('id' => $id)) . '">';
     $html .= '<span class="glyphicon glyphicon-plus"></span>' . ($isFocus ? "已關注" : "關注") . '</a></div>';
     echo $html;
 }