@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_left', //钩子
|
||||
'name' => '最新帖子列表',
|
||||
'version' => '1.0',
|
||||
'desc' => '最新帖子列表',
|
||||
'url' => 'http://www.thinksaas.cn',
|
||||
'email' => 'thinksaas@qq.com',
|
||||
'author' => '邱君',
|
||||
'author_url' => 'http://www.thinksaas.cn',
|
||||
'isedit' => '0',
|
||||
);
|
||||
@@ -0,0 +1,56 @@
|
||||
<div class="card">
|
||||
<div class="card-header">最新话题</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="topic_list">
|
||||
<div class="mt-3">{$pageUrl}</div>
|
||||
<ul>
|
||||
{loop $arrTopic $key $item}
|
||||
<li>
|
||||
<div class="userimg"><a href="{tsUrl('user','space',array('id'=>$item[user][userid]))}"><img class="rounded-circle" src="{$item[user][face]}" width="32" height="32" alt="{$item['user']['username']}" title="{$item['user']['username']}" /></a></div>
|
||||
|
||||
<div class="topic_title">
|
||||
<div class="title">
|
||||
|
||||
{if $item['label']}<span class="badge badge-danger fw300">{tsTitle($item['label'])}</span>{/if}
|
||||
|
||||
<a href="{tsUrl('group','topic',array('id'=>$item[topicid]))}">{$item[title]}</a>
|
||||
</div>
|
||||
|
||||
<div class="d-flex c9 fs12">
|
||||
<div><i class="far fa-comment-dots"></i> {$item['count_comment']}</div>
|
||||
<div class="ml-3"><i class="far fa-eye"></i> {$item['count_view']}</div>
|
||||
</div>
|
||||
|
||||
<div class="gaiyao">
|
||||
{$item['gaiyao']}
|
||||
</div>
|
||||
{if $item['photos']}
|
||||
<div class="photo">
|
||||
{loop $item['photos'] $pkey $pitem}
|
||||
<a href="{tsUrl('group','topic',array('id'=>$item[topicid]))}"><img src="{$pitem}" /></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="topic_info">
|
||||
<span class="float-left">
|
||||
<a class="c9" href="{tsUrl('group','show',array('id'=>$item[groupid]))}">[{$item[group][groupname]}]</a>
|
||||
</span>
|
||||
|
||||
<span class="float-right">
|
||||
{php echo getTime($item[uptime],time())}
|
||||
<a class="text-secondary" href="{tsUrl('user','space',array('id'=>$item[userid]))}">{$item[user][username]}</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
<div class="mt-3">{$pageUrl}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function newtopic(){
|
||||
global $db;
|
||||
//这里不应该显示最新帖子,这里应该显示干货好让,蜘蛛爬
|
||||
$page = isset($_GET['newtopic_page']) ? intval($_GET['newtopic_page']) : 1;
|
||||
$url = SITE_URL.'index.php?newtopic_page=';
|
||||
$lstart = $page*20-20;
|
||||
$topicNum = aac('group')->findCount('group_topic');
|
||||
$pageUrl = pagination($topicNum, 20, $page, $url);
|
||||
$arrTopic = aac('group')->findAll('group_topic',array(
|
||||
'isaudit'=>0,
|
||||
),'addtime desc','topicid,userid,groupid,title,gaiyao,label,count_comment,count_view,uptime',$lstart.',20');
|
||||
|
||||
foreach($arrTopic as $key=>$item){
|
||||
$arrTopic[$key]['title']=tsTitle($item['title']);
|
||||
$arrTopic[$key]['gaiyao']=tsTitle($item['gaiyao']);
|
||||
$arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
$arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
|
||||
$arrTopic[$key]['photos'] = aac('group')->getTopicPhoto($item['topicid'],3);
|
||||
}
|
||||
|
||||
include template('newtopic','newtopic');
|
||||
|
||||
}
|
||||
|
||||
function newtopic_css(){
|
||||
|
||||
echo '<link href="'.SITE_URL.'plugins/home/newtopic/style.css?v=201812251839" rel="stylesheet" type="text/css" />';
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_left','newtopic');
|
||||
addAction('pub_header_top','newtopic_css');
|
||||
@@ -0,0 +1,34 @@
|
||||
/*帖子列表*/
|
||||
.topic_list{overflow:hidden;}
|
||||
.topic_list ul, .topic_list ul li{list-style: none;margin:0;padding:0;}
|
||||
.topic_list ul{overflow:hidden;}
|
||||
.topic_list ul li{overflow:hidden;padding:15px 0;display: block;border-bottom: 1px dashed #999999;}
|
||||
|
||||
.topic_list ul li .other{background: none repeat scroll 0 0 #F8F8F8;
|
||||
border-left: 3px solid #EEEEEE;
|
||||
margin-left: 38px;
|
||||
margin-top: 5px;
|
||||
padding: 5px;}
|
||||
.topic_list ul li .other p{margin:0px;padding:5px 0;}
|
||||
|
||||
.topic_list .userimg{float:left;width:38px;overflow:hidden;}
|
||||
|
||||
.topic_list .topic_title{margin-left:40px;overflow:hidden;}
|
||||
|
||||
.topic_list .topic_title .title a{color:#343434;font-size:14px;}
|
||||
|
||||
.topic_list .topic_title .gaiyao{color:#999999;}
|
||||
|
||||
.topic_list .topic_title .photo{}
|
||||
.topic_list .topic_title .photo img{max-width: 25%;margin-right: 10px;}
|
||||
|
||||
.topic_list .topic_info{overflow: hidden;font-size:12px;color:#999999;}
|
||||
|
||||
.rank {
|
||||
background: none repeat scroll 0 0 #BBBBBB;
|
||||
height: 15px;
|
||||
line-height: 15px;
|
||||
margin: 0 0 0 5px;
|
||||
padding: 0 3px;
|
||||
border-radius:5px 5px 5px 5px;
|
||||
}
|
||||
Reference in New Issue
Block a user