Example #1
0
 public function buildBoards($boardId = 0)
 {
     $html = '';
     $boards = Board::findAll(['parent_id' => $boardId], 'sort_num desc');
     foreach ($boards as $board) {
         $id = $board['id'];
         $subBoards = Board::findAll(['parent_id' => $id], 'sort_num desc');
         if (count($subBoards) == 0) {
             continue;
         }
         $parentBoard = $this->getCachedBoards()[$id];
         $totalRecords = count($subBoards);
         $columnsCount = intval($parentBoard['columns']);
         $html .= '<div class="tbox border">';
         $html .= '<div class="hd" style="border-bottom:none;"><h2><a href="' . YiiForum::getHomeUrl() . '?r=board/index&boardid=' . $id . '">' . $parentBoard['name'] . '</a></h2></div>';
         $html .= '<table class="table" style="margin-bottom:0px;">';
         if ($columnsCount > 1) {
             $html .= $this->getMoreColumn($subBoards, $totalRecords, $columnsCount);
         } else {
             $html .= $this->getOneColumn($subBoards, $totalRecords);
         }
         $html .= '</table>';
         $html .= '</div>';
     }
     return $html;
 }
Example #2
0
 */
$this->title = '脚本升级';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-index">

	<h1><?php 
echo $this->title;
?>
</h1>

   

    <div class="body-content">
    
       <?php 
if (empty($needUpgradeSqls)) {
    echo '不需要升级sql<br>';
    echo '<a href="' . YiiForum::getHomeUrl() . '">返回首页</a>';
} else {
    echo '上次升级到的sql为:' . $lastSql . '<br>';
    echo '需要升级以下sql文件:(升级之前强烈建议你备份数据库)<br>';
    foreach ($needUpgradeSqls as $sql) {
        echo '<font color="red">' . $sql . '</font><br>';
    }
    echo Html::a('升级', ['upgrade/do'], ['class' => 'btn btn-primary']);
}
?>
    </div>
</div>
    </div>

    <div class="tbox">
	    <table class="thread-list border">
	    	<tr>
	    		<th>主题</th>
	    		<th width="120px">作者</th>
	    		<th width="120px">回复/查看</th>
	    		<th width="120px">最后发表</th>
	    	</tr>
	    	<?php 
foreach ($rows as $row) {
    ?>
	    	<tr>
	    		<td><a href="<?php 
    echo YiiForum::getHomeUrl() . '?r=thread/view&id=' . $row['id'];
    ?>
"><?php 
    echo $row['title'];
    ?>
</a></td>
	    		<td class="author"><?php 
    echo $row['user_name'];
    ?>
<br/><?php 
    TTimeHelper::showTime($row['create_time']);
    ?>
</td>
	    		<td><?php 
    echo $row['posts'];
    ?>
Example #4
0
    </div>
   	<div class="tbox">
		<div class="floatl">
			<?php 
echo Html::a('发帖', ['new-thread', 'boardid' => $currentBoard['id']], ['class' => 'btn btn-success']);
?>
		</div>
		<div class="floatr">
			<?php 
echo LinkPager::widget(['pagination' => $pages]);
?>
		</div>
	</div>
   <div class="tbox">
       <?php 
$form = ActiveForm::begin(['id' => 'newPost', 'action' => YiiForum::getHomeUrl() . '?r=thread/new-post&threadid=' . $thread['id']]);
?>
	
			<input type="hidden" id="post-board_id" name="Post[board_id]" value="<?php 
echo $currentBoard['id'];
?>
"/>
	    	<input type="hidden" id="post-thread_id" name="Post[thread_id]" value="<?php 
echo $thread['id'];
?>
"/>
	    	<input type="hidden" id="post-thread_title" name="Post[thread_title]" value="<?php 
echo $thread['title'];
?>
"/>