@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
return array(
|
||||
'name' => '话题',
|
||||
'version' => '1.2',
|
||||
'desc' => '话题,帖子',
|
||||
'url' => 'http://www.thinksaas.cn',
|
||||
'email' => 'thinksaas@qq.com',
|
||||
'author' => '邱君',
|
||||
'author_url' => 'http://www.thinksaas.cn',
|
||||
'isoption' => '1',
|
||||
'isinstall' => '1',
|
||||
'issql' => '1',
|
||||
'issystem' => '1',
|
||||
'isappnav' => '1',
|
||||
'ismy'=>'1'
|
||||
);
|
||||
@@ -0,0 +1,337 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
if($TS_APP['allowpost']==1 && $TS_USER['isadmin']==0){
|
||||
tsNotice('APP设置不允许会员发布帖子!');
|
||||
}
|
||||
|
||||
// 用户是否登录
|
||||
$userid = aac ( 'user' )->isLogin ();
|
||||
|
||||
//判断用户是否存在
|
||||
if(aac('user')->isUser($userid)==false) tsNotice('不好意思,用户不存在!');
|
||||
|
||||
//判断发布者状态
|
||||
if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!');
|
||||
|
||||
//发布时间限制
|
||||
if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!');
|
||||
|
||||
//发布时间间隔限制
|
||||
if($TS_SITE['timeblank']){
|
||||
$lastTopic = $new['topic']->find('topic',array(
|
||||
'userid'=>$userid,
|
||||
),'topicid,addtime','addtime desc');
|
||||
if($lastTopic){
|
||||
if((time()-$lastTopic['addtime'])<$TS_SITE['timeblank']){
|
||||
tsNotice('不好意思,您的内容发送频率过高!请等等再发布!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//发布内容扣除积分限制
|
||||
$strScoreOption = $new['topic']->find('user_score',array(
|
||||
'app'=>'topic',
|
||||
'action'=>'add',
|
||||
'ts'=>'do',
|
||||
));
|
||||
if($strScoreOption && $strScoreOption['status']==1){
|
||||
#用户积分数
|
||||
$strUserScore = $new['topic']->find('user_info',array(
|
||||
'userid'=>$userid,
|
||||
),'count_score');
|
||||
if($strUserScore['count_score']<$strScoreOption['score']){
|
||||
tsNotice('不好意思,您的积分不足!');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$groupid = tsIntval($_GET ['groupid']);
|
||||
|
||||
// 小组数目
|
||||
$groupNum = $new ['topic']->findCount ( 'group', array (
|
||||
'groupid' => $groupid
|
||||
) );
|
||||
|
||||
if ($groupNum == 0) {
|
||||
header ( "Location: " . SITE_URL );
|
||||
exit ();
|
||||
}
|
||||
|
||||
// 小组会员
|
||||
$isGroupUser = $new ['topic']->findCount ( 'group_user', array (
|
||||
'userid' => $userid,
|
||||
'groupid' => $groupid
|
||||
) );
|
||||
|
||||
//小组信息
|
||||
$strGroup = $new ['topic']->find ( 'group', array (
|
||||
'groupid' => $groupid
|
||||
));
|
||||
$strGroup ['groupname'] = tsTitle( $strGroup ['groupname'] );
|
||||
$strGroup ['groupdesc'] = tsTitle( $strGroup ['groupdesc'] );
|
||||
|
||||
if ($strGroup ['isaudit'] == 1) {
|
||||
tsNotice ( '小组还未审核通过,不允许发帖!' );
|
||||
}
|
||||
|
||||
// 允许小组成员发帖
|
||||
if ($strGroup ['ispost'] == 0 && $isGroupUser == 0 && $userid != $strGroup ['userid']) {
|
||||
tsNotice ( "本小组只允许小组成员发贴,请加入小组后再发帖!" );
|
||||
}
|
||||
// 不允许小组成员发帖
|
||||
if ($strGroup ['ispost'] == 1 && $userid != $strGroup ['userid']) {
|
||||
tsNotice ( "本小组只允许小组组长发帖!" );
|
||||
}
|
||||
|
||||
switch ($ts) {
|
||||
|
||||
// 发布帖子
|
||||
case "" :
|
||||
|
||||
// 帖子类型
|
||||
$arrGroupType = $new ['topic']->findAll ( 'topic_type', array (
|
||||
'groupid' => $strGroup ['groupid']
|
||||
) );
|
||||
|
||||
#加载草稿箱
|
||||
$strDraft = $new['topic']->find('draft',array(
|
||||
'userid'=>$userid,
|
||||
'types'=>'topic',
|
||||
));
|
||||
|
||||
$title = '发布帖子';
|
||||
// 包含模版
|
||||
include template ( "add" );
|
||||
|
||||
break;
|
||||
|
||||
// 执行发布帖子
|
||||
case "do" :
|
||||
|
||||
#验证码验证
|
||||
$authcode = strtolower ( $_POST ['authcode'] );
|
||||
if ($TS_SITE['isauthcode']) {
|
||||
if ($authcode != $_SESSION ['verify']) {
|
||||
tsNotice ( "验证码输入有误,请重新输入!" );
|
||||
}
|
||||
}
|
||||
|
||||
#人机验证
|
||||
$vaptcha_token = tsTrim($_POST ['vaptcha_token']);
|
||||
$vaptcha_server = tsTrim($_POST['vaptcha_server']);
|
||||
if ($TS_SITE['is_vaptcha']) {
|
||||
$strVt = vaptcha($vaptcha_token,0,$vaptcha_server);
|
||||
if($strVt['success']==0) {
|
||||
tsNotice('人机验证未通过!');
|
||||
}
|
||||
}
|
||||
|
||||
$title = tsTrim( $_POST ['title'] );
|
||||
|
||||
$content = tsClean( $_POST ['content'] );
|
||||
$content2 = emptyText($_POST ['content']);
|
||||
|
||||
$typeid = tsIntval ( $_POST ['typeid'] );
|
||||
$tag = $_POST ['tag'];
|
||||
|
||||
$score = tsIntval($_POST ['score']);#积分
|
||||
|
||||
|
||||
//匿名用户
|
||||
$isniming = tsIntval($_POST['isniming']);
|
||||
if($TS_SITE['isniming']==1 && $isniming==1) $userid = aac('user')->getNimingId();
|
||||
|
||||
|
||||
// 判断一下Title是否重复
|
||||
$isTitle = $new ['topic']->findCount ( 'topic', array (
|
||||
'title' => $title
|
||||
) );
|
||||
|
||||
if ($isTitle > 0) {
|
||||
tsNotice ( '有重复标题出现哦^_^' );
|
||||
}
|
||||
|
||||
if ($TS_USER ['isadmin'] == 0) {
|
||||
$title = antiWord ( $title );
|
||||
$content = antiWord ( $content );
|
||||
$tag = antiWord ( $tag );
|
||||
}
|
||||
|
||||
$iscomment = tsIntval ( $_POST ['iscomment'] );
|
||||
$iscommentshow = tsIntval ( $_POST ['iscommentshow'] );
|
||||
|
||||
// 帖子是否需要审核
|
||||
if ($strGroup ['ispostaudit'] == 1) {
|
||||
$isaudit = 1;
|
||||
} else {
|
||||
$isaudit = 0;
|
||||
}
|
||||
|
||||
#应用后台设置发帖是否需要审核,只针对普通用户
|
||||
if($TS_APP['isaudit']==1 && $TS_USER['isadmin']==0){
|
||||
$isaudit = 1;
|
||||
}
|
||||
|
||||
|
||||
if ($title == '' || $content2 == '' || $content=='') {
|
||||
tsNotice ( '没有任何内容是不允许你通过滴^_^' );
|
||||
}
|
||||
|
||||
if($score<0){
|
||||
tsNotice ( '积分填写有误!' );
|
||||
}
|
||||
|
||||
/**
|
||||
* ******************
|
||||
*/
|
||||
// 防止用户发布重复内容,调出用户上一次发表的内容
|
||||
$strPreTopic = $new ['topic']->find ( 'topic', array (
|
||||
'userid' => $userid
|
||||
), 'topicid,title,addtime', 'addtime desc' );
|
||||
|
||||
// print_r($strPreTopic);exit;
|
||||
|
||||
|
||||
// 发帖间隔时间
|
||||
/*
|
||||
$IntervalTime = time () - $strPreTopic ['addtime'];
|
||||
// if($strPreTopic && $IntervalTime<3600){
|
||||
if ($strPreTopic) {
|
||||
similar_text ( $strPreTopic ['title'], $title, $percent );
|
||||
if ($percent >= 90) {
|
||||
$new ['topic']->update ( 'topic', array (
|
||||
'topicid' => $strPreTopic ['topicid']
|
||||
), array (
|
||||
'isaudit' => 1
|
||||
) );
|
||||
$isaudit = 1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* *****************
|
||||
*/
|
||||
|
||||
$gaiyao = cututf8(t(tsDecode($content)),0,100);
|
||||
|
||||
|
||||
$topicid = $new ['topic']->create ( 'topic', array (
|
||||
'groupid' => $groupid,
|
||||
'typeid' => $typeid,
|
||||
'userid' => $userid,
|
||||
'title' => $title,
|
||||
'content' => $content,
|
||||
'gaiyao'=>$gaiyao,
|
||||
'score'=>$score,
|
||||
'iscomment' => $iscomment,
|
||||
'iscommentshow' => $iscommentshow,
|
||||
'isaudit' => $isaudit,
|
||||
'addtime' => time (),
|
||||
'uptime' => time ()
|
||||
) );
|
||||
|
||||
|
||||
#清空草稿箱
|
||||
$new['topic']->delete('draft',array(
|
||||
'userid'=>$userid,
|
||||
'types'=>'topic',
|
||||
));
|
||||
|
||||
|
||||
// 统计用户发帖数
|
||||
$countUserTopic = $new ['topic']->findCount ( 'topic', array (
|
||||
'userid' => $userid
|
||||
) );
|
||||
|
||||
$new ['topic']->update ( 'user_info', array (
|
||||
'userid' => $userid
|
||||
), array (
|
||||
'count_topic' => $countUserTopic
|
||||
) );
|
||||
|
||||
// 处理@用户名
|
||||
/*
|
||||
if (preg_match_all ( '/@/', $content, $at )) {
|
||||
preg_match_all ( "/@(.+?)([\s|:]|$)/is", $content, $matches );
|
||||
|
||||
$unames = $matches [1];
|
||||
|
||||
$ns = "'" . implode ( "','", $unames ) . "'";
|
||||
|
||||
$csql = "username IN($ns)";
|
||||
|
||||
if ($unames) {
|
||||
|
||||
$query = $db->fetch_all_assoc ( "select userid,username from " . dbprefix . "user_info where $csql" );
|
||||
|
||||
foreach ( $query as $v ) {
|
||||
$content = str_replace ( '@' . $v ['username'] . '', '[@' . $v ['username'] . ':' . $v ['userid'] . ']', $content );
|
||||
$msg_content = '我在帖子中提到了你<br />去看看:' . tsUrl ( 'group', 'topic', array (
|
||||
'id' => $topicid
|
||||
) );
|
||||
aac ( 'message' )->sendmsg ( $userid, $v ['userid'], $msg_content );
|
||||
}
|
||||
$new ['topic']->update ( 'topic', array (
|
||||
'topicid' => $topicid
|
||||
), array (
|
||||
'content' => $content
|
||||
) );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// 统计帖子类型
|
||||
if ($typeid) {
|
||||
$topicTypeNum = $new ['topic']->findCount ( 'topic', array (
|
||||
'typeid' => $typeid
|
||||
) );
|
||||
|
||||
$new ['topic']->update ( 'topic_type', array (
|
||||
'typeid' => $typeid
|
||||
), array (
|
||||
'count_topic' => $topicTypeNum
|
||||
) );
|
||||
}
|
||||
// 处理标签
|
||||
aac ( 'tag' )->addTag ( 'topic', 'topicid', $topicid, $tag );
|
||||
|
||||
// 统计需要审核的帖子
|
||||
$count_topic_audit = $new ['topic']->findCount ( 'topic', array (
|
||||
'groupid' => $groupid,
|
||||
'isaudit' => '1'
|
||||
) );
|
||||
|
||||
// 统计小组下帖子数并更新
|
||||
$count_topic = $new ['topic']->findCount ( 'topic', array (
|
||||
'groupid' => $groupid
|
||||
) );
|
||||
|
||||
// 统计今天发布帖子数
|
||||
$today_start = strtotime ( date ( 'Y-m-d 00:00:00' ) );
|
||||
$today_end = strtotime ( date ( 'Y-m-d 23:59:59' ) );
|
||||
|
||||
$count_topic_today = $new ['topic']->findCount ( 'topic', "`groupid`='$groupid' and `addtime`>'$today_start' and `addtime`<'$today_end'" );
|
||||
|
||||
$new ['topic']->update ( 'group', array (
|
||||
'groupid' => $groupid
|
||||
), array (
|
||||
'count_topic' => $count_topic,
|
||||
'count_topic_audit' => $count_topic_audit,
|
||||
'count_topic_today' => $count_topic_today,
|
||||
'uptime' => time ()
|
||||
) );
|
||||
|
||||
// 对积分进行处理
|
||||
aac ( 'user' )->doScore ( $TS_URL['app'], $TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'], $TS_URL['ts'] );
|
||||
|
||||
#用户记录
|
||||
aac('pubs')->addLogs('topic','topicid',$topicid,$userid,$title,$content,0);
|
||||
|
||||
|
||||
header ( "Location: " . tsUrl('topic', 'show', array ('id' => $topicid)));
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
// 管理入口
|
||||
if (is_file('app/' . $TS_URL['app'] . '/action/admin/' . $mg . '.php')) {
|
||||
include_once 'app/' . $TS_URL['app'] . '/action/admin/' . $mg . '.php';
|
||||
} else {
|
||||
qiMsg('sorry:no index!');
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch($ts){
|
||||
//基本配置
|
||||
case "":
|
||||
$strOption = getAppOptions('topic');
|
||||
|
||||
include template("admin/options");
|
||||
|
||||
break;
|
||||
|
||||
case "do":
|
||||
|
||||
$arrOption = $_POST['option'];
|
||||
|
||||
#更新app配置选项
|
||||
upAppOptions('topic',$arrOption);
|
||||
|
||||
#更新app导航和我的导航
|
||||
upAppNav('topic',$arrOption['appname']);
|
||||
|
||||
qiMsg('修改成功!');
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch($ts){
|
||||
|
||||
case "":
|
||||
|
||||
$ugid = tsIntval($_GET['ugid'],1);
|
||||
|
||||
$arrUg = $new['topic']->findAll('user_group',null,'ugid asc');
|
||||
|
||||
|
||||
|
||||
|
||||
include template('admin/permissions');
|
||||
|
||||
break;
|
||||
|
||||
case "do":
|
||||
|
||||
/**
|
||||
* 权限参数说明,app,action必须,其他参数可选
|
||||
* app-action-ts
|
||||
* app-action-mg-ts 当action=admin
|
||||
* app-action-api-ts 当action=api
|
||||
*/
|
||||
|
||||
$ugid = tsIntval($_POST['ugid']);
|
||||
|
||||
$arrOption = $_POST['option'];
|
||||
|
||||
aac('pubs')->upAppPermissions($ugid,'topic',$arrOption);
|
||||
|
||||
qiMsg('操作成功!');
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch($ts){
|
||||
|
||||
case "list":
|
||||
|
||||
$isrecommend = tsIntval($_GET['isrecommend']);
|
||||
$istop = tsIntval($_GET['istop']);
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$kw=tsFilter($_GET['kw']);
|
||||
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
$url = SITE_URL.'index.php?app=topic&ac=admin&mg=topic&ts=list&page=';
|
||||
$lstart = $page*10-10;
|
||||
|
||||
|
||||
$where = null;
|
||||
|
||||
if($isrecommend==1){
|
||||
$where = array(
|
||||
'isrecommend'=>1,
|
||||
);
|
||||
}
|
||||
|
||||
if($istop==1){
|
||||
$where = array(
|
||||
'istop'=>1,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if($topicid){
|
||||
$where = array(
|
||||
'topicid'=>$topicid,
|
||||
);
|
||||
}
|
||||
|
||||
if($kw){
|
||||
$where = "`title` like '%$kw%'";
|
||||
}
|
||||
|
||||
$arrTopic = $new['topic']->findAll('topic',$where,'addtime desc',null,$lstart.',10');
|
||||
|
||||
$topicNum = $new['topic']->findCount('topic',$where);
|
||||
|
||||
$pageUrl = pagination($topicNum, 10, $page, $url);
|
||||
|
||||
include template("admin/topic_list");
|
||||
|
||||
break;
|
||||
|
||||
/**
|
||||
* 删除帖子
|
||||
*/
|
||||
case "delete":
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
$strTopic = $new['topic']->getOneTopic($topicid);
|
||||
|
||||
#用户记录
|
||||
aac('pubs')->addLogs('topic','topicid',$topicid,$TS_USER['userid'],$strTopic['title'],$strTopic['content'],2);
|
||||
|
||||
$new['topic']->deleteTopic($strTopic);
|
||||
qiMsg('删除成功');
|
||||
break;
|
||||
|
||||
//帖子审核
|
||||
case "isaudit":
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopic['isaudit']==0){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isaudit'=>1,
|
||||
));
|
||||
}
|
||||
|
||||
if($strTopic['isaudit']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isaudit'=>0,
|
||||
));
|
||||
}
|
||||
|
||||
qiMsg('操作成功!');
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//推荐
|
||||
case "isrecommend":
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopic['isrecommend']==0){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isrecommend'=>1,
|
||||
));
|
||||
}
|
||||
|
||||
if($strTopic['isrecommend']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isrecommend'=>0,
|
||||
));
|
||||
}
|
||||
|
||||
qiMsg('操作成功!');
|
||||
|
||||
break;
|
||||
|
||||
//置顶
|
||||
case "istop":
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopic['istop']==0){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'istop'=>1,
|
||||
));
|
||||
}
|
||||
|
||||
if($strTopic['istop']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'istop'=>0,
|
||||
));
|
||||
}
|
||||
|
||||
qiMsg('操作成功!');
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
//删除的帖子
|
||||
case "deletetopic":
|
||||
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
$url = SITE_URL.'index.php?app=topic&ac=admin&mg=topic&ts=deletetopic&page=';
|
||||
$lstart = $page*10-10;
|
||||
|
||||
$arrTopic = $new['topic']->findAll('topic',array('isdelete'=>'1'),'addtime desc',null,$lstart.',10');
|
||||
|
||||
$topicNum = $new['topic']->findCount('topic',array(
|
||||
'isdelete'=>'1',
|
||||
));
|
||||
|
||||
$pageUrl = pagination($topicNum, 10, $page, $url);
|
||||
|
||||
include template("admin/topic_delete");
|
||||
|
||||
break;
|
||||
|
||||
//编辑的帖子
|
||||
case "edittopic":
|
||||
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
$url = SITE_URL.'index.php?app=topic&ac=admin&mg=topic&ts=edittopic&page=';
|
||||
$lstart = $page*10-10;
|
||||
|
||||
$arrTopic = $new['topic']->findAll('topic_edit',null,'addtime desc',null,$lstart.',10');
|
||||
|
||||
$topicNum = $new['topic']->findCount('topic_edit');
|
||||
|
||||
$pageUrl = pagination($topicNum, 10, $page, $url);
|
||||
|
||||
include template("admin/topic_edit");
|
||||
|
||||
break;
|
||||
|
||||
//执行更新帖子
|
||||
case "update":
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic_edit',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'title'=>$strTopic['title'],
|
||||
'content'=>$strTopic['content'],
|
||||
));
|
||||
|
||||
$new['topic']->update('topic_edit',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isupdate'=>1,
|
||||
));
|
||||
|
||||
qiMsg('更新成功!');
|
||||
|
||||
break;
|
||||
|
||||
//查看单独某个修改的帖子
|
||||
case "editview":
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic_edit',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
include template('admin/topic_edit_view');
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch($ts){
|
||||
|
||||
//帖子审核
|
||||
case "topicaudit":
|
||||
|
||||
$topicid = tsIntval($_POST['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopic['isaudit']==0){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isaudit'=>1,
|
||||
));
|
||||
|
||||
echo 0;exit;
|
||||
|
||||
}
|
||||
|
||||
if($strTopic['isaudit']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isaudit'=>0,
|
||||
));
|
||||
|
||||
echo 1;exit;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//帖子推荐
|
||||
case "isrecommend":
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$js = tsIntval($_GET['js']);
|
||||
|
||||
$topicid = tsIntval($_POST['topicid']);
|
||||
|
||||
if($TS_USER['isadmin']==1 && $topicid){
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopic['isrecommend']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isrecommend'=>0,
|
||||
));
|
||||
|
||||
getJson('取消推荐成功!',$js);
|
||||
|
||||
}
|
||||
|
||||
if($strTopic['isrecommend']==0){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isrecommend'=>1,
|
||||
));
|
||||
|
||||
getJson('推荐成功!',$js);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
getJson('非法操作',$js);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
/**
|
||||
* 帖子加标注
|
||||
*/
|
||||
case "book":
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
$topicid = tsIntval($_POST['topicid']);
|
||||
$book = tsTrim($_POST['book']);
|
||||
|
||||
//if($topicid==0 || $book==''){
|
||||
if($topicid==0){
|
||||
echo 0;exit;
|
||||
}
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),'userid');
|
||||
|
||||
if($strTopic['userid']!=$userid && $TS_USER['isadmin']==0){
|
||||
echo 0;exit;
|
||||
}
|
||||
|
||||
if($TS_USER['isadmin']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'label'=>$book,
|
||||
));
|
||||
}else{
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
'userid'=>$userid,
|
||||
),array(
|
||||
'label'=>$book,
|
||||
));
|
||||
}
|
||||
|
||||
echo 1;exit;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//置顶帖子
|
||||
case "topic_istop":
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
$istop = $strTopic['istop'];
|
||||
|
||||
$istop == 0 ? $istop = 1 : $istop = 0;
|
||||
|
||||
$strGroup = $new['topic']->find('group',array(
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
|
||||
if($userid==$strGroup['userid'] || $TS_USER['isadmin']==1){
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'istop'=>$istop,
|
||||
));
|
||||
|
||||
|
||||
tsNotice("操作成功!");
|
||||
|
||||
|
||||
}else{
|
||||
tsNotice("非法操作!");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//精华帖子
|
||||
case "isposts":
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
if($userid == 0 || $topicid == 0) tsNotice("非法操作");
|
||||
|
||||
$strTopic = $db->once_fetch_assoc("select userid,groupid,title,isposts from ".dbprefix."topic where topicid='$topicid'");
|
||||
|
||||
$strGroup = $db->once_fetch_assoc("select userid from ".dbprefix."group where groupid='".$strTopic['groupid']."'");
|
||||
|
||||
if($userid == $strGroup['userid'] || tsIntval($TS_USER['isadmin']) == 1){
|
||||
if($strTopic['isposts']==0){
|
||||
$db->query("update ".dbprefix."topic set `isposts`='1' where `topicid`='$topicid'");
|
||||
|
||||
//msg start
|
||||
$msg_userid = '0';
|
||||
$msg_touserid = $strTopic['userid'];
|
||||
$msg_content = '恭喜,你的帖子:《'.$strTopic['title'].'》被评为精华帖啦^_^ ';
|
||||
$msg_tourl = tsUrl('topic','show',array('id'=>$topicid));
|
||||
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl);
|
||||
//msg end
|
||||
|
||||
}else{
|
||||
$db->query("update ".dbprefix."topic set `isposts`='0' where `topicid`='$topicid'");
|
||||
}
|
||||
|
||||
tsNotice("操作成功!");
|
||||
}else{
|
||||
tsNotice("非法操作!");
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
// api入口
|
||||
if (is_file ( 'app/' . $TS_URL['app'] . '/action/api/' . $TS_URL['api'] . '.php' )) {
|
||||
include_once 'app/' . $TS_URL['app'] . '/action/api/' . $TS_URL['api'] . '.php';
|
||||
} else {
|
||||
qiMsg ( 'sorry:no api!' );
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
echo '<pre>
|
||||
-----------------------------------------------
|
||||
Topic Http Api List
|
||||
URL:https://demo.thinksaas.cn
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
-----------------------------------------------
|
||||
</pre>';
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
//普通用户不允许删除内容
|
||||
if($TS_SITE['isallowdelete'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户删除内容,请联系管理员删除!');
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
$strTopic = $new['topic']->getOneTopic($topicid);
|
||||
$strGroup = aac('group')->getOneGroup($strTopic['groupid']);
|
||||
$strGroupUser = $new['topic']->find('group_user',array(
|
||||
'userid'=>$userid,
|
||||
'groupid'=>$groupid,
|
||||
));
|
||||
|
||||
//系统管理员删除
|
||||
if($TS_USER['isadmin'] == '1'){
|
||||
|
||||
#用户记录
|
||||
aac('pubs')->addLogs('topic','topicid',$topicid,$userid,$strTopic['title'],$strTopic['content'],2);
|
||||
|
||||
$new['topic']->deleteTopic($strTopic);
|
||||
tsNotice('帖子删除成功!','点击返回小组首页',tsUrl('group'));
|
||||
}
|
||||
|
||||
//其他人员删除
|
||||
if($userid == $strTopic['userid'] || $userid == $strGroup['userid'] || $strGroupUser['isadmin']=='1'){
|
||||
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'isdelete'=>1,
|
||||
));
|
||||
|
||||
//处理积分
|
||||
aac('user')->doScore($TS_URL['app'],$TS_URL['ac'],$TS_URL['mg'],$TS_URL['api'],$TS_URL['ts'],$strTopic['userid']);
|
||||
|
||||
tsNotice('你的删除帖子申请已经提交!');
|
||||
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
//普通不用不允许编辑内容
|
||||
if($TS_SITE['isallowedit'] && $TS_USER ['isadmin'] == 0) tsNotice('系统不允许用户编辑内容,请联系管理员编辑!');
|
||||
|
||||
switch($ts){
|
||||
|
||||
//编辑帖子
|
||||
case "":
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
if($topicid == 0){
|
||||
header("Location: ".SITE_URL);
|
||||
exit;
|
||||
}
|
||||
|
||||
$topicNum = $new['topic']->findCount('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($topicNum==0){
|
||||
header("Location: ".SITE_URL);
|
||||
exit;
|
||||
}
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
$strTopic['title'] = tsTitle($strTopic['title']);
|
||||
//$strTopic['content'] = tsDecode($strTopic['content']); //为有效防止xss攻击,如果前端通过textarea标签加载的编辑器,请注释掉本行;如果编辑器有其他的加载方式,请视情况解除本行注释。
|
||||
|
||||
$strGroup = $new['topic']->find('group',array(
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
|
||||
$strGroupUser = $new['topic']->find('group_user',array(
|
||||
'userid'=>$userid,
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
|
||||
//print_r($strGroupUser);exit;
|
||||
|
||||
if($strTopic['userid'] == $userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strGroupUser['isadmin']==1){
|
||||
$arrGroupType = $new['topic']->findAll('topic_type',array(
|
||||
'groupid'=>$strGroup['groupid'],
|
||||
));
|
||||
|
||||
//找出TAG
|
||||
$arrTags = aac('tag')->getObjTagByObjid('topic', 'topicid', $topicid);
|
||||
foreach($arrTags as $key=>$item){
|
||||
$arrTag[] = $item['tagname'];
|
||||
}
|
||||
$strTopic['tag'] = arr2str($arrTag);
|
||||
|
||||
$title = '编辑帖子';
|
||||
include template("edit");
|
||||
|
||||
}else{
|
||||
|
||||
header("Location: ".SITE_URL);
|
||||
exit;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
//编辑帖子执行
|
||||
case "do":
|
||||
|
||||
|
||||
$authcode = strtolower ( $_POST ['authcode'] );
|
||||
|
||||
if ($TS_SITE['isauthcode']) {
|
||||
if ($authcode != $_SESSION ['verify']) {
|
||||
tsNotice ( "验证码输入有误,请重新输入!" );
|
||||
}
|
||||
}
|
||||
|
||||
$topicid = tsIntval($_POST['topicid']);
|
||||
$typeid = tsIntval($_POST['typeid']);
|
||||
|
||||
$title = tsTrim($_POST['title']);
|
||||
|
||||
//echo br2nl($_POST['content']);exit;
|
||||
|
||||
$content = tsClean($_POST['content']);
|
||||
$content2 = emptyText($_POST['content']);
|
||||
|
||||
$score = tsIntval($_POST ['score']);#积分
|
||||
|
||||
$iscomment = tsIntval($_POST['iscomment']);
|
||||
$iscommentshow = tsIntval($_POST['iscommentshow']);
|
||||
|
||||
if($topicid == '' || $title=='' || $content2=='' || $content=='') tsNotice("都不能为空的哦!");
|
||||
|
||||
if($score<0){
|
||||
tsNotice ( '积分填写有误!' );
|
||||
}
|
||||
|
||||
if($TS_USER['isadmin']==0){
|
||||
|
||||
//过滤内容开始
|
||||
$title = antiWord($title);
|
||||
$content = antiWord($content);
|
||||
//过滤内容结束
|
||||
|
||||
}
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
$strGroup = $new['topic']->find('group',array(
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
|
||||
$strGroupUser = $new['topic']->find('group_user',array(
|
||||
'userid'=>$userid,
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
|
||||
if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1 || $strGroupUser['isadmin']==1){
|
||||
|
||||
$gaiyao = cututf8(t(tsDecode($content)),0,100);
|
||||
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'typeid' => $typeid,
|
||||
'title'=>$title,
|
||||
'content'=>$content,
|
||||
'gaiyao'=>$gaiyao,
|
||||
'score'=>$score,
|
||||
'iscomment' => $iscomment,
|
||||
'iscommentshow' => $iscommentshow,
|
||||
));
|
||||
|
||||
|
||||
|
||||
//处理标签
|
||||
$tag = tsTrim($_POST['tag']);
|
||||
if($tag){
|
||||
aac('tag')->delIndextag('topic','topicid',$topicid);
|
||||
aac('tag') -> addTag('topic', 'topicid', $topicid, $tag);
|
||||
}
|
||||
|
||||
|
||||
#用户记录
|
||||
aac('pubs')->addLogs('topic','topicid',$topicid,$userid,$title,$content,1);
|
||||
|
||||
|
||||
header("Location: ".tsUrl('topic','show',array('id'=>$topicid)));
|
||||
|
||||
}else{
|
||||
header("Location: ".SITE_URL);
|
||||
exit;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
$userid = aac ( 'user' )->isLogin ();
|
||||
|
||||
$arrGroupUser = $new['topic']->findAll('group_user',array(
|
||||
'userid'=>$userid,
|
||||
));
|
||||
|
||||
if($arrGroupUser==''){
|
||||
tsNotice('请加入小组后再发帖!','点击去加入小组',tsUrl('group'));
|
||||
}
|
||||
|
||||
foreach($arrGroupUser as $key=>$item){
|
||||
$arrGroup[$key] = aac('group')->getOneGroup($item['groupid']);
|
||||
}
|
||||
|
||||
$title = '选择发帖小组';
|
||||
|
||||
include template('group');
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
#最新话题
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
$url = tsUrl ( 'topic', 'index', array ('page' => '') );
|
||||
$lstart = $page * 20 - 20;
|
||||
|
||||
$arrTopic = $new['topic']->findAll('topic',array(
|
||||
'isaudit'=>0,
|
||||
),'istop desc,uptime desc','topicid,ptable,pkey,pid,pjson,userid,groupid,title,gaiyao,score,label,count_comment,count_view,iscommentshow,istop,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']);
|
||||
#应用扩展
|
||||
if($item['pjson']){
|
||||
$arrTopic[$key]['pjson'] = json_decode($item['pjson'],true);
|
||||
}
|
||||
}
|
||||
|
||||
$topicNum = $new ['topic']->findCount ( 'topic', array (
|
||||
'isaudit' => '0'
|
||||
) );
|
||||
|
||||
$pageUrl = pagination ( $topicNum, 20, $page, $url );
|
||||
|
||||
#推荐话题
|
||||
$arrRecommendTopic = $new['topic']->findAll('topic',array(
|
||||
'isrecommend'=>1,
|
||||
'isaudit'=>0,
|
||||
),'topicid desc','topicid,title',10);
|
||||
|
||||
#热门话题
|
||||
$arrHotTopic = $new['topic']->findAll('topic',array(
|
||||
'isaudit'=>0,
|
||||
),'count_comment desc','topicid,title',10);
|
||||
|
||||
include template('index');
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
switch($ts){
|
||||
|
||||
//移动帖子
|
||||
case "":
|
||||
|
||||
$topicid = tsIntval($_GET['topicid']);
|
||||
|
||||
if($topicid == 0) tsNotice("非法操作!");
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopic){
|
||||
|
||||
$strGroup = $new['topic']->find('group',array(
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
|
||||
if($strTopic['userid']==$userid || $strGroup['userid']==$userid || $TS_USER['isadmin']==1){
|
||||
|
||||
|
||||
if($TS_USER['isadmin']==1){
|
||||
#如果是系统管理员,就调出所有的群组
|
||||
$arrGroup = $new['topic']->findAll('group',array(
|
||||
'isaudit'=>0
|
||||
),'groupid desc','groupid,groupname');
|
||||
|
||||
}else{
|
||||
$arrGroups = $new['topic']->findAll('group_user',array(
|
||||
'userid'=>$strTopic['userid'],
|
||||
));
|
||||
foreach($arrGroups as $item){
|
||||
if($item['groupid'] != $strGroup['groupid']){
|
||||
|
||||
$arrGroup[] = $new['topic']->find('group',array(
|
||||
'groupid'=>$item['groupid'],
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$title = '移动帖子';
|
||||
include template("move");
|
||||
|
||||
}else{
|
||||
|
||||
tsNotice('非法操作!');
|
||||
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
|
||||
tsNotice('非法操作!');
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//执行移动
|
||||
case "do":
|
||||
|
||||
$groupid = tsIntval($_POST['groupid']);
|
||||
$topicid = tsIntval($_POST['topicid']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
if($strTopicid['userid']==$userid || $TS_USER['isadmin']==1){
|
||||
|
||||
$new['topic']->update('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),array(
|
||||
'groupid'=>$groupid,
|
||||
'typeid'=>'0',
|
||||
));
|
||||
|
||||
|
||||
header("Location: ".tsUrl('topic','show',array('id'=>$topicid)));
|
||||
}else{
|
||||
tsNotice('非法操作!');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
// 我的入口
|
||||
if (is_file ( 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php' )) {
|
||||
$userid = aac('user')->isLogin();
|
||||
$strUser = aac('user')->getOneUser($userid);
|
||||
include_once 'app/' . $TS_URL['app'] . '/action/my/' . $TS_URL['my'] . '.php';
|
||||
} else {
|
||||
qiMsg ( 'sorry:no index!' );
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
|
||||
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
$url = tsUrl ( 'topic', 'my', array ('my'=>'index','page' => '' ) );
|
||||
$lstart = $page * 20 - 20;
|
||||
|
||||
$arrTopic = $new['topic']->findAll('topic',array(
|
||||
'userid'=>$strUser['userid'],
|
||||
),'addtime desc',null,$lstart.',20');
|
||||
|
||||
$topicNum = $new ['topic']->findCount ( 'topic', array (
|
||||
'userid' => $strUser['userid'],
|
||||
) );
|
||||
|
||||
$pageUrl = pagination ( $topicNum, 20, $page, $url );
|
||||
|
||||
$title = '我的帖子';
|
||||
include template('my/index');
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
switch ($ts){
|
||||
|
||||
case "pay":
|
||||
|
||||
$userid = tsIntval($TS_USER['userid']);
|
||||
|
||||
if($userid==0){
|
||||
getJson('请登录后再支付!',1,0);
|
||||
}
|
||||
|
||||
$topicid = tsIntval($_POST['topicid']);
|
||||
|
||||
if($topicid==0){
|
||||
getJson('帖子不存在!',1,0);
|
||||
}
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
),'topicid,userid,score');
|
||||
|
||||
if($strTopic==''){
|
||||
getJson('帖子不存在!',1,0);
|
||||
}
|
||||
|
||||
if($strTopic['userid']==$userid){
|
||||
getJson('自己无需支付阅读自己的帖子!',1,0);
|
||||
}
|
||||
|
||||
$isTopicUser = $new['topic']->findCount('topic_user',array(
|
||||
'topicid'=>$topicid,
|
||||
'userid'=>$userid,
|
||||
));
|
||||
|
||||
if($isTopicUser>0){
|
||||
getJson('你已经支付过,无需再次支付!',1,0);
|
||||
}
|
||||
|
||||
$strUserScore = $new['topic']->find('user_info',array(
|
||||
'userid'=>$userid,
|
||||
),'userid,count_score');
|
||||
|
||||
if($strUserScore['count_score']<$strTopic['score']){
|
||||
getJson('积分不足!',1,0);
|
||||
}
|
||||
|
||||
aac('user')->addScore($strTopic['userid'],'帖子收入'.$strTopic['topicid'],$strTopic['score'],1);
|
||||
aac('user')->delScore($userid,'查看帖子'.$strTopic['topicid'],$strTopic['score']);
|
||||
|
||||
$new['topic']->create('topic_user',array(
|
||||
'topicid'=>$topicid,
|
||||
'userid'=>$userid,
|
||||
'addtime'=>time(),
|
||||
));
|
||||
|
||||
|
||||
getJson('积分支付成功!',1,2,tsUrl('topic','show',array('id'=>$topicid)));
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$topicid = tsIntval($_GET['id']);
|
||||
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
|
||||
|
||||
if($strTopic==''){
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
header("Status: 404 Not Found");
|
||||
$title = '404';
|
||||
include pubTemplate("404");
|
||||
exit;
|
||||
}
|
||||
|
||||
#永久性跳转到其他项目
|
||||
if($strTopic['ptable'] && $strTopic['pid']){
|
||||
Header("HTTP/1.1 301 Moved Permanently");
|
||||
header('Location: '.getProjectUrl($strTopic['ptable'],$strTopic['pid']));
|
||||
exit();
|
||||
}
|
||||
|
||||
//帖子审核
|
||||
if($strTopic['isaudit']==1 && $GLOBALS['TS_USER']['isadmin']==0){
|
||||
tsNotice('内容审核中......');
|
||||
}
|
||||
|
||||
|
||||
//小组信息
|
||||
if($strTopic['groupid']){
|
||||
$strGroup = aac('group')->getOneGroup($strTopic['groupid']);
|
||||
// 判断会员是否加入该小组
|
||||
$strGroupUser = array();
|
||||
if(tsIntval($TS_USER['userid'])){
|
||||
$strGroupUser = $new['topic']->find('group_user',array(
|
||||
'userid'=>tsIntval($TS_USER['userid']),
|
||||
'groupid'=>$strTopic['groupid'],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
// 浏览方式
|
||||
if ($strGroup['isopen'] == '1' && $strGroupUser == '') {
|
||||
$title = $strTopic['title'];
|
||||
include template("topic_isopen");exit;
|
||||
}elseif($strGroup['isopen'] == '1' && $strGroupUser && $TS_APP['ispayjoin']==1 && $strGroupUser['endtime']!='0000-00-00' && $strGroupUser['endtime']!='1970-01-01' && $strGroupUser['endtime'] <date('Y-m-d')){
|
||||
$title = $strTopic['title'];
|
||||
include template("topic_xuqi");exit;
|
||||
}
|
||||
|
||||
$strTopic['title'] = tsTitle($strTopic['title']);
|
||||
|
||||
$tpUrl = tpPage($strTopic['content'],'topic','show',array('id'=>$topicid));
|
||||
|
||||
$strTopic['content'] = tsDecode($strTopic['content'],$tp);
|
||||
|
||||
//判断是否评论后显示帖子内容
|
||||
$isComment = $new['topic']->findCount('comment', array(
|
||||
'ptable'=>'topic',
|
||||
'pkey'=>'topicid',
|
||||
'pid' => $strTopic['topicid'],
|
||||
'userid' => tsIntval($TS_USER['userid']),
|
||||
));
|
||||
|
||||
if($strTopic['iscommentshow']==1 && $isComment==0 && $strTopic['userid']!=tsIntval($TS_USER['userid'])){
|
||||
$strTopic['content'] = '<div class="alert alert-info">你需要回复后才可以浏览帖子内容!</div>';
|
||||
}
|
||||
|
||||
|
||||
//编辑的数据
|
||||
if($strTopic['userid']==$TS_USER['userid']){
|
||||
|
||||
if($strTopic['isdelete']=='1'){
|
||||
tsNotice('你的帖子删除中...');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 帖子分类
|
||||
if ($strTopic['typeid'] != '0'){
|
||||
$strTopic['type'] = $new['topic']->find('topic_type', array(
|
||||
'typeid' => $strTopic['typeid'],
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$strTopic['content'] = @preg_replace("/\[@(.*)\:(.*)]/U","<a href='".tsUrl('user','space',array('id'=>'$2'))." ' rel=\"face\" uid=\"$2\"'>@$1</a>",$strTopic['content']);
|
||||
|
||||
|
||||
|
||||
//处理通过小程序或者客户端发的图片
|
||||
$strTopic['photos'] = $new['topic']->getTopicPhoto($topicid);
|
||||
|
||||
|
||||
|
||||
#应用扩展
|
||||
$strProject = $new['topic']->getProject($strTopic['ptable'],$strTopic['pkey'],$strTopic['pid']);
|
||||
$strTopic['video'] = $strProject['video'];
|
||||
|
||||
|
||||
|
||||
// 帖子标签
|
||||
$strTopic['tags'] = aac('tag')->getObjTagByObjid('topic', 'topicid', $topicid);
|
||||
$strTopic['user'] = aac('user')->getSimpleUser($strTopic['userid']);
|
||||
|
||||
//把标签作为关键词
|
||||
if($strTopic['tags']){
|
||||
foreach($strTopic['tags'] as $key=>$item){
|
||||
$arrTag[] = $item['tagname'];
|
||||
}
|
||||
$sitekey = arr2str($arrTag);
|
||||
}else{
|
||||
$sitekey = $strTopic['title'];
|
||||
}
|
||||
//标题
|
||||
$title = $strTopic['title'];
|
||||
|
||||
|
||||
// 评论列表开始
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
$url = tsUrl('topic', 'show', array('id' => $topicid, 'page' => ''));
|
||||
$lstart = $page * 15-15;
|
||||
$arrComment = aac('comment')->getCommentList('topic','topicid',$strTopic['topicid'],$page,$lstart,$strTopic['userid']);
|
||||
$commentNum = aac('comment')->getCommentNum('topic','topicid',$strTopic['topicid']);
|
||||
$pageUrl = pagination($commentNum, 15, $page, $url);
|
||||
// 评论列表结束
|
||||
|
||||
|
||||
//7天内的热门帖子
|
||||
$arrHotTopic = $new['topic']->getHotTopic(7);
|
||||
|
||||
//推荐帖子
|
||||
$arrRecommendTopic = $new['topic']->getRecommendTopic();
|
||||
|
||||
|
||||
//本组热门帖子
|
||||
$arrGroupHotTopic = $new['topic']->findAll('topic',array(
|
||||
'groupid'=>$strGroup['groupid'],
|
||||
'isaudit'=>0,
|
||||
),'count_view desc','topicid,title',10);
|
||||
|
||||
// 最新帖子
|
||||
$newTopic = $new['topic']->findAll('topic',array(
|
||||
'isaudit'=>'0',
|
||||
),'addtime desc','topicid,title',10);
|
||||
|
||||
|
||||
|
||||
//判断用户可阅读帖子:0可读1不可读
|
||||
$isread = 0;
|
||||
if($strTopic['score']>0) $isread = 1;
|
||||
if($TS_USER['userid'] && $strTopic['userid']==$TS_USER['userid']) $isread=0;
|
||||
if($TS_USER['userid'] && $strTopic['userid']!=$TS_USER['userid'] && $strTopic['score']>0){
|
||||
$isTopicUser = $new['topic']->findCount('topic_user',array(
|
||||
'topicid'=>$topicid,
|
||||
'userid'=>$TS_USER['userid'],
|
||||
));
|
||||
if($isTopicUser>0) $isread=0;
|
||||
}
|
||||
if($TS_USER['isadmin']==1) $isread=0;
|
||||
|
||||
|
||||
|
||||
|
||||
$sitedesc = cututf8(t($strTopic['content']),0,100);
|
||||
|
||||
$content = $strTopic['content'];
|
||||
#钩子
|
||||
doAction('topic',$content);
|
||||
|
||||
include template('show');
|
||||
|
||||
// 增加浏览次数
|
||||
|
||||
$new['topic']->update('topic', array(
|
||||
'topicid' => $strTopic['topicid'],
|
||||
), array(
|
||||
'count_view' => $strTopic['count_view'] + 1,
|
||||
));
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$name = urldecode(tsUrlCheck($_GET['id']));
|
||||
|
||||
//$name=mb_convert_encoding($name,'UTF-8', 'GB2312'); //针对IIS环境可能出现的问题请取消此行注释
|
||||
|
||||
$strTag = aac('tag')->getTagByName($name);
|
||||
|
||||
$strTag['tagname'] = htmlspecialchars($strTag['tagname']);
|
||||
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
|
||||
$url = tsUrl('group','tag',array('id'=>urlencode($name),'page'=>''));
|
||||
|
||||
$lstart = $page*30-30;
|
||||
|
||||
$tagid = $strTag['tagid'];
|
||||
|
||||
$arrTagId = $new['topic']->findAll('tag_topic_index',array(
|
||||
'tagid'=>$tagid,
|
||||
),null,null,$lstart.',30');
|
||||
|
||||
foreach($arrTagId as $item){
|
||||
$strTopic = $new['topic']->find('topic',array(
|
||||
'topicid'=>$item['topicid'],
|
||||
));
|
||||
if($strTopic==''){
|
||||
$new['topic']->delete('tag_topic_index',array(
|
||||
'topicid'=>$item['topicid'],
|
||||
'tagid'=>$item['tagid'],
|
||||
));
|
||||
}else{
|
||||
$arrTopic[] = $strTopic;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
aac('tag')->countObjTag('topic',$tagid);
|
||||
|
||||
$topicNum = $new['topic']->findCount('tag_topic_index',array(
|
||||
'tagid'=>$tagid,
|
||||
));
|
||||
|
||||
$pageUrl = pagination($topicNum, 30, $page, $url);
|
||||
|
||||
foreach($arrTopic as $key=>$item){
|
||||
$arrTopic[$key]['title'] = htmlspecialchars($item['title']);
|
||||
$arrTopic[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
|
||||
$arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
|
||||
}
|
||||
|
||||
//热门tag
|
||||
$arrTag = $new['topic']->findAll('tag',"`count_topic`>'0' and `isaudit`=0",'uptime desc',null,30);
|
||||
|
||||
$sitekey = $strTag['tagname'];
|
||||
$title = $strTag['tagname'];
|
||||
|
||||
include template("tag");
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$page = tsIntval($_GET['page'],1);
|
||||
|
||||
$url = tsUrl('topic','tags',array('page'=>''));
|
||||
|
||||
$lstart = $page*200-200;
|
||||
|
||||
$arrTag = $new['topic']->findAll('tag',"`count_topic`>'0' and `isaudit`=0",'uptime desc',null,$lstart.',200');
|
||||
|
||||
$tagNum = $new['topic']->findCount('tag',"`count_topic`>'0' and `isaudit`=0");
|
||||
|
||||
$pageUrl = pagination($tagNum, 200, $page, $url);
|
||||
|
||||
$title = '标签';
|
||||
include template('tags');
|
||||
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
class topic extends tsApp {
|
||||
|
||||
//构造函数
|
||||
public function __construct($db) {
|
||||
$tsAppDb = array();
|
||||
include 'app/topic/config.php';
|
||||
//判断APP是否采用独立数据库
|
||||
if ($tsAppDb) {
|
||||
$db = new MySql($tsAppDb);
|
||||
}
|
||||
|
||||
parent::__construct($db);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取一条帖子信息
|
||||
*
|
||||
* @param [type] $topicid
|
||||
* @return void
|
||||
*/
|
||||
public function getOneTopic($topicid){
|
||||
$strTopic = $this->find('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
return $strTopic;
|
||||
}
|
||||
|
||||
//是否存在帖子
|
||||
public function isTopic($topicid){
|
||||
$isTopic = $this->findCount('topic',array(
|
||||
'topicid'=>$topicid,
|
||||
));
|
||||
if($isTopic > 0){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除帖子
|
||||
*
|
||||
* @param array $strTopic
|
||||
* @return void
|
||||
*/
|
||||
public function deleteTopic($strTopic=array()){
|
||||
|
||||
$this->delete('topic',array('topicid'=>$strTopic['topicid']));
|
||||
$this->delete('tag_topic_index',array('topicid'=>$strTopic['topicid']));
|
||||
|
||||
|
||||
#删除评论ts_comment
|
||||
aac('comment')->delComment('topic','topicid',$strTopic['topicid']);
|
||||
|
||||
#删除点赞ts_love
|
||||
aac('pubs')->delLove('topic','topicid',$strTopic['topicid']);
|
||||
|
||||
|
||||
#删除图片ts_topic_photo
|
||||
$arrPhoto = $this->findAll('topic_photo',array(
|
||||
'topicid'=>$strTopic['topicid'],
|
||||
));
|
||||
|
||||
if($arrPhoto){
|
||||
foreach($arrPhoto as $key=>$item){
|
||||
unlink('uploadfile/group/topic/photo/'.$item['photo']);
|
||||
tsDimg($item['photo'],'group/topic/photo','320','320',$item['path'],1);
|
||||
tsDimg($item['photo'],'group/topic/photo','640','',$item['path']);
|
||||
}
|
||||
$this->delete('topic_photo',array('topicid'=>$strTopic['topicid']));
|
||||
}
|
||||
|
||||
$this->countTopic($strTopic['groupid']);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* 统计小组里的话题并更新到小组
|
||||
*/
|
||||
public function countTopic($groupid){
|
||||
$count_topic = $this->findCount('topic',array(
|
||||
'groupid'=>$groupid,
|
||||
));
|
||||
|
||||
$this->update('group',array(
|
||||
'groupid'=>$groupid,
|
||||
),array(
|
||||
'count_topic'=>$count_topic,
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
//热门帖子,1天,7天,30天
|
||||
public function getHotTopic($day){
|
||||
$startTime = time()-($day*3600*24);
|
||||
|
||||
$endTime = time();
|
||||
|
||||
$arr = "`addtime`>'$startTime' and `count_view`>'0' and `addtime`<'$endTime' and `isaudit`='0'";
|
||||
|
||||
$arrTopic = $this->findAll('topic',$arr,'addtime desc','topicid,title,count_view,count_comment',10);
|
||||
foreach($arrTopic as $key=>$item){
|
||||
$arrTopic[$key]['title']=tsTitle($item['title']);
|
||||
}
|
||||
|
||||
return $arrTopic;
|
||||
|
||||
}
|
||||
|
||||
//获取推荐的帖子(全部推荐和小组推荐)
|
||||
public function getRecommendTopic($groupid=null,$num=20){
|
||||
if($groupid){
|
||||
$arr = array(
|
||||
'groupid'=>$groupid,
|
||||
'isrecommend'=>1,
|
||||
'isaudit'=>0,
|
||||
);
|
||||
}else{
|
||||
$arr = array(
|
||||
'isrecommend'=>1,
|
||||
'isaudit'=>0,
|
||||
);
|
||||
}
|
||||
$arrTopic = $this->findAll('topic',$arr,'addtime desc','topicid,title',$num);
|
||||
|
||||
foreach($arrTopic as $key=>$item){
|
||||
$arrTopic[$key]['title']=tsTitle($item['title']);
|
||||
}
|
||||
|
||||
return $arrTopic;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取帖子图片,处理通过小程序或者客户端发的图片
|
||||
*/
|
||||
public function getTopicPhoto($topicid,$num=null){
|
||||
$arrPhotos = $this->findAll('topic_photo',array(
|
||||
'topicid'=>$topicid,
|
||||
),'orderid asc',null,$num);
|
||||
foreach($arrPhotos as $key=>$item){
|
||||
if($num){
|
||||
$arrPhoto[$key] = tsXimg($item['photo'],'group/topic/photo','320','320',$item['path'],1);
|
||||
}else{
|
||||
$arrPhoto[$key] = tsXimg($item['photo'],'group/topic/photo','640','',$item['path']);
|
||||
}
|
||||
}
|
||||
return $arrPhoto;
|
||||
}
|
||||
|
||||
|
||||
public function getProject($ptable,$pkey,$pid){
|
||||
if($ptable && $pkey && $pid){
|
||||
|
||||
$strProject = $this->find($ptable,array(
|
||||
$pkey=>$pid,
|
||||
));
|
||||
|
||||
if($ptable=='article'){
|
||||
########文章########
|
||||
$strProject['title'] = tsTitle($strProject['title']);
|
||||
$strProject['content'] = tsDecode($strProject['content']);
|
||||
#处理正文样式和图片
|
||||
$strProject['content'] = mobileHtml($strProject['content']);
|
||||
if($strProject['photo']){
|
||||
$strProject['photo'] = tsXimg($strProject['photo'],'article',640,360,$strProject['path'],'1');
|
||||
}
|
||||
$topicInfo['article'] = $strProject;
|
||||
|
||||
}elseif($ptable=='video'){
|
||||
########视频########
|
||||
$topicInfo['video'] = SITE_URL.'uploadfile/video/'.$strProject['video'];
|
||||
|
||||
}
|
||||
|
||||
return $topicInfo;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$skin = 'default';
|
||||
|
||||
$TS_APP['appname'] = '话题';
|
||||
@@ -0,0 +1,190 @@
|
||||
{php include pubTemplate("header")}
|
||||
<div class="container">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group')}">小组</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup[groupname]}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">发布帖子</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=topic&ac=add&ts=do&groupid={$groupid}" enctype="multipart/form-data">
|
||||
|
||||
<div class="form-group">
|
||||
<label>标题</label>
|
||||
<input name="title" type="text" class="form-control" value="{if $strDraft['title']}{tsTitle($strDraft['title'])}{/if}">
|
||||
</div>
|
||||
|
||||
{if $arrGroupType}
|
||||
<div class="form-group">
|
||||
<label>类型</label>
|
||||
|
||||
<select name="typeid" class="form-control">
|
||||
<option value="0">选择类型</option>
|
||||
{loop $arrGroupType $key $item}
|
||||
<option value="{$item[typeid]}">{$item[typename]}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>内容</label>
|
||||
<div>
|
||||
<textarea id="tseditor" name="content">{if $strDraft['content']}{php echo tsDecode($strDraft['content'])}{/if}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>标签</label>
|
||||
<input name="tag" type="text" class="form-control">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>评论</label>
|
||||
|
||||
<input type="radio" checked="select" name="iscomment" value="0" />允许 <input type="radio" name="iscomment" value="1" />不允许
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>回复可读</label>
|
||||
|
||||
<input type="radio" checked="select" name="iscommentshow" value="0" />不需要 <input type="radio" name="iscommentshow" value="1" />需要
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>查看需要</label>
|
||||
<input type="text" name="score" value="0" onkeyup="NumberCheck(this)" /> 积分
|
||||
</div>
|
||||
|
||||
|
||||
<!--匿名发布-->
|
||||
{if $TS_SITE['isniming']==1}
|
||||
<div class="form-group">
|
||||
<label>匿名发布:</label>
|
||||
<input type="radio" name="isniming" value="0" checked> 否
|
||||
<input type="radio" name="isniming" value="1"> 是 <span class="text-danger">(匿名发布后用户将无法对内容进行管理)</span>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<!--图片验证码-->
|
||||
{if $TS_SITE['isauthcode']}
|
||||
<div class="form-group">
|
||||
<label>验证码:</label>
|
||||
|
||||
<div class="offset-0">
|
||||
<input class="form-control form-control-sm w-auto float-left mr-1" name="authcode" />
|
||||
<img class="mt-1" src="{SITE_URL}index.php?app=pubs&ac=code" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<!--人机验证-->
|
||||
{if $TS_SITE['is_vaptcha']}
|
||||
<div class="form-group">
|
||||
<label>人机验证:</label>
|
||||
|
||||
<div class="offset-0">
|
||||
|
||||
<div id="vaptchaContainer" style="width: 300px;height: 36px;">
|
||||
<div class="vaptcha-init-main">
|
||||
<div class="vaptcha-init-loading">
|
||||
<a href="/" target="_blank">
|
||||
<img src="https://r.vaptcha.net/public/img/vaptcha-loading.gif" />
|
||||
</a>
|
||||
<span class="vaptcha-text">Vaptcha启动中...</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://v-cn.vaptcha.com/v3.js"></script>
|
||||
<script>
|
||||
vaptcha({
|
||||
vid: '{$TS_SITE[vaptcha_vid]}',
|
||||
mode: 'click',
|
||||
scene: 0, // 场景值 默认0
|
||||
container: '#vaptchaContainer',
|
||||
area: 'auto' //验证节点区域,默认 auto,可选值 auto,sea,na,cn
|
||||
}).then(function (vaptchaObj) {
|
||||
vaptchaObj.render()
|
||||
vaptchaObj.renderTokenInput('#vaptcha-token')
|
||||
})
|
||||
</script>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="vaptcha-token"></div>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="groupid" value="{$strGroup[groupid]}" />
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
|
||||
|
||||
|
||||
<button class="btn btn-sm btn-info" type="submit">点击发布</button>
|
||||
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{tsUrl('group','show',array('id'=>$strGroup[groupid]))}">返回小组</a>
|
||||
|
||||
<p></p>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{php doAction('tseditor')}
|
||||
<script>
|
||||
//自动保存到草稿箱
|
||||
var int=self.setInterval('toDraft()',60000);//轮询执行,一分钟一次
|
||||
function toDraft() {
|
||||
$(document).ready(function() {
|
||||
var title = $('input[name="title"]').val();
|
||||
var content = $('textarea[name="content"]').val();
|
||||
$.post(siteUrl+'index.php?app=pubs&ac=draft',{'types':'topic','title':title,'content':content},function (rs) {
|
||||
if(rs.status==1){
|
||||
tsAlert(rs.msg)
|
||||
}
|
||||
},'json')
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
<div class="tabnav">
|
||||
<h6>话题管理</h6>
|
||||
<ul>
|
||||
<li {if $mg=='options'}class="select"{/if}><a href="{SITE_URL}index.php?app=topic&ac=admin&mg=options">帖子配置</a></li>
|
||||
|
||||
<li {if $mg=='permissions'}class="select"{/if}><a href="{SITE_URL}index.php?app=topic&ac=admin&mg=permissions">权限配置</a></li>
|
||||
|
||||
<li {if $mg=='topic' && $ts=='list'}class="select"{/if}><a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=list">帖子列表</a></li>
|
||||
|
||||
<li {if $mg=='topic' && $ts=='deletetopic'}class="select"{/if}><a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=deletetopic">删除的帖子</a></li>
|
||||
<li {if $mg=='topic' && $ts=='edittopic'}class="select"{/if}><a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=edittopic">修改的帖子</a></li>
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div style="height: 100px;"></div>
|
||||
@@ -0,0 +1,29 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include template("admin/menu");}
|
||||
|
||||
<form method="POST" action="index.php?app=topic&ac=admin&mg=options&ts=do">
|
||||
<table class="table table-hover">
|
||||
<tr><td width="150">APP名称:</td><td><input style="width:300px;" name="option[appname]" value="{$strOption[appname]}" /></td></tr>
|
||||
|
||||
<tr><td>APP介绍:</td><td><textarea style="width:300px;" name="option[appdesc]">{$strOption[appdesc]}</textarea></td></tr>
|
||||
|
||||
<tr><td>APP关键词:</td><td><input style="width:300px;" name="option[appkey]" value="{$strOption[appkey]}" /></td></tr>
|
||||
|
||||
|
||||
|
||||
<tr><td>会员发布:</td><td><input type="radio" name="option[allowpost]" value="0" {if $strOption['allowpost']=='0'}checked{/if} />允许 <input type="radio" name="option[allowpost]" value="1" {if $strOption['allowpost']=='1'}checked{/if} />不允许</td></tr>
|
||||
<tr><td>是否审核:</td><td><input type="radio" name="option[isaudit]" value="0" {if $strOption['isaudit']=='0'}checked{/if} />不审核 <input type="radio" name="option[isaudit]" value="1" {if $strOption['isaudit']=='1'}checked{/if} />审核</td></tr>
|
||||
|
||||
|
||||
<tr><td></td><td>
|
||||
<input class="btn btn-primary" type="submit" value="提交修改" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,130 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<div class="midder">
|
||||
|
||||
{php include template("admin/menu");}
|
||||
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
{loop $arrUg $key $item}
|
||||
<a class="btn btn-sm {if $item['ugid']==$ugid}btn-secondary{else}btn-outline-secondary{/if}" href="{SITE_URL}index.php?app=topic&ac=admin&mg=permissions&ugid={$item['ugid']}">{$item['ugname']}</a>
|
||||
{/loop}
|
||||
</div>
|
||||
|
||||
|
||||
<form method="POST" action="index.php?app=topic&ac=admin&mg=permissions&ts=do">
|
||||
|
||||
|
||||
<h6 class="font-weight-bold fs14">前台权限</h6>
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
<tr>
|
||||
<td width="150">查看帖子:</td>
|
||||
<td>
|
||||
<select name="option[topic_show]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_show']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_show']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!--不允许游客发布、修改、删除-->
|
||||
{if $ugid==1 || $ugid==2 || $ugid==3}
|
||||
<tr>
|
||||
<td>发布帖子:</td>
|
||||
<td>
|
||||
<select name="option[topic_add]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_add']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_add']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>修改帖子:</td>
|
||||
<td>
|
||||
<select name="option[topic_edit]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_edit']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_edit']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>删除帖子:</td>
|
||||
<td>
|
||||
<select name="option[topic_delete]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_delete']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_delete']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<!--管理权限-->
|
||||
{if $ugid==1 || $ugid==2}
|
||||
<h6 class="font-weight-bold fs14">后台权限</h6>
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<td width="150">帖子配置:</td>
|
||||
<td>
|
||||
<select name="option[topic_admin_options]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_admin_options']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_admin_options']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>权限配置:</td>
|
||||
<td>
|
||||
<select name="option[topic_admin_permissions]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_admin_permissions']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_admin_permissions']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<h6 class="font-weight-bold fs14">API权限</h6>
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
<tr>
|
||||
<td width="150">查看帖子:</td>
|
||||
<td>
|
||||
<select name="option[topic_api_show]">
|
||||
<option value="1" {if $TS_APP['permissions'][$ugid]['topic_api_show']==1}selected{/if}>允许</option>
|
||||
<option value="0" {if $TS_APP['permissions'][$ugid]['topic_api_show']==0}selected{/if}>拒绝</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<input type="hidden" name="ugid" value="{$ugid}">
|
||||
|
||||
<input class="btn btn-primary" type="submit" value="提交修改" />
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,37 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<!--main-->
|
||||
<div class="midder">
|
||||
|
||||
{php include template("admin/menu");}
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
<thead class="thead-light">
|
||||
<tr><th>ID</th><th>UserID</th><th>标题</th><th>时间</th><th>操作</th></tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
|
||||
{loop $arrTopic $key $item}
|
||||
<tr><td>{$item['topicid']}</td><td>{$item['userid']}</td>
|
||||
|
||||
<td>
|
||||
|
||||
<a target="_blank" href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{$item['title']}</a></td>
|
||||
|
||||
<td>{php echo date('Y-m-d H:i:s',$item['addtime'])}</td><td>
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=delete&topicid={$item['topicid']}">删除</a>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,45 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<!--main-->
|
||||
<div class="midder">
|
||||
|
||||
{php include template("admin/menu");}
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
|
||||
<thead>
|
||||
|
||||
<tr><th>ID</th><th>标题</th><th>时间</th><th>状态</th><th>操作</th></tr>
|
||||
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
<tbody>
|
||||
|
||||
{loop $arrTopic $key $item}
|
||||
<tr><td>{$item['topicid']}</td><td><a href="index.php?app=topic&ac=admin&mg=topic&ts=editview&topicid={$item['topicid']}">{$item['title']}</a></td><td>{$item['addtime']}</td><td>{if $item['isupdate']==1}<font color="green">已更新</font>{else}未更新{/if}</td><td>
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=update&topicid={$item['topicid']}">更新</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,18 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<!--main-->
|
||||
<div class="midder">
|
||||
|
||||
{php include template("admin/menu");}
|
||||
|
||||
<div class="mb10"> <a class="btn mr10" href="index.php?app=topic&ac=admin&mg=topic&ts=edittopic">返回</a> <a class="btn mr10" href="index.php?app=topic&ac=admin&mg=topic&ts=update&topicid={$strTopic['topicid']}">更新数据</a></div>
|
||||
|
||||
<div>
|
||||
<h1>{$strTopic['title']}</h1>
|
||||
<div>{$strTopic['content']}</div>
|
||||
<div style="clear:both"></div>
|
||||
<div>{$strTopic['addtime']}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,119 @@
|
||||
{php include pubTemplate("header_admin")}
|
||||
|
||||
<!--main-->
|
||||
<div class="midder">
|
||||
|
||||
{php include template("admin/menu");}
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
|
||||
|
||||
|
||||
<div class="mb-3">
|
||||
|
||||
|
||||
<form method="get" action="index.php">
|
||||
<input type="hidden" name="app" value="topic">
|
||||
<input type="hidden" name="ac" value="admin">
|
||||
<input type="hidden" name="mg" value="topic">
|
||||
<input type="hidden" name="ts" value="list">
|
||||
|
||||
<input type="number" name="topicid" placeholder="帖子ID">
|
||||
<input type="text" name="kw" placeholder="标题模糊">
|
||||
|
||||
<input type="submit" value="搜索">
|
||||
|
||||
|
||||
|
||||
<a class="btn btn-sm btn-outline-secondary" href="index.php?app=topic&ac=admin&mg=topic&ts=list">全部</a>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="index.php?app=topic&ac=admin&mg=topic&ts=list&isrecommend=1">推荐</a>
|
||||
<a class="btn btn-sm btn-outline-secondary" href="index.php?app=topic&ac=admin&mg=topic&ts=list&istop=1">置顶</a>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<table class="table table-hover">
|
||||
|
||||
<thead class="thead-light fs14">
|
||||
<tr>
|
||||
<th>帖子ID</th>
|
||||
<th>用户ID</th>
|
||||
<th>圈子ID</th>
|
||||
<th>标题</th>
|
||||
<th>统计</th>
|
||||
<th>时间</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
<tbody class="fs12">
|
||||
|
||||
|
||||
|
||||
{loop $arrTopic $key $item}
|
||||
<tr>
|
||||
<td>{$item['topicid']}</td>
|
||||
<td>{$item['userid']}</td>
|
||||
<td>{$item['groupid']}</td>
|
||||
<td><a target="_blank" href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{tsTitle($item['title'])}</a></td>
|
||||
|
||||
|
||||
<td>
|
||||
浏览:{$item['count_view']}<br>
|
||||
评论:{$item['count_comment']}
|
||||
</td>
|
||||
|
||||
<td>{php echo date('Y-m-d H:i:s',$item['addtime'])}</td>
|
||||
<td>
|
||||
|
||||
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=isrecommend&topicid={$item['topicid']}">
|
||||
{if $item['isrecommend']==0}
|
||||
推荐
|
||||
{else}
|
||||
<font color="green">取消推荐</a>
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
|
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=isaudit&topicid={$item['topicid']}">
|
||||
{if $item['isaudit']==0}
|
||||
已审核
|
||||
{else}
|
||||
<font color="red">未审核</a>
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
|
|
||||
|
||||
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=istop&topicid={$item['topicid']}">
|
||||
{if $item['istop']==0}
|
||||
置顶
|
||||
{else}
|
||||
<font color="green">取消置顶</a>
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
| <a target="_blank" href="{SITE_URL}index.php?app=topic&ac=topicmove&topicid={$item['topicid']}">移动</a>
|
||||
| <a onclick="return confirm('确定删除?')" href="{SITE_URL}index.php?app=topic&ac=admin&mg=topic&ts=delete&topicid={$item['topicid']}&groupid={$item['groupid']}">删除</a>
|
||||
|
||||
</td></tr>
|
||||
{/loop}
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer_admin")}
|
||||
@@ -0,0 +1,119 @@
|
||||
{php include pubTemplate("header")}
|
||||
<div class="container">
|
||||
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group')}">小组</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup[groupname]}</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('topic','show',array('id'=>$strTopic['topicid']))}">{$strTopic['title']}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">编辑帖子</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-2"></div>
|
||||
<div class="col-md-8">
|
||||
|
||||
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=topic&ac=edit&ts=do" enctype="multipart/form-data">
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>标题</label>
|
||||
<input name="title" type="text" class="form-control" value="{$strTopic['title']}">
|
||||
</div>
|
||||
|
||||
{if $arrGroupType}
|
||||
<div class="form-group">
|
||||
<label>类型</label>
|
||||
|
||||
<select name="typeid" class="form-control">
|
||||
<option {if $strTopic[typeid]=='0'}selected="select"{/if} value="0">请选择</option>
|
||||
{loop $arrGroupType $key $item}
|
||||
<option {if $item[typeid]==$strTopic[typeid]}selected="select"{/if} value="{$item[typeid]}">{$item[typename]}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>内容</label>
|
||||
|
||||
<div>
|
||||
<textarea id="tseditor" name="content">{$strTopic['content']}</textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>标签</label>
|
||||
<input name="tag" type="text" class="form-control" value="{$strTopic['tag']}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>评论</label>
|
||||
|
||||
<input type="radio" name="iscomment" value="0" {if $strTopic[iscomment]=='0'}checked="select"{/if} />允许
|
||||
<input type="radio" name="iscomment" value="1" {if $strTopic[iscomment]=='1'}checked="select"{/if} />不允许
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>回复可读</label>
|
||||
|
||||
<input type="radio" name="iscommentshow" value="0" {if $strTopic[iscommentshow]=='0'}checked="select"{/if} />不需要
|
||||
<input type="radio" name="iscommentshow" value="1" {if $strTopic[iscommentshow]=='1'}checked="select"{/if} />需要
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>查看需要</label>
|
||||
<input type="text" name="score" value="{$strTopic['score']}" onkeyup="NumberCheck(this)" /> 积分
|
||||
</div>
|
||||
|
||||
{if $TS_SITE['isauthcode']}
|
||||
<div class="form-group">
|
||||
<label>验证码</label>
|
||||
|
||||
<input name="authcode" />
|
||||
<img align="absmiddle" src="{SITE_URL}index.php?app=pubs&ac=code" onclick="newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
<input type="hidden" name="topicid" value="{$strTopic[topicid]}" />
|
||||
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
|
||||
<button class="btn btn-sm btn-info" type="submit">修改帖子</button>
|
||||
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{tsUrl('topic','show',array('id'=>$strTopic[topicid]))}">返回</a>
|
||||
<p></p>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{php doAction('tseditor')}
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,42 @@
|
||||
{php include pubTemplate("header")}
|
||||
<div class="container">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('topic')}">话题</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">选择发帖小组</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<h1 class="h3 text-center">选择发帖小组</h1>
|
||||
<hr>
|
||||
|
||||
<div class="d-flex flex-wrap justify-content-center">
|
||||
|
||||
{loop $arrGroup $key $item}
|
||||
<div class="m-3" style="width: 100px;text-align: center;">
|
||||
<a href="{tsUrl('topic','add',array('groupid'=>$item['groupid']))}"><img class="mw-100 rounded" src="{$item['photo']}"></a>
|
||||
<div class="fs16">{$item['groupname']}</div>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,151 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{$TS_APP['appname']}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<div class="page mt-3">{$pageUrl}</div>
|
||||
|
||||
|
||||
{else}
|
||||
|
||||
<div class="c9">暂无话题</div>
|
||||
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">推荐话题</div>
|
||||
<div class="card-body commlist">
|
||||
<ul>
|
||||
{loop $arrRecommendTopic $key $item}
|
||||
<li>
|
||||
<a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{php echo tsTitle($item['title'])}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">热门话题</div>
|
||||
<div class="card-body commlist">
|
||||
<ul>
|
||||
{loop $arrHotTopic $key $item}
|
||||
<li>
|
||||
<a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{php echo tsTitle($item['title'])}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--广告位-->
|
||||
{php doAction('gobad','300')}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,52 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3"></div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="h5 font-weight-bold">移动帖子:{tsTitle($strTopic['title'])}</h1>
|
||||
<hr>
|
||||
|
||||
{if $arrGroup}
|
||||
<form method="POST" action="{SITE_URL}index.php?app=topic&ac=move&ts=do">
|
||||
|
||||
<div class="form-group">
|
||||
<label>选择要转移的小组:</label>
|
||||
<select name="groupid" class="form-control">
|
||||
{loop $arrGroup $key $item}
|
||||
<option value="{$item['groupid']}">{tsTitle($item['groupname'])}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<input type="hidden" name="topicid" value="{$topicid}" />
|
||||
|
||||
<button class="btn btn-sm btn-info" type="submit">移动</button>
|
||||
|
||||
<a class="btn btn-sm btn-outline-secondary" href="{tsUrl('topic','show',array('id'=>$topicid))}">返回</a>
|
||||
</form>
|
||||
{else}
|
||||
<div>
|
||||
没有可以移动的小组! <a class="btn btn-sm btn-outline-secondary" href="{tsUrl('topic','show',array('id'=>$topicid))}">返回</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,62 @@
|
||||
{php include pubTemplate("header")}
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<div class="my_left">
|
||||
|
||||
{php include pubTemplate("my")}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">我发布的帖子</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr><th>发布时间</th><th>标题</th><th>浏览/评论</th><th>操作</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop $arrTopic $key $item}
|
||||
<tr><td>{php echo date('Y-m-d',$item['addtime'])}</td><td><a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{php echo tsTitle($item['title'])}</a></td><td>{$item['count_view']}/{$item['count_comment']}</td>
|
||||
|
||||
<td><a class="btn btn-sm btn-outline-secondary" href="{tsUrl('topic','edit',array('topicid'=>$item['topicid']))}">修改</a></td></tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,289 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
{if $strTopic['groupid']}
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group')}">小组</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup['groupname']}</a></li>
|
||||
{else}
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('topic')}">{$TS_APP['appname']}</a></li>
|
||||
{/if}
|
||||
<li class="breadcrumb-item active" aria-current="page">{$strTopic['title']}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-8">
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<h1 class="h5 pt-0 pb-3 font-weight-bold">{if $strTopic['label']}<span class="badge badge-danger fw300">{tsTitle($strTopic['label'])}</span>{/if}{if $strTopic['typeid'] !='0'}<a href="{tsUrl('group','show',array('id'=>$strTopic['groupid'],typeid=>$strTopic['typeid']))}">[{$strTopic['type']['typename']}]</a>{/if}{$strTopic['title']}</h1>
|
||||
|
||||
|
||||
<div class="d-flex flex-row justify-content-between">
|
||||
|
||||
|
||||
<div class="d-flex">
|
||||
|
||||
|
||||
<div>
|
||||
<a href="{tsUrl('user','space',array('id'=>$strTopic['user']['userid']))}">
|
||||
<img class="rounded-circle" title="{$strTopic['user']['username']}" alt="{$strTopic['user']['username']}" src="{$strTopic['user']['face']}" width="36" height="36">
|
||||
</a>
|
||||
</div>
|
||||
<div class="ml-2">
|
||||
<div class="fs14"><a href="{tsUrl('user','space',array('id'=>$strTopic['userid']))}">{$strTopic['user']['username']}</a></div>
|
||||
<div class="c9 fs12">{php echo date('Y-m-d H:i:s',$strTopic['addtime'])}</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="d-flex flex-row justify-content-end c9">
|
||||
|
||||
<div><i class="bi-chat-text"></i> {$strTopic['count_comment']}</div>
|
||||
<div class="ml-3"><i class="bi bi-eye"></i> {$strTopic['count_view']}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="mb-3 mt-3">
|
||||
{loop $strTopic[tags] $key $item}
|
||||
<a class="badge badge-secondary fw300 mr-2" href="{tsUrl('topic','tag',array('id'=>urlencode($item['tagname'])))}">{$item['tagname']}</a>
|
||||
{/loop}
|
||||
</div>
|
||||
|
||||
|
||||
{if $page == '1'}
|
||||
<div class="topic-content">
|
||||
|
||||
|
||||
{if $isread==1}
|
||||
<div class="alert alert-info">查看帖子需要支付 <span class="text-danger">{$strTopic['score']}积分</span> <a class="btn btn-sm btn-success" href="javascript:void('0');" onclick="tsPost('index.php?app=topic&ac=score&ts=pay',{'topicid':'{$topicid}'})">支付</a></div>
|
||||
{else}
|
||||
|
||||
|
||||
<div class="topic-view common-content">
|
||||
{$strTopic['content']}
|
||||
|
||||
|
||||
{if $strTopic['photos']}
|
||||
{loop $strTopic['photos'] $key $item}
|
||||
<p class="tac"><img src="{$item}" alt="{$strTopic['title']}"></p>
|
||||
{/loop}
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{if $strTopic['video']}
|
||||
<p>
|
||||
<video class="mw-100" controls="controls" src="{$strTopic['video']}"></video>
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
|
||||
{$tpUrl}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
<!--帖子内容底部插件钩子-->
|
||||
<div>{php doAction('topic_footer')}</div>
|
||||
|
||||
<div class="mt-3">{php doAction('gobad','468')}</div>
|
||||
|
||||
|
||||
|
||||
{if $TS_USER['userid'] == $strTopic['userid'] || $TS_USER['userid']==$strGroup['userid'] || $strGroupUser['isadmin']=='1' || $TS_USER['isadmin']=='1'}
|
||||
<div class="btool mt-3">
|
||||
{if $TS_USER['userid']==$strGroup['userid'] ||$strGroupUser['isadmin']=="1" || $TS_USER['isadmin']=="1"}
|
||||
|
||||
|
||||
<a href="#" data-toggle="modal" data-target="#bookModal"><i class="bi bi-bookmark-check"></i> 标注</a>
|
||||
|
||||
|
||||
<a href="javascript:void('0');" onclick="topicAudit('{$strTopic['topicid']}','{$_SESSION['token']}');">{if $strTopic['isaudit']=='1'}审核{else}取消审核{/if}</a>
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=ajax&ts=topic_istop&topicid={$strTopic['topicid']}">{if $strTopic['istop']=='0'}置顶{else}取消置顶{/if}</a>
|
||||
|
||||
<a href="javascript:void('0');" onclick="tsPost('index.php?app=topic&ac=ajax&ts=isrecommend&js=1',{'topicid':'{$strTopic['topicid']}'})">{if $strTopic['isrecommend']=='0'}推荐{else}取消推荐{/if}</a>
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=ajax&ts=isposts&topicid={$strTopic['topicid']}&token={$_SESSION['token']}">{if $strTopic['isposts']==0}精华{else}取消精华{/if}</a>
|
||||
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=move&topicid={$strTopic['topicid']}">移动</a>
|
||||
|
||||
{/if}
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=edit&topicid={$strTopic['topicid']}">编辑</a>
|
||||
<a href="{SITE_URL}index.php?app=topic&ac=delete&topicid={$strTopic['topicid']}&token={$_SESSION['token']}" onClick="return confirm('确定删除吗?')"><i class="bi bi-trash"></i> 删除</a>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">评论{if $strTopic['count_comment']} <small class="text-secondary">({$strTopic['count_comment']})</small>{/if}</div>
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
|
||||
<!--评论列表-->
|
||||
{php include pubTemplate("comment")}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="commentform">
|
||||
|
||||
{if $strTopic[iscomment] == 1}
|
||||
<div class="tac pd20 fw300 text-black-50">此内容暂不接受评论!</div>
|
||||
{else}
|
||||
|
||||
|
||||
|
||||
{if tsIntval($TS_USER[userid])==0}
|
||||
<div class="tac pd20 fw300">
|
||||
<a href="{tsUrl('user','login')}">登录</a> | <a href="{tsUrl('user','register')}">注册</a>
|
||||
</div>
|
||||
{else}
|
||||
|
||||
<form id="comm-form" method="post" action="{SITE_URL}index.php?app=comment&ac=add">
|
||||
<div >
|
||||
<textarea id="tseditor" name="content"></textarea>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col-md-6">
|
||||
{if $TS_SITE['isauthcode']}
|
||||
<input class="form-control form-control-sm w-auto float-left" name="authcode" placeholder="输入验证码" />
|
||||
<img class="mt-1 ml-1" src="{tsUrl('pubs','code')}" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="mt-1">是否公开:<input type="radio" name="ispublic" value="0" checked />公开 <input type="radio" name="ispublic" value="1" />不公开</div>
|
||||
</div>
|
||||
<div class="col-md-2 text-right">
|
||||
<input type="hidden" name="ptable" value="topic">
|
||||
<input type="hidden" name="pkey" value="topicid">
|
||||
<input type="hidden" name="pid" value="{$strTopic['topicid']}" />
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
<button class="btn btn-sm btn-info btn-block" type="submit">提交评论</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
|
||||
{php doAction('gobad','topic_right_top')}
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">最新帖子</div>
|
||||
<div class="card-body commlist">
|
||||
<ul>
|
||||
{loop $newTopic $key $item}
|
||||
<li>
|
||||
<a href="{tsUrl('topic','show',array('id'=>$item[topicid]))}">{php echo tsTitle($item[title])}</a>
|
||||
</li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">热门帖子</div>
|
||||
<div class="card-body commlist">
|
||||
<ul>
|
||||
{loop $arrHotTopic $key $item}
|
||||
<li><a href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{$item['title']}</a></li>
|
||||
{/loop}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="clear"></div>
|
||||
<!--广告位-->
|
||||
{php doAction('gobad','300')}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="bookModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="exampleModalLabel">标注</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="book-text" class="col-form-label">请输入标注内容(最多8个字符):</label>
|
||||
<input type="text" value="{tsTitle($strTopic['label'])}" class="form-control" id="book-text">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="text-danger" id="book-alert"></div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary btn-sm" onclick="toBook('{$topicid}')">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{php doAction('tseditor','mini')}
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,90 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group')}">小组</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{$strTag[tagname]}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h1 class="h3 fw400">{$strTag[tagname]}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">{$strTag[tagname]}相关的帖子</div>
|
||||
<div class="card-body">
|
||||
<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"></a></div>
|
||||
|
||||
<div class="topic_title">
|
||||
<div class="title"><a title="{$item['title']}" href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{$item[title]}</a>
|
||||
</div>
|
||||
|
||||
<div class="topic_info">
|
||||
<span style="float:left;">
|
||||
<a href="{tsUrl('group','show',array('id'=>$item['groupid']))}">{$item['group']['groupname']}</a>
|
||||
</span>
|
||||
|
||||
<span style="float:right;">
|
||||
{php echo getTime($item['uptime'],time())}
|
||||
|
||||
<a href="{tsUrl('user','space',array('id'=>$item['userid']))}">{$item['user']['username']}</a>
|
||||
|
||||
{if $item['count_comment']>0}<a class="rank" style="color:#FFFFFF;" href="{tsUrl('topic','show',array('id'=>$item['topicid']))}">{$item['count_comment']}</a>{/if}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
{/loop}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">热门标签</div>
|
||||
<div class="card-body">
|
||||
{loop $arrTag $key $item}
|
||||
<a class="badge badge-secondary mr-2 mb-2 fw300" href="{tsUrl('topic','tag',array('id'=>urlencode($item['tagname'])))}">{$item['tagname']}</a>
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<!--广告位-->
|
||||
{php doAction('gobad','300')}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,36 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('topic')}">话题</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">标签</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">全部标签</div>
|
||||
<div class="card-body">
|
||||
|
||||
<div>
|
||||
{loop $arrTag $key $item}
|
||||
<a class="badge badge-secondary mr-2 mb-2 fw300" href="{tsUrl('topic','tag',array('id'=>urlencode($item[tagname])))}">{$item[tagname]}</a>
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,42 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group')}">小组</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup['groupname']}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{$strTopic[title]}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="alert alert-info text-center">
|
||||
|
||||
本小组帖子只有小组成员才可以浏览^_^
|
||||
|
||||
{if $strGroup['joinway']==3}
|
||||
<a class="btn btn-sm btn-info" href="javascript:void('0');" onclick="joinGroup('{$strGroup['groupid']}');">需要支付<font color="orange" style="font-size: 16px;">{$strGroup['price']}金币</font>加入小组</a>
|
||||
{else}
|
||||
<a class="btn btn-sm btn-info" href="javascript:void('0');" onclick="joinGroup('{$strGroup['groupid']}');">加入小组</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,35 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group')}">小组</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('group','show',array('id'=>$strGroup['groupid']))}">{$strGroup['groupname']}</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{$strTopic[title]}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
|
||||
<div class="alert alert-info">
|
||||
你的组费已经到期,请联系组长续期!续期后才可以访问帖子内容。
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,50 @@
|
||||
//向下加载更多帖子
|
||||
function loadTopic(userid,page){
|
||||
var num = parseInt(page)+1;
|
||||
$("#viewmore").html('<img src="'+siteUrl+'public/images/loading.gif" />');
|
||||
$.get(siteUrl+'index.php?app=topic&ac=ajax&ts=topic',{'userid':userid,'page':page},function(rs){
|
||||
if(rs==''){
|
||||
$("#viewmore").html('没有可以加载的内容啦...');
|
||||
}else{
|
||||
$("#before").before(rs);
|
||||
$("#viewmore").html('<a class="btn" href="javascript:void(0);" onclick="loadTopic('+userid+','+num+')">查看更多内容......</a>');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//帖子审核
|
||||
function topicAudit(topicid,token){
|
||||
$.post(siteUrl+'index.php?app=topic&ac=ajax&ts=topicaudit',{'topicid':topicid,'token':token},function(rs){
|
||||
if(rs==0){
|
||||
|
||||
window.location.reload();
|
||||
return false;
|
||||
}else if(rs==1){
|
||||
|
||||
window.location.reload();
|
||||
return false;
|
||||
|
||||
}else if(rs==2){
|
||||
|
||||
tsNotice('非法操作!');
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//标注
|
||||
function toBook(topicid){
|
||||
var book = $('#book-text').val();
|
||||
//if(topicid && book){
|
||||
if(topicid){
|
||||
$.post(siteUrl+'index.php?app=topic&ac=ajax&ts=book',{'topicid':topicid,'book':book},function (rs) {
|
||||
if(rs==1){
|
||||
window.location.reload()
|
||||
}else{
|
||||
//$('#book-alert').html('标注不能为空');
|
||||
}
|
||||
})
|
||||
}else{
|
||||
//$('#book-alert').html('标注不能为空');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/*帖子列表*/
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*内容页*/
|
||||
.topic-content{width: 100%;overflow:hidden;}
|
||||
|
||||
.topic-content .user-face{float: left;height: 48px;overflow: hidden;width: 48px;}
|
||||
|
||||
.topic-content .topic-doc {
|
||||
margin-bottom: 30px;
|
||||
overflow: hidden;
|
||||
margin-left:60px;
|
||||
}
|
||||
.topic-content .topic-doc .author {
|
||||
height: auto;
|
||||
margin: 0;
|
||||
margin-bottom: 1px;
|
||||
color: #666666;
|
||||
background:#f4f4ec;
|
||||
padding:5px;
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.topic-content img{max-width:100%;}
|
||||
.topic-content .topic-view{font-size:16px;line-height:30px;overflow: hidden;word-wrap: break-word;word-break: normal;}
|
||||
|
||||
.topic-content .topic-view a{color:#49a5de}
|
||||
|
||||
.topic-content .topic-view p{font-size:16px;}
|
||||
|
||||
.topic-content .topic-view table{border:#CCCCCC 1px solid;}
|
||||
.topic-content .topic-view table td{ border:1px #CCCCCC solid; border-right:none; border-top:none;}
|
||||
|
||||
|
||||
.btool{
|
||||
border-top: 1px solid #EEEEEE;
|
||||
font-size: 12px;
|
||||
padding: 10px 10px 0 10px;
|
||||
text-align: right;}
|
||||
.btool a{margin-left:10px;padding:0px;color:#999999}
|
||||
Reference in New Issue
Block a user