@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_right', //钩子
|
||||
'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,16 @@
|
||||
<div class="card">
|
||||
<div class="card-header">最新文章</div>
|
||||
<div class="card-body">
|
||||
{if $arrArticle}
|
||||
<div class="commlist">
|
||||
<ul>
|
||||
{loop $arrArticle $key $item}
|
||||
<li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
{else}
|
||||
<div class="c9">暂无文章</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function article(){
|
||||
|
||||
$arrArticle = aac('article')->findAll('article',array(
|
||||
'isaudit'=>0
|
||||
),'addtime desc','articleid,cateid,userid,title,gaiyao,path,photo,count_view,count_comment,addtime',10);
|
||||
foreach($arrArticle as $key=>$item){
|
||||
$arrArticle[$key]['title'] = tsTitle($item['title']);
|
||||
$arrArticle[$key]['content'] = tsDecode($item['content']);
|
||||
$arrArticle[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
if($item['cateid']){
|
||||
$arrArticle[$key]['cate'] = aac('article')->find('article_cate',array(
|
||||
'cateid'=>$item['cateid'],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
include template('article','article');
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_right','article');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_footer', //钩子
|
||||
'name' => '友链',
|
||||
'version' => '1.0',
|
||||
'desc' => '友链',
|
||||
'url' => 'https://lmve.net',
|
||||
'email' => '1337087466@qq.com',
|
||||
'author' => '无闻风',
|
||||
'author_url' => 'https://lmve.net',
|
||||
'isedit' => '0',
|
||||
);
|
||||
@@ -0,0 +1,22 @@
|
||||
<div class="card">
|
||||
<div class="card-header">友情链接<a href="{SITE_URL}index.php?app=friendlinks&ac=create" title="">|友链申请|</a></div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="facelist">
|
||||
<ul>
|
||||
{loop $friends $key $item}
|
||||
<li>
|
||||
{if $item['face']}
|
||||
<a href="{$item['path']}"><img class="" src="{$item['face']}" alt="{$item['name']}" width="48" height="48" /></a>
|
||||
{else}
|
||||
<a href="{$item['path']}"><img class="" src="{SITE_URL}public/images/user_large.jpg" alt="{$item['name']} " width="48" height="48" /></a>
|
||||
{/if}
|
||||
<div class="username">
|
||||
<a href="{$item['path']}" title="{$item['path']}">{$item['name']}</a>
|
||||
</div>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php defined('IN_TS') or die('Access Denied.');
|
||||
function friendlinks(){
|
||||
$friends=aac('friendlinks')->getfriends(20);
|
||||
include template('friendlinks','friendlinks');
|
||||
}
|
||||
addAction('home_index_footer','friendlinks');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//首页热门话题列表
|
||||
return array(
|
||||
'hook'=>'home_index_right', //钩子
|
||||
'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,24 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
function hottopic(){
|
||||
|
||||
$arrHotTopics = aac('group')->findAll('group_topic',array(
|
||||
'isaudit'=>0,
|
||||
),'count_comment desc,count_view desc,isrecommend desc,addtime desc','topicid,title',25);
|
||||
|
||||
echo '<div class="card">';
|
||||
echo '<div class="card-header">推荐话题</div>';
|
||||
echo '<div class="card-body">';
|
||||
echo '<div class="commlist">';
|
||||
echo '<ul>';
|
||||
foreach($arrHotTopics as $key=>$item){
|
||||
echo '<li><a href="'.tsUrl('group','topic',array('id'=>$item['topicid'])).'">'.tsTitle($item['title']).'</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_right','hottopic');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_footer', //钩子
|
||||
'name' => '友情连接插件',
|
||||
'version' => '1.0',
|
||||
'desc' => '开启友情连接插件后,将在首页显示友情链接',
|
||||
'url' => 'http://www.thinksaas.cn',
|
||||
'email' => 'thinksaas@qq.com',
|
||||
'author' => '邱君',
|
||||
'author_url' => 'http://www.thinksaas.cn',
|
||||
'isedit' => '1',
|
||||
);
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//插件编辑
|
||||
switch($ts){
|
||||
case "set":
|
||||
|
||||
$strAbout = fileRead('plugins/home/links/about.php');
|
||||
|
||||
$arrLink = fileRead('data/plugins_home_links.php');
|
||||
if($arrLink==''){
|
||||
$arrLink = $tsMySqlCache->get('plugins_home_links');
|
||||
}
|
||||
|
||||
include template('edit_set','links');
|
||||
break;
|
||||
|
||||
case "do":
|
||||
$arrLinkName = $_POST['linkname'];
|
||||
$arrLinkUrl = $_POST['linkurl'];
|
||||
|
||||
foreach($arrLinkName as $key=>$item){
|
||||
$linkname = tsTrim($item);
|
||||
$linkurl = tsTrim($arrLinkUrl[$key]);
|
||||
if($linkname && $linkurl){
|
||||
$arrLink[] = array(
|
||||
'linkname' => $linkname,
|
||||
'linkurl' => $linkurl,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fileWrite('plugins_home_links.php','data',$arrLink);
|
||||
$tsMySqlCache->set('plugins_home_links',$arrLink);
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=links&in=edit&ts=set');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<script>
|
||||
function insertMenu(){
|
||||
$("#before").before('<tr><td><input name="linkname[]" /></td><td><input name="linkurl[]" style="width:350px;" /></td></tr>');
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include pubTemplate("plugin_menu")}
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=home&ac=plugin&plugin=links&in=edit&ts=do">
|
||||
<table class="table table-hover">
|
||||
<tr><td>链接名字</td><td>链接URL</td></tr>
|
||||
{loop $arrLink $key $item}
|
||||
<tr><td><input name="linkname[]" value="{$item['linkname']}" /></td><td><input name="linkurl[]" style="width:350px;" value="{$item['linkurl']}" /></td></tr>
|
||||
{/loop}
|
||||
|
||||
<tr id="before"><td><input type="submit" value="提 交" /></td><td><a href="javascript:void('0');" onclick="insertMenu();">点我增加链接</a>(说明:如需删除某一项,请将要删除的某项清空提交即可。)</td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,10 @@
|
||||
<div class="card">
|
||||
<div class="card-header">友情链接</div>
|
||||
<div class="card-body">
|
||||
{if $arrLink}
|
||||
{loop $arrLink $key $item}
|
||||
<a class="fs14 mr-3" target="_blank" href="{$item['linkurl']}">{$item['linkname']}</a>
|
||||
{/loop}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//友情连接插件
|
||||
|
||||
function links(){
|
||||
global $tsMySqlCache;
|
||||
$arrLink = fileRead('data/plugins_home_links.php');
|
||||
if($arrLink==''){
|
||||
$arrLink = $tsMySqlCache->get('plugins_home_links');
|
||||
}
|
||||
|
||||
include template('links','links');
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_footer','links');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_right', //钩子
|
||||
'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,186 @@
|
||||
{if $TS_USER['userid']}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="facebox">
|
||||
<div class="face">
|
||||
<a href="{tsUrl('user','space',array('id'=>$strUser['userid']))}"><img class="rounded-circle" title="{$strUser[username]}" alt="{$strUser[username]}" src="{$strUser[face]}" width="36"></a>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
{$strUser[username]}
|
||||
<div>
|
||||
|
||||
|
||||
<a class="fs12 text-info" href="{tsUrl('user','space',array('id'=>$strUser['userid']))}"><i class="bi bi-person-bounding-box"></i> 访问我的空间</a>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<ul class="other">
|
||||
<li class="br"><span class="fs14"><a href="{tsUrl('user','group',array('id'=>$strUser['userid']))}">{$strUser['count_group']}</a></span><br />小组</li>
|
||||
<li class="br"><span class="fs14"><a href="{tsUrl('user','topic',array('id'=>$strUser['userid']))}">{$strUser['count_topic']}</a></span><br />帖子</li>
|
||||
<li class="br"><span class="fs14"><a href="{tsUrl('user','followed',array('id'=>$strUser['userid']))}">{$strUser['count_followed']}</a></span><br />粉丝</li>
|
||||
<li><span class="fs14"><a href="{tsUrl('user','follow',array('id'=>$strUser['userid']))}">{$strUser['count_follow']}</a></span><br />关注</li>
|
||||
</ul>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div class="fmore">
|
||||
|
||||
<a href="{tsUrl('user','verify')}">{if $strUser['isverify']==1}<img src="{SITE_URL}public/images/rz1.png" width="20" alt="通过Email认证" title="通过Email认证" align="absmiddle" />{else}<img src="{SITE_URL}public/images/rz2.png" width="20" alt="未通过Email认证" title="未通过Email认证" align="absmiddle" />{/if}</a>
|
||||
|
||||
{if $strUser['isrenzheng']==1}
|
||||
<img src="{SITE_URL}public/images/renzheng1.png" width="20" height="20" alt="通过人工认证" title="通过人工认证" />
|
||||
{else}
|
||||
<img src="{SITE_URL}public/images/renzheng2.png" width="20" height="20" alt="未通过人工认证" title="未通过人工认证" />
|
||||
{/if}
|
||||
|
||||
<br />
|
||||
角色:<a href="{tsUrl('user','role')}">{$strUser['rolename']}</a> <span style="padding-left:30px;">积分:<a href="{tsUrl('my','score')}">{$strUser['count_score']}</a></span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
<a class="btn btn-block btn-info btn-lg" href="{tsUrl('topic','group')}"><i class="bi bi-chat-square-text"></i> 我要发贴</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{else}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="login">
|
||||
<div>
|
||||
|
||||
<legend>登录</legend>
|
||||
<div class="form-group">
|
||||
<label>账号:</label>
|
||||
<br />
|
||||
<input class="form-control" type="text" name="email" placeholder="Email/手机号">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>密码:</label>
|
||||
<br />
|
||||
<input class="form-control" type="password" name="pwd">
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden" name="cktime" value="2592000" />
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
<button id="comm-submit" type="button" class="btn btn-sm btn-info">登 录</button>
|
||||
|
||||
<a class="btn btn-sm text-black-50" href="{tsUrl('user','register')}">还没有注册?</a>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tac lh30">
|
||||
{php doAction('home_login')}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--{if $TS_SITE['is_vaptcha']}-->
|
||||
<script src="https://v.vaptcha.com/v3.js"></script>
|
||||
<script>
|
||||
vaptcha({
|
||||
vid: '{$TS_SITE[vaptcha_vid]}',// 验证单元id
|
||||
mode: 'invisible',// 显示类型 隐藏式
|
||||
scene: 0,// 场景值 默认0
|
||||
area: 'auto' //验证节点区域,默认 auto,可选值 auto,sea,na,cn
|
||||
}).then(function (vaptchaObj) {
|
||||
|
||||
obj = vaptchaObj; //将VAPTCHA验证实例保存到局部变量中
|
||||
|
||||
vaptchaObj.listen("pass", function () {
|
||||
// 验证成功进行后续操作
|
||||
var email = $("input[name='email']").val();
|
||||
var pwd = $("input[name='pwd']").val();
|
||||
var cktime = $("input[name='cktime']").val();
|
||||
var jump = $("input[name='jump']").val();
|
||||
var token = $("input[name='token']").val();
|
||||
|
||||
serverToken = vaptchaObj.getServerToken()
|
||||
|
||||
var data = {
|
||||
email:email,
|
||||
pwd:pwd,
|
||||
cktime:cktime,
|
||||
jump:jump,
|
||||
token:token,
|
||||
vaptcha_token: serverToken.token,
|
||||
vaptcha_server: serverToken.server,
|
||||
};
|
||||
tsPost('index.php?app=user&ac=login&ts=do&js=1',data)
|
||||
vaptchaObj.reset(); //重置验证码
|
||||
|
||||
});
|
||||
|
||||
//关闭验证弹窗时触发
|
||||
vaptchaObj.listen("close", function () {
|
||||
//验证弹窗关闭触发
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
$("#comm-submit").on("click", function () {
|
||||
|
||||
var email = $("input[name='email']").val();
|
||||
var pwd = $("input[name='pwd']").val();
|
||||
|
||||
if(email && pwd){
|
||||
//人机验证
|
||||
obj.validate();
|
||||
}else{
|
||||
tsNotice('账号和密码必须输入!');
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--{else}-->
|
||||
|
||||
<script>
|
||||
$("#comm-submit").on("click", function () {
|
||||
var email = $("input[name='email']").val();
|
||||
var pwd = $("input[name='pwd']").val();
|
||||
var cktime = $("input[name='cktime']").val();
|
||||
var jump = $("input[name='jump']").val();
|
||||
var token = $("input[name='token']").val();
|
||||
|
||||
if(email && pwd){
|
||||
var data = {
|
||||
email:email,
|
||||
pwd:pwd,
|
||||
cktime:cktime,
|
||||
jump:jump,
|
||||
token:token,
|
||||
};
|
||||
tsPost('index.php?app=user&ac=login&ts=do&js=1',data)
|
||||
}else{
|
||||
tsNotice('账号和密码必须输入!');
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--{/if}-->
|
||||
|
||||
|
||||
|
||||
{/if}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//首页登录框
|
||||
function login(){
|
||||
global $TS_USER,$TS_SITE;
|
||||
|
||||
if($TS_USER['userid']){
|
||||
$strUser = aac('user')->getOneUser($TS_USER['userid']);
|
||||
$strUser['rolename'] = aac('user')->getRole($strUser['count_score']);
|
||||
}
|
||||
|
||||
include template('login','login');
|
||||
}
|
||||
|
||||
function login_css(){
|
||||
|
||||
echo '<link href="'.SITE_URL.'plugins/home/login/style.css" rel="stylesheet" type="text/css" />';
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_right','login');
|
||||
addAction('pub_header_top','login_css');
|
||||
@@ -0,0 +1,47 @@
|
||||
.login {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
legend {
|
||||
display: none;
|
||||
}
|
||||
fieldset {
|
||||
border: 0 none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
fieldset legend {
|
||||
color: #666666;
|
||||
padding: 0 5px;
|
||||
}
|
||||
.login .item {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.item label {
|
||||
width: 4em;
|
||||
}
|
||||
label {
|
||||
font-family: Tahoma;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.item input {
|
||||
width: 80%;
|
||||
height:30px;
|
||||
line-height:30px;
|
||||
font-size:14px;
|
||||
}
|
||||
.login .item a {
|
||||
font-size: 12px;
|
||||
}
|
||||
.login .item1 {
|
||||
color: #666666;
|
||||
float: left;
|
||||
font-size: 12px;
|
||||
margin: 0 2px 0px 0;
|
||||
}
|
||||
.login .item1 label {
|
||||
display: inline-block;
|
||||
margin-left: 4.5em;
|
||||
margin-top: 4px;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//最新创建小组
|
||||
return array(
|
||||
'hook'=>'home_index_right', //钩子
|
||||
'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,20 @@
|
||||
<div class="card">
|
||||
<div class="card-header">最新创建小组</div>
|
||||
<div class="card-body">
|
||||
|
||||
{if $arrNewGroup}
|
||||
<div class="commlist">
|
||||
<ul>
|
||||
{loop $arrNewGroup $key $item}
|
||||
<li><a href="{tsUrl('group','show',array('id'=>$item['groupid']))}">{tsTitle($item['groupname'])}</a></li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无小组</div>
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function newgroup(){
|
||||
$arrNewGroup = aac('group')->findAll('group',array(
|
||||
'isaudit'=>0,
|
||||
),'addtime desc','groupid,groupname',10);
|
||||
|
||||
include template('newgroup','newgroup');
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_right','newgroup');
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_footer', //钩子
|
||||
'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,32 @@
|
||||
<div class="card">
|
||||
<div class="card-header">推荐相册
|
||||
<small class="float-right"><a class="text-black-50" href="{tsUrl('photo')}">更多</a></small>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
{if $arrAlbum}
|
||||
<div class="photoalbumlist">
|
||||
<div class="row">
|
||||
{loop $arrAlbum $key $item}
|
||||
<div class="col-6 col-md-2">
|
||||
<a href="{tsUrl('photo','album',array('id'=>$item[albumid]))}" class="thumbnail">
|
||||
<img class="rounded mw100" src="{if $item[albumface] == ''}{SITE_URL}app/photo/skins/default/photo_album.png{else}{php echo tsXimg($item[albumface],'photo',320,'320',$item[path],1)}{/if}" alt="{$item['albumname']}">
|
||||
</a>
|
||||
<div class="mt-1 title-cut"><a href="{tsUrl('photo','album',array('id'=>$item[albumid]))}">{$item['albumname']}</a></div>
|
||||
<div class="fs12 text-black-50">{$item['count_photo']} 张图片</div>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无推荐相册</div>
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//相册
|
||||
function photo(){
|
||||
|
||||
$arrAlbum = aac('photo')->findAll('photo_album',array(
|
||||
'isrecommend'=>1,
|
||||
),'addtime desc',null,12);
|
||||
foreach($arrAlbum as $key=>$item){
|
||||
$arrAlbum[$key]['albumname']=tsTitle($item['albumname']);
|
||||
}
|
||||
|
||||
include template('photo','photo');
|
||||
|
||||
}
|
||||
|
||||
function photo_css(){
|
||||
|
||||
echo '<link href="'.SITE_URL.'plugins/home/photo/style.css" rel="stylesheet" type="text/css" />';
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_footer','photo');
|
||||
addAction('pub_header_top','photo_css');
|
||||
@@ -0,0 +1,5 @@
|
||||
.photoalbumlist{}
|
||||
.photoalbumlist ul{}
|
||||
.photoalbumlist ul li{float:left;border:solid 1px #DDDDDD;margin:0 7px 7px 7px;height:220px;}
|
||||
.photoalbumlist ul li .info{padding:5px;}
|
||||
.photoalbumlist ul li .info p{color:#999999;margin:0px;}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_left', //钩子
|
||||
'name' => '首页推荐文章',
|
||||
'version' => '1.0',
|
||||
'desc' => '首页推荐文章',
|
||||
'url' => 'https://www.thinksaas.cn',
|
||||
'email' => 'thinksaas@qq.com',
|
||||
'author' => '邱君',
|
||||
'author_url' => 'https://www.thinksaas.cn',
|
||||
'isedit' => '1',
|
||||
);
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//插件编辑
|
||||
switch($ts){
|
||||
case "set":
|
||||
|
||||
$strAbout = fileRead('plugins/home/recommendarticle/about.php');
|
||||
|
||||
$strData = fileRead('data/plugins_home_recommendarticle.php');
|
||||
if($strData==''){
|
||||
$strData = $GLOBALS['tsMySqlCache']->get('plugins_home_recommendarticle');
|
||||
}
|
||||
|
||||
include template('edit_set','recommendarticle');
|
||||
break;
|
||||
|
||||
case "do":
|
||||
$isrecommend = intval($_POST['isrecommend']);
|
||||
|
||||
$strData = array(
|
||||
'isrecommend'=>$isrecommend,
|
||||
);
|
||||
|
||||
fileWrite('plugins_home_recommendarticle.php','data',$strData);
|
||||
$tsMySqlCache->set('plugins_home_recommendarticle',$strData);
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=recommendarticle&in=edit&ts=set');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include pubTemplate("plugin_menu")}
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=home&ac=plugin&plugin=recommendarticle&in=edit&ts=do">
|
||||
<table class="table table-hover">
|
||||
|
||||
<tr><td>内容获取方式:</td><td>
|
||||
|
||||
<input type="radio" name="isrecommend" value="0" {if $strData['isrecommend']==0}checked{/if}> 最新内容
|
||||
<input type="radio" name="isrecommend" value="1" {if $strData['isrecommend']==1}checked{/if}> 推荐内容
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td></td><td><input type="submit" value="提交修改" /></td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,104 @@
|
||||
<div class="card">
|
||||
<div class="card-header">推荐文章</div>
|
||||
<div class="card-body">
|
||||
|
||||
{if $arrArticle}
|
||||
{loop $arrArticle $key $item}
|
||||
{if $item['photo']}
|
||||
<div class="row border-bottom mb-3 pb-3">
|
||||
|
||||
<div class="col-md-4">
|
||||
<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">
|
||||
<img class="mw-100" src="{$item['photo_url']}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
|
||||
<div class="fs18 font-weight-bold">
|
||||
<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a>
|
||||
{if $item['istop']=='1'}
|
||||
<img src="{SITE_URL}public/images/ding.png" width="24" height="24" title="[置顶]" alt="[置顶]" />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="fs12 text-black-50"><a class="text-black-50" href="{tsUrl('user','space',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a> 发表于 {$item['addtime']}</div>
|
||||
|
||||
<div class="text-black-50 mt-1">{if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">查看全文</a>)</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="of c9 mt-3 fs12">
|
||||
|
||||
<div class="float-left">
|
||||
分类:<a href="{tsUrl('article','cate',array('id'=>$item['cate']['cateid']))}">{$item['cate']['catename']}</a>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
|
||||
<i class="bi bi-eye"></i> {$item['count_view']}
|
||||
<i class="bi bi-chat-text ml-3"></i> {$item['count_comment']}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{else}
|
||||
|
||||
<div class="fs18 font-weight-bold">
|
||||
<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a>
|
||||
{if $item['istop']=='1'}
|
||||
<img src="{SITE_URL}public/images/ding.png" width="24" height="24" title="[置顶]" alt="[置顶]" />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="fs12 text-black-50"><a class="text-black-50" href="{tsUrl('user','space',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a> 发表于 {$item['addtime']}</div>
|
||||
|
||||
{if $item['score']==0}
|
||||
<div class="text-black-50 mt-1">{if $item['gaiyao']}{$item['gaiyao']}{else}暂无概要{/if} (<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">查看全文</a>)</div>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="of c9 mt-3 fs12 mb-3 border-bottom pb-3">
|
||||
|
||||
<div class="float-left">
|
||||
分类:<a href="{tsUrl('article','cate',array('id'=>$item['cate']['cateid']))}">{$item['cate']['catename']}</a>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
|
||||
<i class="bi bi-eye"></i> {$item['count_view']}
|
||||
<i class="bi bi-chat-text ml-3"></i> {$item['count_comment']}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{/loop}
|
||||
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无推荐文章</div>
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function recommendarticle(){
|
||||
|
||||
$strData = fileRead('data/plugins_home_recommendarticle.php');
|
||||
if($strData==''){
|
||||
$strData = $GLOBALS['tsMySqlCache']->get('plugins_home_recommendarticle');
|
||||
}
|
||||
|
||||
if($strData['isrecommend']==1){
|
||||
$where = array(
|
||||
'isrecommend'=>1,
|
||||
'isaudit'=>0
|
||||
);
|
||||
}else{
|
||||
$where = array(
|
||||
'isaudit'=>0
|
||||
);
|
||||
}
|
||||
|
||||
$arrArticle = aac('article')->findAll('article',$where,'istop desc,addtime desc','articleid,cateid,userid,title,gaiyao,path,photo,count_view,count_comment,istop,addtime,uptime',10);
|
||||
foreach($arrArticle as $key=>$item){
|
||||
$arrArticle[$key]['title'] = tsTitle($item['title']);
|
||||
$arrArticle[$key]['gaiyao'] = tsTitle($item['gaiyao']);
|
||||
$arrArticle[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
if($item['cateid']){
|
||||
$arrArticle[$key]['cate'] = aac('article')->find('article_cate',array(
|
||||
'cateid'=>$item['cateid'],
|
||||
));
|
||||
}
|
||||
|
||||
#封面图
|
||||
if($item['photo']){
|
||||
$arrArticle[$key]['photo_url'] = aac('article')->getArticlePhoto($item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
include template('recommendarticle','recommendarticle');
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_left','recommendarticle');
|
||||
@@ -0,0 +1,13 @@
|
||||
<?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,28 @@
|
||||
<div class="card">
|
||||
<div class="card-header">推荐小组</div>
|
||||
<div class="card-body">
|
||||
{if $arrRecommendGroup}
|
||||
<div class="row">
|
||||
{loop $arrRecommendGroup $key $item}
|
||||
<div class="col-md-6">
|
||||
<div class="sub-item">
|
||||
<div class="pic">
|
||||
<a href="{tsUrl('group','show',array('id'=>$item['groupid']))}">
|
||||
<img class="rounded" src="{$item['photo']}" alt="{$item['groupname']}" title="{$item['groupname']}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="info">
|
||||
<a class="font-weight-bold" href="{tsUrl('group','show',array('id'=>$item['groupid']))}">{$item['groupname']}</a> <span class="fs12 c9">{$item['count_user']} 成员</span>
|
||||
<div class="content">{php echo cututf8(t($item['groupdesc']),0,43,false)}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无推荐小组</div>
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//推荐小组
|
||||
function recommendgroup(){
|
||||
$arrRecommendGroup = aac('group')->getRecommendGroup('12');
|
||||
include template('recommendgroup','recommendgroup');
|
||||
}
|
||||
function recommendgroup_css(){
|
||||
echo '<link href="'.SITE_URL.'plugins/home/recommendgroup/style.css" rel="stylesheet" type="text/css" />';
|
||||
}
|
||||
addAction('home_index_left','recommendgroup');
|
||||
addAction('pub_header_top','recommendgroup_css');
|
||||
@@ -0,0 +1,26 @@
|
||||
.sub-item{
|
||||
border-bottom: 1px dashed #AAAAAA;
|
||||
height: 72px;
|
||||
margin: 0 2px 15px 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.sub-item .pic {
|
||||
float: left;
|
||||
width: 48px;
|
||||
}
|
||||
.sub-item .info {
|
||||
color: #666666;
|
||||
vertical-align: top;
|
||||
word-wrap: break-word;
|
||||
margin-left:60px;
|
||||
}
|
||||
.sub-item .pic img {
|
||||
height: 48px;
|
||||
margin-bottom: -3px;
|
||||
width: 48px;
|
||||
}
|
||||
.sub-item .info .content{font-size:12px;}
|
||||
|
||||
.sub-item p {
|
||||
margin: 0;
|
||||
}
|
||||
@@ -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' => '1',
|
||||
);
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//插件编辑
|
||||
switch($ts){
|
||||
case "set":
|
||||
|
||||
$strAbout = fileRead('plugins/home/recommendtopic/about.php');
|
||||
|
||||
$strData = fileRead('data/plugins_home_recommendtopic.php');
|
||||
if($strData==''){
|
||||
$strData = $GLOBALS['tsMySqlCache']->get('plugins_home_recommendtopic');
|
||||
}
|
||||
|
||||
include template('edit_set','recommendtopic');
|
||||
break;
|
||||
|
||||
case "do":
|
||||
$isrecommend = intval($_POST['isrecommend']);
|
||||
|
||||
$strData = array(
|
||||
'isrecommend'=>$isrecommend,
|
||||
);
|
||||
|
||||
fileWrite('plugins_home_recommendtopic.php','data',$strData);
|
||||
$tsMySqlCache->set('plugins_home_recommendtopic',$strData);
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=recommendtopic&in=edit&ts=set');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include pubTemplate("plugin_menu")}
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=home&ac=plugin&plugin=recommendtopic&in=edit&ts=do">
|
||||
<table class="table table-hover">
|
||||
|
||||
<tr><td>内容获取方式:</td><td>
|
||||
|
||||
<input type="radio" name="isrecommend" value="0" {if $strData['isrecommend']==0}checked{/if}> 最新内容
|
||||
<input type="radio" name="isrecommend" value="1" {if $strData['isrecommend']==1}checked{/if}> 推荐内容
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td></td><td><input type="submit" value="提交修改" /></td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,86 @@
|
||||
<div class="card">
|
||||
<div class="card-header">推荐话题</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
{if $arrTopic}
|
||||
|
||||
<div class="topic_list">
|
||||
<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('topic','show',array('id'=>$item['topicid']))}">{$item[title]}</a>
|
||||
|
||||
{if $item['istop']=='1'}
|
||||
<img src="{SITE_URL}public/images/ding.png" width="24" height="24" title="[置顶]" alt="[置顶]" />
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
{if $item['group']['isopen']==0 && $item['score']==0 && $item['iscommentshow']==0}
|
||||
<div class="gaiyao mt-2">
|
||||
{$item['gaiyao']}
|
||||
</div>
|
||||
|
||||
<!--图片-->
|
||||
{if $item['ptable']=='' && $item['pjson']}
|
||||
<div class="photo mt-2">
|
||||
{loop $item['pjson'] $pkey $pitem}
|
||||
<a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}"><img src="{$pitem}" /></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!--视频-->
|
||||
{if $item['ptable']=='video' && $item['pjson']['siteid']==0}
|
||||
<div>
|
||||
{if $item['pjson']['photo']}
|
||||
<a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}"><img class="mw-100" src="{$item['pjson']['photo']}"></a>
|
||||
{else}
|
||||
<video class="mw-100" controls="controls" src="{$item['pjson']['video']}"></video>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="d-flex flex-row justify-content-between mt-2">
|
||||
<div class="d-flex fs12 c9">
|
||||
<a href="{tsUrl('user','space',array('id'=>$item['userid']))}">{$item['user']['username']}</a>
|
||||
<span class="ml-1">{php echo getTime($item['uptime'],time())}</span>
|
||||
<span class="ml-1 ts-hide">发表于</span>
|
||||
<a class="ml-1 ts-hide" href="{tsUrl('group','show',array('id'=>$item['groupid']))}">[{$item['group']['groupname']}]</a>
|
||||
</div>
|
||||
<div class="d-flex c9 fs12">
|
||||
<div><i class="bi-chat-text"></i> {$item['count_comment']}</div>
|
||||
<div class="ml-3"><i class="bi bi-eye"></i> {$item['count_view']}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无推荐话题</div>
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function recommendtopic(){
|
||||
|
||||
$strData = fileRead('data/plugins_home_recommendtopic.php');
|
||||
if($strData==''){
|
||||
$strData = $GLOBALS['tsMySqlCache']->get('plugins_home_recommendtopic');
|
||||
}
|
||||
|
||||
if($strData['isrecommend']==1){
|
||||
$where = array(
|
||||
'isrecommend'=>1,
|
||||
'isaudit'=>0
|
||||
);
|
||||
}else{
|
||||
$where = array(
|
||||
'isaudit'=>0
|
||||
);
|
||||
}
|
||||
|
||||
//推荐帖子
|
||||
$arrTopic = aac('group')->findAll('topic',$where,'istop desc,uptime desc','topicid,ptable,pkey,pid,pjson,userid,groupid,title,gaiyao,score,label,count_comment,count_view,iscommentshow,istop,uptime',35);
|
||||
|
||||
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']);
|
||||
#应用扩展
|
||||
if($item['pjson']){
|
||||
$arrTopic[$key]['pjson'] = json_decode($item['pjson'],true);
|
||||
}
|
||||
}
|
||||
|
||||
include template('recommendtopic','recommendtopic');
|
||||
|
||||
}
|
||||
|
||||
function recommendtopic_css(){
|
||||
|
||||
echo '<link href="'.SITE_URL.'plugins/home/recommendtopic/style.css?v=201812251839" rel="stylesheet" type="text/css" />';
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_left','recommendtopic');
|
||||
addAction('pub_header_top','recommendtopic_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{font-size:18px;font-weight: bold;}
|
||||
|
||||
.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;
|
||||
}
|
||||
@@ -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,17 @@
|
||||
<div class="card">
|
||||
<div class="card-header">最新签到用户</div>
|
||||
<div class="card-body">
|
||||
<div class="facelist">
|
||||
<ul>
|
||||
{loop $arrUser $key $item}
|
||||
<li>
|
||||
<a href="{tsUrl('user','space',array('id'=>$item['userid']))}"><img class="rounded-circle" src="{$item['face']}" alt="{$item['username']}" width="48" height="48" /></a>
|
||||
<div class="username">
|
||||
<a href="{tsUrl('user','space',array('id'=>$item['userid']))}" title="{$item['username']}">{$item['username']}</a>
|
||||
</div>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function signuser(){
|
||||
$arrUser = aac('user')->getHotUser(20);
|
||||
include template('signuser','signuser');
|
||||
}
|
||||
|
||||
addAction('home_index_left','signuser');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_header', //钩子
|
||||
'name' => '首页幻灯片',
|
||||
'version' => '1.0',
|
||||
'desc' => '首页幻灯片',
|
||||
'url' => 'http://www.thinksaas.cn',
|
||||
'email' => 'thinksaas@qq.com',
|
||||
'author' => '邱君',
|
||||
'author_url' => 'http://www.thinksaas.cn',
|
||||
'isedit' => '1',
|
||||
);
|
||||
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$strAbout = fileRead('plugins/home/slide/about.php');
|
||||
|
||||
//插件编辑
|
||||
switch($ts){
|
||||
case "set":
|
||||
|
||||
|
||||
|
||||
$arrSlide = $new[$app]->findAll('slide',null,'slideid asc');
|
||||
|
||||
foreach($arrSlide as $key=>$item){
|
||||
if($GLOBALS['TS_SITE']['file_upload_type']==1){
|
||||
$arrSlide[$key]['photo_url'] = $GLOBALS['TS_SITE']['alioss_bucket_url'].'/uploadfile/slide/'.$item['photo'].'?v='.$item['addtime'];
|
||||
}else{
|
||||
$arrSlide[$key]['photo_url'] = SITE_URL.'uploadfile/slide/'.$item['photo'].'?v='.$item['addtime'];
|
||||
}
|
||||
}
|
||||
|
||||
include template('edit_set','slide');
|
||||
break;
|
||||
|
||||
case "do":
|
||||
|
||||
|
||||
$typeid = intval($_POST['typeid']);
|
||||
$title = tsTrim($_POST['title']);
|
||||
$info = tsTrim($_POST['info']);
|
||||
$url = tsTrim($_POST['url']);
|
||||
|
||||
$slideid = $new[$app]->create('slide',array(
|
||||
'typeid'=>$typeid,
|
||||
'title'=>$title,
|
||||
'info'=>$info,
|
||||
'url'=>$url,
|
||||
'addtime'=>time(),
|
||||
));
|
||||
|
||||
|
||||
//上传
|
||||
$arrUpload = tsUpload($_FILES['photo'],$slideid,'slide',array('jpg','gif','png','jpeg'));
|
||||
|
||||
if($arrUpload){
|
||||
|
||||
$new[$app]->update('slide',array(
|
||||
'slideid'=>$slideid,
|
||||
),array(
|
||||
'path'=>$arrUpload['path'],
|
||||
'photo'=>$arrUpload['url'],
|
||||
));
|
||||
}
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=set');
|
||||
break;
|
||||
|
||||
case "edit":
|
||||
|
||||
$slideid = intval($_GET['slideid']);
|
||||
|
||||
$strSlide = $new[$app]->find('slide',array(
|
||||
'slideid'=>$slideid,
|
||||
));
|
||||
|
||||
|
||||
include template('edit_edit','slide');
|
||||
break;
|
||||
|
||||
case "editdo":
|
||||
|
||||
$slideid = intval($_POST['slideid']);
|
||||
$typeid = intval($_POST['typeid']);
|
||||
$title = tsTrim($_POST['title']);
|
||||
$info = tsTrim($_POST['info']);
|
||||
$url = tsTrim($_POST['url']);
|
||||
|
||||
$new[$app]->update('slide',array(
|
||||
'slideid'=>$slideid,
|
||||
),array(
|
||||
'typeid'=>$typeid,
|
||||
'title'=>$title,
|
||||
'info'=>$info,
|
||||
'url'=>$url,
|
||||
));
|
||||
|
||||
|
||||
//上传
|
||||
$arrUpload = tsUpload($_FILES['photo'],$slideid,'slide',array('jpg','gif','png','jpeg'));
|
||||
|
||||
if($arrUpload){
|
||||
|
||||
$new[$app]->update('slide',array(
|
||||
'slideid'=>$slideid,
|
||||
),array(
|
||||
'path'=>$arrUpload['path'],
|
||||
'photo'=>$arrUpload['url'],
|
||||
'addtime'=>time(),
|
||||
));
|
||||
|
||||
tsDimg($arrUpload['url'],'slide','748','210',$arrUpload['path']);
|
||||
|
||||
}
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=set');
|
||||
|
||||
break;
|
||||
|
||||
case "delete":
|
||||
|
||||
$slideid = intval($_GET['slideid']);
|
||||
|
||||
$strSlide = $new[$app]->find('slide',array(
|
||||
'slideid'=>$slideid,
|
||||
));
|
||||
|
||||
unlink('uploadfile/slide/'.$strSlide['photo']);
|
||||
|
||||
$new[$app]->delete('slide',array(
|
||||
'slideid'=>$slideid,
|
||||
));
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=set');
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<div class="midder">
|
||||
|
||||
|
||||
{include pubTemplate("plugin_menu")}
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
<form enctype="multipart/form-data" method="POST" action="{SITE_URL}index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=editdo">
|
||||
|
||||
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
<tr><td>类型:</td><td>
|
||||
|
||||
<select name="typeid">
|
||||
<option value="0" {if $strSlide['typeid']==0}selected{/if}>PC端-首页</option>
|
||||
<option value="1" {if $strSlide['typeid']==1}selected{/if}>手机端-首页</option>
|
||||
<option value="2" {if $strSlide['typeid']==2}selected{/if}>手机端-商品首页</option>
|
||||
</select>
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td>标题:</td><td><input name="title" style="width:300px" value="{$strSlide['title']}" /></td></tr>
|
||||
<tr><td>内容:</td><td><input name="info" style="width:300px" value="{$strSlide['info']}" /></td></tr>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>URL:</td><td><input name="url" style="width:300px" value="{$strSlide['url']}" /></td></tr>
|
||||
<tr><td>图片:</td><td>
|
||||
|
||||
{if $strSlide['photo']}
|
||||
<img src="{SITE_URL}uploadfile/slide/{$strSlide['photo']}?v={$strSlide['addtime']}" width="200" />
|
||||
<br />
|
||||
{/if}
|
||||
|
||||
<input type="file" name="photo" /></td></tr>
|
||||
<tr><td></td><td>
|
||||
|
||||
<input type="hidden" name="slideid" value="{$strSlide['slideid']}" />
|
||||
<input type="submit" value="提交" /></td></tr>
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,63 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<div class="midder">
|
||||
|
||||
|
||||
{php include pubTemplate("plugin_menu")}
|
||||
|
||||
<div>
|
||||
<form enctype="multipart/form-data" method="POST" action="{SITE_URL}index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=do">
|
||||
<table>
|
||||
<tr><td>类型:</td><td>
|
||||
|
||||
<select name="typeid">
|
||||
<option value="0">PC端-首页</option>
|
||||
<option value="1">手机端-首页</option>
|
||||
<option value="2">手机端-商品首页</option>
|
||||
</select>
|
||||
|
||||
</td></tr>
|
||||
<tr><td>标题:</td><td><input name="title" style="width:600px" /></td></tr>
|
||||
<tr><td>内容:</td><td><input name="info" style="width:600px" /></td></tr>
|
||||
|
||||
<tr><td>URL:</td><td><input name="url" style="width:600px" /></td></tr>
|
||||
|
||||
<tr><td>图片:</td><td><input type="file" name="photo" /><br />
|
||||
(PC端图1110*300;手机端图640*320)</td></tr>
|
||||
<tr><td></td><td><input type="submit" value="提交" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
<thead class="thead-light">
|
||||
<tr><th>ID</th><th>类型</th><th>标题</th><th>URL</th><th>图片</th><th>操作</th></tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
{loop $arrSlide $key $item}
|
||||
<tr class="odd">
|
||||
<td>{$item['slideid']}</td>
|
||||
<td>{$item['typeid']}</td>
|
||||
<td>{$item['title']}</td>
|
||||
<td>{$item['url']}</td>
|
||||
<td><img src="{$item['photo_url']}" width="200" /></td>
|
||||
|
||||
<td>
|
||||
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{SITE_URL}index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=edit&slideid={$item['slideid']}">修改</a>
|
||||
|
||||
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{SITE_URL}index.php?app=home&ac=plugin&plugin=slide&in=edit&ts=delete&slideid={$item['slideid']}">删除</a></td></tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,34 @@
|
||||
<!--幻灯片-->
|
||||
<div id="carouselExampleIndicators" class="carousel slide mb-3" data-ride="carousel">
|
||||
<!-- Indicators -->
|
||||
<ol class="carousel-indicators">
|
||||
{loop $arrSlide $key $item}
|
||||
<li data-target="#carousel-example-generic" data-slide-to="{$key}"{if $key==0} class="active"{/if}></li>
|
||||
{/loop}
|
||||
</ol>
|
||||
|
||||
<!-- Wrapper for slides -->
|
||||
<div class="carousel-inner">
|
||||
{loop $arrSlide $key $item}
|
||||
<div class="carousel-item{if $key==0} active{/if}">
|
||||
<a href="{$item['url']}" title="{$item['title']}">
|
||||
<img class="d-block w-100" src="{$item['photo_url']}" alt="{$item['title']}">
|
||||
<div class="carousel-caption d-none d-md-block text-left" style="top:80px;">
|
||||
<div class="fs36 fw400">{$item['title']}</div>
|
||||
<div class="fs24 fw400">{$item['info']}</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
|
||||
<!-- Controls -->
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//首页幻灯片插件
|
||||
function slide(){
|
||||
|
||||
$arrSlide = aac('home')->findAll('slide',array(
|
||||
'typeid'=>0,
|
||||
),'addtime desc');
|
||||
|
||||
foreach($arrSlide as $key=>$item){
|
||||
if($GLOBALS['TS_SITE']['file_upload_type']==1){
|
||||
$arrSlide[$key]['photo_url'] = $GLOBALS['TS_SITE']['alioss_bucket_url'].'/uploadfile/slide/'.$item['photo'].'?v='.$item['addtime'];
|
||||
}else{
|
||||
$arrSlide[$key]['photo_url'] = SITE_URL.'uploadfile/slide/'.$item['photo'].'?v='.$item['addtime'];
|
||||
}
|
||||
}
|
||||
|
||||
include template('slide','slide');
|
||||
}
|
||||
|
||||
addAction('home_index_header','slide');
|
||||
@@ -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' => '1',
|
||||
);
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//插件编辑
|
||||
switch($ts){
|
||||
case "set":
|
||||
|
||||
$strAbout = fileRead('plugins/home/tag/about.php');
|
||||
|
||||
$tag = fileRead('data/plugins_home_tag.php');
|
||||
if($tag==''){
|
||||
$tag = $tsMySqlCache->get('plugins_home_tag');
|
||||
}
|
||||
|
||||
include template('edit_set','tag');
|
||||
break;
|
||||
|
||||
case "do":
|
||||
$tag = tsTrim($_POST['tag']);
|
||||
fileWrite('plugins_home_tag.php','data',$tag);
|
||||
$tsMySqlCache->set('plugins_home_tag',$tag);
|
||||
|
||||
header('Location: '.SITE_URL.'index.php?app=home&ac=plugin&plugin=tag&in=edit&ts=set');
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include pubTemplate("plugin_menu")}
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=home&ac=plugin&plugin=tag&in=edit&ts=do">
|
||||
<table class="table table-hover">
|
||||
|
||||
<tr><td width="300">调用(仅支持调用一种内容的标签):</td><td>
|
||||
|
||||
<input type="radio" name="tag" value="topic" {if $tag=='topic' || $tag==''}checked{/if}>帖子
|
||||
<input type="radio" name="tag" value="article" {if $tag=='article'}checked{/if}>文章
|
||||
|
||||
</td></tr>
|
||||
|
||||
<tr><td></td><td><input type="submit" value="提交修改" /></td></tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,30 @@
|
||||
<div class="card">
|
||||
<div class="card-header">热门标签<small class="float-right">
|
||||
{if $tag=='topic'}
|
||||
<a class="text-black-50" href="{tsUrl('topic','tags')}">更多</a>
|
||||
{elseif $tag=='article'}
|
||||
<a class="text-black-50" href="{tsUrl('article','tags')}">更多</a>
|
||||
{/if}
|
||||
</small>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
{if $arrTag}
|
||||
|
||||
{loop $arrTag $key $item}
|
||||
{if $tag=='topic'}
|
||||
<a class="badge badge-secondary mr-2 fw300" href="{tsUrl('topic','tag',array('id'=>urlencode($item['tagname'])))}">{$item['tagname']}</a>
|
||||
{elseif $tag=='article'}
|
||||
<a class="badge badge-secondary mr-2 fw300" href="{tsUrl('article','tag',array('id'=>urlencode($item['tagname'])))}">{$item['tagname']}</a>
|
||||
{/if}
|
||||
|
||||
{/loop}
|
||||
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无推荐标签</div>
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function tag(){
|
||||
|
||||
$tag = fileRead('data/plugins_home_tag.php');
|
||||
if($tag==''){
|
||||
$tag = $GLOBALS['tsMySqlCache']->get('plugins_home_tag');
|
||||
if($tag == '') $tag='topic';
|
||||
}
|
||||
|
||||
if($tag=='topic'){
|
||||
$where = "`count_topic`>'0' and `isaudit`=0";
|
||||
}elseif($tag=='article'){
|
||||
$where = "`count_article`>'0' and `isaudit`=0";
|
||||
}
|
||||
|
||||
//最新标签
|
||||
$arrTag = aac('tag')->findAll('tag',$where,'uptime desc',null,30);
|
||||
|
||||
foreach($arrTag as $key=>$item){
|
||||
$arrTag[$key]['tagname'] = tsTitle($item['tagname']);
|
||||
}
|
||||
|
||||
include template('tag','tag');
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_left','tag');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//首页最新话题列表
|
||||
return array(
|
||||
'hook'=>'home_index_right', //钩子
|
||||
'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,16 @@
|
||||
<div class="card">
|
||||
<div class="card-header">最新话题</div>
|
||||
<div class="card-body">
|
||||
{if $arrTopic}
|
||||
<div class="commlist">
|
||||
<ul>
|
||||
{loop $arrTopic $key $item}
|
||||
<li><a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{tsTitle($item['title'])}</a></li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
{else}
|
||||
<div class="c9">暂无话题</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
function topic(){
|
||||
|
||||
$arrTopic = aac('home')->findAll('topic',array(
|
||||
'isaudit'=>0,
|
||||
),'addtime desc','topicid,title',10);
|
||||
|
||||
include template('topic','topic');
|
||||
|
||||
}
|
||||
|
||||
addAction('home_index_right','topic');
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//插件信息
|
||||
return array(
|
||||
'hook'=>'home_index_right', //钩子
|
||||
'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,76 @@
|
||||
.weiform{}
|
||||
.weiform form {
|
||||
background: none repeat scroll 0 0 #0099FF;
|
||||
border: 1px solid #0099FF;
|
||||
margin: 0 0 10px;
|
||||
height:36px;
|
||||
width:100%;
|
||||
position: relative;
|
||||
overflow:hidden;
|
||||
border-radius: 0px;
|
||||
}
|
||||
.weiform textarea {
|
||||
background: none repeat scroll 0 0 #FFFFFF;
|
||||
border: 0 none;
|
||||
float: left;
|
||||
font-size: 9pt;
|
||||
height: 36px;
|
||||
overflow: auto;
|
||||
padding: 2px;
|
||||
resize: none;
|
||||
width: 80%;
|
||||
}
|
||||
.weiform input {
|
||||
background: none repeat scroll 0 0 #0099FF;
|
||||
border: 0 none;
|
||||
color: #FFFFFF;
|
||||
float: right;
|
||||
font-size: 10pt;
|
||||
height: 36px;
|
||||
width: 20%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.weilist{}
|
||||
|
||||
.weilist ul, .weilist ul li{list-style: none;margin:0;padding:0;}
|
||||
|
||||
.weilist ul li {
|
||||
border-bottom: 1px dashed #DDDDDD;
|
||||
margin: 0 0 5px;
|
||||
padding: 0 0 8px;
|
||||
display: flex;
|
||||
}
|
||||
.weilist ul li .portrait {
|
||||
|
||||
padding-top: 3px;
|
||||
width: 45px;
|
||||
}
|
||||
.weilist ul li .portrait img {
|
||||
background: none repeat scroll 0 0 #FFFFFF;
|
||||
height: 32px;
|
||||
padding: 1px;
|
||||
width: 32px;
|
||||
}
|
||||
.weilist ul li .body {
|
||||
flex:1;
|
||||
font-size: 9pt;
|
||||
overflow: hidden;
|
||||
}
|
||||
.weilist ul li .user a {
|
||||
|
||||
}
|
||||
|
||||
.weilist ul li .log {
|
||||
color: #999;
|
||||
word-break: break-all;
|
||||
}
|
||||
.weilist ul li .time {
|
||||
color: #9A9A9A;
|
||||
display: block;
|
||||
margin: 5px 0 0;
|
||||
}
|
||||
.weilist ul li .time a {
|
||||
color: #9A9A9A;
|
||||
text-decoration: none;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<div class="card">
|
||||
<div class="card-header">唠唠叨叨</div>
|
||||
<div class="card-body">
|
||||
<div class="weibo">
|
||||
<!--
|
||||
<div class="weiform">
|
||||
<form id="comm-form" method="post" action="{SITE_URL}index.php?app=weibo&ac=add">
|
||||
<textarea name="title" placeholder="说点啥..."></textarea>
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
<input type="submit" value="发送" />
|
||||
</form>
|
||||
</div>
|
||||
-->
|
||||
|
||||
<div class="mb-3">
|
||||
<a class="btn btn-block btn-outline-info btn-lg" href="{tsUrl('weibo')}"><i class="bi bi-chat-dots"></i> 吐个槽,唠叨两句</a>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div class="weilist">
|
||||
<ul id="weibolist">
|
||||
{loop $arrWeibo $key $item}
|
||||
<li>
|
||||
<span class="portrait"><a href="{tsUrl('user','space',array('id'=>$item['user']['userid']))}"><img align="absmiddle" class="SmallPortrait rounded-circle" title="{$item['user']['username']}" alt="{$item['user']['username']}" src="{$item['user']['face']}"></a></span>
|
||||
<div class="body">
|
||||
<div>
|
||||
<span class="user"><a href="{tsUrl('user','space',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a>:</span><span class="log">{$item['title']}</span>
|
||||
</div>
|
||||
|
||||
{if $item['photo']}
|
||||
<div class="d-flex">
|
||||
{loop $item['photo'] $pkey $pitem}
|
||||
<a class="w-25 p-1" href="{tsUrl('weibo','show',array('id'=>$item['weiboid']))}"><img class="w-100" src="{$pitem}"></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="time">{php echo getTime(strtotime($item['addtime']),time())} (<a href="{tsUrl('weibo','show',array('id'=>$item['weiboid']))}">{$item['count_comment']}评</a>)
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,32 @@
|
||||
function sendweibo(){
|
||||
var title = $("#weibotitle").val();
|
||||
|
||||
if(title==''){
|
||||
tsNotice('发布内容不能为空!');return false;
|
||||
}
|
||||
|
||||
$("#weibosend").attr('disabled','disabled');
|
||||
|
||||
$.post(siteUrl+'index.php?app=weibo&ac=ajax&ts=add',{'title':title},function(rs){
|
||||
if(rs==0){
|
||||
|
||||
tsNotice('请登陆后再发布唠叨!');
|
||||
|
||||
}else if(rs==1){
|
||||
|
||||
tsNotice('发布内容不能为空!');
|
||||
|
||||
}else if(rs==2){
|
||||
$("#weibotitle").val('');
|
||||
$("#weibosend").removeAttr('disabled');
|
||||
weibolist();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function weibolist(){
|
||||
$.get(siteUrl+'index.php?app=weibo&ac=ajax&ts=list',function(rs){
|
||||
$("#weibolist").html(rs);
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//首页登录框
|
||||
function weibo(){
|
||||
$arrWeibo = aac('weibo')->findAll('weibo',array(
|
||||
'isaudit'=>0,
|
||||
),'addtime desc',null,10);
|
||||
foreach($arrWeibo as $key=>$item){
|
||||
$arrWeibo[$key]['title'] = tsTitle($item['title']);
|
||||
$arrWeibo[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
$arrWeibo[$key]['photo'] = aac('weibo')->getWeiboPhoto($item['weiboid'],4);
|
||||
}
|
||||
|
||||
include template('weibo','weibo');
|
||||
}
|
||||
|
||||
function weibo_css(){
|
||||
|
||||
echo '<link href="'.SITE_URL.'plugins/home/weibo/style.css" rel="stylesheet" type="text/css" />';
|
||||
|
||||
}
|
||||
function weibo_js(){
|
||||
echo '<script src="'.SITE_URL.'plugins/home/weibo/weibo.js" type="text/javascript"></script>';
|
||||
}
|
||||
|
||||
addAction('home_index_right','weibo');
|
||||
addAction('pub_header_top','weibo_css');
|
||||
addAction('pub_footer','weibo_js');
|
||||
Reference in New Issue
Block a user