Browse Source

show stats in index page

master
filesite 7 months ago
parent
commit
e9e8ebd395
  1. 4
      themes/tajian/controller/SiteController.php
  2. 16
      themes/tajian/views/site/tajian.php
  3. 9
      www/css/tajian.css

4
themes/tajian/controller/SiteController.php

@ -93,10 +93,12 @@ Class SiteController extends Controller { @@ -93,10 +93,12 @@ Class SiteController extends Controller {
protected function renderTajianIndex() {
$pageTitle = "Ta荐:好用的视频收藏夹,帮你整理不同平台的好视频,轻松分享给朋友!";
$stats = TajianStats::init();
$this->layout = 'index';
$viewName = 'tajian';
$params = compact(
'pageTitle'
'pageTitle', 'stats'
);
return $this->render($viewName, $params, $pageTitle);
}

16
themes/tajian/views/site/tajian.php

@ -60,4 +60,20 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use @@ -60,4 +60,20 @@ if (!empty(FSC::$app['config']['multipleUserUriParse']) && !empty(FSC::$app['use
</ul>
<p class="pl20 pt20">其它App和网站将陆续增加。。。</p>
<h3 class="h3title pl20">统计数据</h3>
<div class="stats pl20">
<span class="col success">
<strong><?=$viewData['stats']['video']?></strong>
<label>视频</label>
</span>
<span class="col info">
<strong><?=$viewData['stats']['user']?></strong>
<label>用户</label>
</span>
<span class="col">
<strong><?=$viewData['stats']['tag']?></strong>
<label>分类</label>
</span>
</div>
</main>

9
www/css/tajian.css

@ -252,6 +252,15 @@ a:link{text-decoration:none;} @@ -252,6 +252,15 @@ a:link{text-decoration:none;}
.btn-primary:hover,.btn-danger:hover{font-weight:500}
.bi{width:1em;height:1em;display:inline-block;vertical-align:-.125em;fill:currentcolor}
.stats{background-color:#EEE;padding:10px 10px 4px 10px}
.stats .col{display:inline-block;padding:13px 4px;width:30%;background:#444;color:#FFF;margin-right:4px;margin-bottom:6px;text-align:center}
.stats .col strong{font-size:28px}
.stats .col label{display:block;font-size:15px}
.stats .info{background-color:darkblue}
.stats .success{background-color:green}
.stats .warning{background-color:orange;color:#444}
.stats .danger{background-color:red}
/* 注册/登录 */
.twocol label{display:block}
.twocol input{width:62%}

Loading…
Cancel
Save