演示图片
使用方法
第一步:打开你的全局css 一般都是main.css 下面代码扔进去就行
```.new-content {margin-top: 5px;} .tpt-wp{margin:0 auto;width:100%;margin-bottom: 10px;}.tpt-cm{color: #333;text-align: center;background: #FFF;height: 60px;line-height: 60px; border: 1px solid #eaeaea;}.tpt-md-4{float:left}.tpt-md-3{float:left}.tpt-md-2{float:left}.tpt-md-1{width:100%} @media only screen and (max-width:767px){.tpt-md-4{width:50%}.tpt-md-3{width:100%}.tpt-md-2{width:100%}.tpt-ml-3{display:none}.tpt-mr-3{display:none}.tpt-ml-7{width:100%}.tpt-mr-7{width:100%}} @media only screen and (min-width:768px) and (max-width:1023px){.tpt-md-4{width:50%}.tpt-md-3{width:50%}.tpt-md-2{width:50%}.tpt-ml-3{display:none}.tpt-mr-3{display:none}.tpt-ml-7{width:100%}.tpt-mr-7{width:100%}} @media only screen and (min-width:1024px) and (max-width:1199px){.tpt-md-4{width:33.33333333%}.tpt-md-3{width:33.33333333%}.tpt-md-2{width:50%}.tpt-ml-3{float:left;width:30%}.tpt-mr-3{float:right;width:30%}.tpt-ml-7{float:left;width:70%}.tpt-mr-7{float:right;width:70%}} @media only screen and (min-width:1200px){.tpt-md-4{width:25%}.tpt-md-3{width:33.33333333%}.tpt-md-2{width:50%}.tpt-ml-3{float:left;width:30%}.tpt-mr-3{float:right;width:30%}.tpt-ml-7{float:left;width:70%}.tpt-mr-7{float:right;width:70%}.tpt-wp{width:100%;margin:0 auto;;margin-bottom: 10px;}}```第二步:打开你的首页模板位置 一般为log_list.php 下面代码扔进去
例如:
```data = $db->once_fetch_array('SELECT COUNT(*) AS total FROM ' . DB_PREFIX . 'comment'); $log_com = $data['total']; $data = $db->once_fetch_array('SELECT COUNT(*) AS total FROM ' . DB_PREFIX . 'blog WHERE type = \'blog\''); $log_total = $data['total']; $data = $db->once_fetch_array('SELECT COUNT(*) AS total FROM ' . DB_PREFIX . 'user'); $count_user = $data['total']; $sql = 'SELECT * FROM ' . DB_PREFIX . 'blog WHERE type=\'blog\' ORDER BY date DESC LIMIT 0,1'; $res = $db->query($sql); $row = $db->fetch_array($res); $date = date('n月j日', $row['date']);```第三步:打开你的log_list.php 然后想加那就加那
```<div class="tpt-wp cl"> <ul> <li class="tpt-md-4"><div class="tpt-cm"> <i class="fa fa-folder-open-o" style="font-size: 20px; color: #e4ad85;vertical-align: middle; margin: 0px 3px;"></i>资源主题 <font color="#03f"><?php echo $log_total;?></font> 篇</div> </li> <li class="tpt-md-4"><div class="tpt-cm"> <i class="fa fa-commenting-o" style="font-size: 20px; color: #27c24c;vertical-align: middle; margin: 0px 3px;"></i>评论回复 <font color="#03f"><?php echo $log_com;?></font> 次</div> </li> <li class="tpt-md-4"><div class="tpt-cm"> <i class="fa fa-user-o" style="font-size: 20px; color: #23b7e5;vertical-align: middle; margin: 0px 3px;"></i>网站用户 <font color="#03f"><?php echo $count_user;?> </font>位</div> </li> <li class="tpt-md-4"><div class="tpt-cm"> <i class="fa fa-history" style="font-size: 20px; color: #7266ba;vertical-align: middle; margin: 0px 3px;"></i>最后更新 <font color="#ff0000"><?php echo $date;?></font></a></div> </li> </ul> </div>```
请登录后发表评论
注册
请登录后查看评论内容