@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
return array(
|
||||
|
||||
'name' => '附件',
|
||||
|
||||
'version' => '1.0',
|
||||
|
||||
'desc' => '附件',
|
||||
|
||||
'url' => 'https://lmve.net',
|
||||
|
||||
'email' => '1337087466@qq.com',
|
||||
|
||||
'author' => '无闻风',
|
||||
|
||||
'author_url' => 'https://lmve.net',
|
||||
|
||||
'isoption' => '1',
|
||||
|
||||
'isinstall' => '1',
|
||||
|
||||
'issql' => '0',
|
||||
|
||||
'issystem' => '1',
|
||||
|
||||
'isappnav' => '1',
|
||||
|
||||
'ismy'=>'1',
|
||||
|
||||
);
|
||||
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
switch($ts){
|
||||
|
||||
//某一个attach
|
||||
case "":
|
||||
$albumid = isset($_GET['id']) ? intval($_GET['id']) : '0';
|
||||
|
||||
$strAlbum = $new['attach']->find('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
//404
|
||||
if($albumid!=0)
|
||||
{
|
||||
|
||||
if($strAlbum==''){
|
||||
header("HTTP/1.1 404 Not Found");
|
||||
header("Status: 404 Not Found");
|
||||
$title = '404';
|
||||
include pubTemplate("404");
|
||||
exit;
|
||||
if($strAlbum['isaudit']==1){
|
||||
tsNotice('内容审核中...');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$strAlbum['albumname'] = tsTitle($strAlbum['albumname']);
|
||||
$strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']);
|
||||
|
||||
|
||||
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
|
||||
|
||||
$url = tsUrl('attach','album',array('id'=>$albumid,'page'=>''));
|
||||
|
||||
$lstart = $page*24-24;
|
||||
|
||||
$strUser = aac('user')->getSimpleUser($strAlbum['userid']);
|
||||
if($albumid!=0)
|
||||
{
|
||||
$arrattach = $new['attach']->findAll('attach',array(
|
||||
'albumid'=>$albumid,
|
||||
),'attachid desc',null,$lstart.',24');
|
||||
|
||||
$attachNum = $new['attach']->findCount('attach',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
}else
|
||||
{
|
||||
$userid = aac('user')->isLogin();
|
||||
$arrattach = $new['attach']->findAll('attach',array(
|
||||
'userid'=>$userid,
|
||||
'albumid'=>0,
|
||||
),'attachid desc',null,$lstart.',24');
|
||||
|
||||
$attachNum = $new['attach']->findCount('attach',array(
|
||||
'userid'=>$userid,
|
||||
));
|
||||
$strAlbum['albumname']="个人附件库";
|
||||
$strAlbum['userid']=$userid;
|
||||
|
||||
}
|
||||
|
||||
|
||||
foreach($arrattach as $key=>$item){
|
||||
$arrattach[$key]['attachdesc'] = tsTitle($item['attachdesc']);
|
||||
}
|
||||
|
||||
$pageUrl = pagination($attachNum, 24, $page, $url);
|
||||
|
||||
|
||||
$title = $strAlbum['albumname'];
|
||||
|
||||
|
||||
include template("album");
|
||||
|
||||
$new['attach']->update('attach_album',array(
|
||||
'albumid'=>$strAlbum['albumid'],
|
||||
),array(
|
||||
'count_view'=>$strAlbum['count_view']+1,
|
||||
));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
//修改attach
|
||||
case "edit":
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$albumid = intval($_GET['albumid']);
|
||||
|
||||
$strAlbum = $new['attach']->find('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
if($strAlbum['userid'] == $userid || $TS_USER['isadmin']==1) {
|
||||
|
||||
$strAlbum['albumname'] = tsTitle($strAlbum['albumname']);
|
||||
$strAlbum['albumdesc'] = tsTitle($strAlbum['albumdesc']);
|
||||
|
||||
$title = '修改attach属性-'.$strAlbum['albumname'];
|
||||
include template("album_edit");
|
||||
|
||||
}else{
|
||||
|
||||
tsNotice('非法操作!');
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "editdo":
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$albumid = intval($_POST['albumid']);
|
||||
|
||||
$strAlbum = $new['attach']->find('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
if($strAlbum['userid']==$userid || $TS_USER['isadmin']==1){
|
||||
|
||||
$albumname = trim($_POST['albumname']);
|
||||
if($albumname == '') qiMsg("attach名称不能为空!");
|
||||
|
||||
$albumdesc = trim($_POST['albumdesc']);
|
||||
|
||||
|
||||
if($TS_USER['isadmin']==0){
|
||||
//过滤内容开始
|
||||
aac('system')->antiWord($albumname);
|
||||
aac('system')->antiWord($albumdesc);
|
||||
//过滤内容结束
|
||||
}
|
||||
|
||||
$new['attach']->update('attach_album',array(
|
||||
'userid'=>$strAlbum['userid'],
|
||||
'albumid'=>$strAlbum['albumid'],
|
||||
),array(
|
||||
'albumname'=>$albumname,
|
||||
'albumdesc'=>$albumdesc,
|
||||
));
|
||||
|
||||
header("Location: ".tsUrl('attach','album',array('id'=>$albumid)));
|
||||
}else{
|
||||
tsNotice('非法操作!');
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//删除attach
|
||||
case "del":
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$albumid = intval($_GET['albumid']);
|
||||
|
||||
$strAlbum = $new['attach']->find('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
if($strAlbum['userid'] == $userid || $TS_USER['isadmin'] == 1) {
|
||||
|
||||
$new['attach']->delete('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
$new['attach']->delete('attach',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
header("Location: ".tsUrl('attach'));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin($js,$userkey);
|
||||
switch($ts){
|
||||
|
||||
case "do":
|
||||
|
||||
$authcode = strtolower($_POST['authcode']);
|
||||
|
||||
if ($TS_SITE ['isauthcode']) {
|
||||
if ($authcode != $_SESSION ['verify']) {
|
||||
getJson ( "验证码输入有误,请重新输入!" ,$js,0);
|
||||
}
|
||||
}
|
||||
|
||||
$attachid = intval($_POST['attachid']);
|
||||
$content = tsClean($_POST['content'],$js);
|
||||
$content2 = emptyText($_POST['content']);//测试空内容
|
||||
$ispublic = intval($_POST['ispublic']);
|
||||
|
||||
//过滤内容开始
|
||||
if($TS_USER['isadmin']==0){
|
||||
aac('system')->antiWord($content,$js);
|
||||
}
|
||||
//过滤内容结束
|
||||
|
||||
if($content2==''){
|
||||
getJson('没有任何内容是不允许你通过滴^_^',$js);
|
||||
}else{
|
||||
$commentid = $new['attach']->create('attach_comment',array(
|
||||
'attachid' => $attachid,
|
||||
'userid' => $userid,
|
||||
'content' => $content,
|
||||
'addtime'=> time(),
|
||||
));
|
||||
|
||||
|
||||
|
||||
//发送系统消息(通知楼主有人回复他的帖子啦)
|
||||
$strattach = $new['attach']->find('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
));
|
||||
|
||||
if($strattach['userid'] != $TS_USER['userid']){
|
||||
|
||||
$msg_userid = '0';
|
||||
$msg_touserid = $strattach['userid'];
|
||||
$msg_content = '你的附件:《'.$strattach['attachname'].'》新增一条评论,快去看看给个回复吧^_^ ';
|
||||
$msg_tourl = tsUrl('attach','show',array('id'=>$attachid));
|
||||
aac('message')->sendmsg($msg_userid,$msg_touserid,$msg_content,$msg_tourl);
|
||||
|
||||
}
|
||||
|
||||
header("Location: ".tsUrl('attach','show',array('id'=>$attachid)));
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//删除评论
|
||||
case "delete":
|
||||
|
||||
$commentid = intval($_GET['commentid']);
|
||||
|
||||
$strComment = $new['attach']->find('attach_comment',array(
|
||||
'commentid'=>$commentid,
|
||||
));
|
||||
|
||||
$strattach = $new['attach']->find('attach',array(
|
||||
'attachid'=>$strComment['attachid'],
|
||||
));
|
||||
|
||||
|
||||
|
||||
if($strattach['userid']==$userid || $TS_USER['isadmin']==1 || $strComment['userid']==$userid){
|
||||
|
||||
$new['attach']->delete('attach_comment',array(
|
||||
'commentid'=>$commentid,
|
||||
));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//跳转回到帖子页
|
||||
header("Location: ".tsUrl('attach','show',array('id'=>$strComment['attachid'])));
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
function download($dir,$name)
|
||||
{
|
||||
$arr=explode('.', $dir);
|
||||
$ext=end($arr); //end()返回数组的最后一个元素
|
||||
if($ext=='pdf')
|
||||
{
|
||||
$file = fopen($dir,"r"); // 打开文件
|
||||
// 输入文件标签
|
||||
Header("Content-type: application/pdf");
|
||||
Header("filename:" . $name);
|
||||
// 输出文件内容
|
||||
echo fread($file,filesize($dir));
|
||||
fclose($file);
|
||||
}else
|
||||
{
|
||||
$file = fopen($dir,"r"); // 打开文件
|
||||
// 输入文件标签
|
||||
Header("Content-type: application/octet-stream");
|
||||
Header("Accept-Ranges: bytes");
|
||||
Header("Accept-Length: ".filesize($dir));
|
||||
Header("Content-Disposition: attachment; filename=" . $name);
|
||||
// 输出文件内容
|
||||
echo fread($file,filesize($dir));
|
||||
fclose($file);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//***********************************************
|
||||
$userid = aac('user')->isLogin();
|
||||
if(aac('user')->isPublisher()==false) {tsNotice('你可能被限制或没有验证邮箱,检查邮箱是否认证。','->点击认证<-',tsUrl('user','verify'));}
|
||||
|
||||
$attachid=intval($_GET['id']);
|
||||
|
||||
$the_file=$new['attach']->find('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
|
||||
));
|
||||
if($the_file) //检查数据表
|
||||
{
|
||||
$file_dir = "uploadfile/attach/".$the_file['attachurl'];
|
||||
if (!file_exists($file_dir)) { //检查文件是否存在
|
||||
echo "文件已删除";
|
||||
exit;
|
||||
}else{
|
||||
if($the_file['userid']==$userid)
|
||||
{
|
||||
$new['attach']->update('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
),array(
|
||||
'count_view'=>$the_file['count_view']+1,
|
||||
));
|
||||
download($file_dir,$the_file['attachname']);
|
||||
exit;
|
||||
}else
|
||||
{
|
||||
if($the_file['pay']==0)//免费的
|
||||
{
|
||||
$new['attach']->update('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
),array(
|
||||
'count_view'=>$the_file['count_view']+1,
|
||||
));
|
||||
download($file_dir,$the_file['attachname']);
|
||||
exit;
|
||||
|
||||
}else
|
||||
{
|
||||
if(aac('user')->delScore($userid,"download file:" . $the_file['attachname'],$the_file['pay']))
|
||||
{
|
||||
$new['attach']->update('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
),array(
|
||||
'count_view'=>$the_file['count_view']+1,
|
||||
));
|
||||
download($file_dir,$the_file['attachname']);
|
||||
aac('user')->addScore($the_file['userid'],$userme['username']."download:" . $the_file['attachname'],$the_file['pay'],1);
|
||||
exit;
|
||||
}else
|
||||
{
|
||||
tsNotice('下载文件需要支付'.$the_file['pay'].'积分,你似乎不够!');
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else
|
||||
{
|
||||
echo "文件已删除";
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$attachid = intval ( $_GET ['id'] );
|
||||
|
||||
$stredit = $new ['attach']->find ( 'attach', array ('attachid' => $attachid ) );
|
||||
$stredit['content'] = tsDecode($stredit['content']);
|
||||
if($stredit=='')
|
||||
{
|
||||
|
||||
tsNotice('NO!');
|
||||
}
|
||||
if($userid!=$stredit['userid'])
|
||||
{
|
||||
tsNotice('NO');
|
||||
|
||||
}
|
||||
include template ( "edit" );
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
defined ( 'IN_TS' ) or die ( 'Access Denied.' );
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
$attachid = intval ( $_POST ['attachid'] );
|
||||
|
||||
$stredit = $new ['attach']->find ( 'attach', array ('attachid' => $attachid ) );
|
||||
|
||||
if($stredit=='')
|
||||
{
|
||||
|
||||
tsNotice('NO!');
|
||||
}
|
||||
if($userid!=$stredit['userid'])
|
||||
{
|
||||
tsNotice('NO');
|
||||
|
||||
}
|
||||
|
||||
|
||||
$attachname = trim($_POST['attachname']);
|
||||
|
||||
$pay=intval($_POST['pay']);
|
||||
|
||||
$new['attach'] -> update('attach', array('attachid' => $attachid), array(
|
||||
'attachname' => $attachname,
|
||||
'pay' => $pay,
|
||||
));
|
||||
header("Location: " . tsUrl('attach', 'show', array('id' => $attachid)));
|
||||
?>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
switch($ts){
|
||||
case "list":
|
||||
|
||||
$kw=urldecode(tsFilter($_GET['kw']));
|
||||
|
||||
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
|
||||
|
||||
$url = tsUrl('attach','editor',array('ts'=>'list','page'=>''));
|
||||
|
||||
$lstart = $page*10-10;
|
||||
|
||||
if($kw=='')
|
||||
{
|
||||
$attachlist = $new['attach']->findAll('attach',array('userid'=>$userid),'addtime desc',null,$lstart.',10');
|
||||
$albumNum = $new['attach']->findCount('attach');
|
||||
}else
|
||||
{
|
||||
$kw = t($kw);
|
||||
$attachlist = $db->fetch_all_assoc("select * from ".dbprefix."attach WHERE `userid` = '$userid' AND `attachname` like '%$kw%' order by addtime desc limit $lstart,10");
|
||||
$albumNum = $db->once_num_rows("select * from ".dbprefix."attach WHERE `userid` = '$userid' AND attachname like '%$kw%'");
|
||||
}
|
||||
|
||||
$pageUrl = pagination($albumNum, 10, $page, $url);
|
||||
|
||||
include template("editor");
|
||||
break;
|
||||
case "upload":
|
||||
$albumid=0;
|
||||
include template("upload");
|
||||
break;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
|
||||
|
||||
$url = tsUrl('attach','index',array('page'=>''));
|
||||
|
||||
$lstart = $page*30-30;
|
||||
|
||||
$arrAlbum = $new['attach']->findAll('attach_album',"`isaudit`=0",'albumid desc',null,$lstart.',30');
|
||||
|
||||
foreach($arrAlbum as $key=>$item){
|
||||
$arrAlbum[$key]['albumname'] = tstitle($item['albumname']);
|
||||
$arrAlbum[$key]['albumdesc'] = tstitle($item['albumdesc']);
|
||||
}
|
||||
|
||||
$albumNum = $new['attach']->findCount('attach_album');
|
||||
|
||||
$pageUrl = pagination($albumNum, 30, $page, $url);
|
||||
|
||||
$title = '最新专辑';
|
||||
|
||||
$sitekey = $TS_APP['appkey'];
|
||||
$sitedesc = $TS_APP['appdesc'];
|
||||
include template("index");
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
//用户是否登录
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
//判断发布者状态
|
||||
if(aac('user')->isPublisher()==false) tsNotice('不好意思,你还没有权限发布内容!');
|
||||
|
||||
//发布时间限制
|
||||
if(aac('system')->pubTime()==false) tsNotice('不好意思,当前时间不允许发布内容!');
|
||||
|
||||
|
||||
switch($ts){
|
||||
|
||||
|
||||
case "":
|
||||
|
||||
$title = '新建库';
|
||||
include template("create");
|
||||
|
||||
break;
|
||||
|
||||
case "do":
|
||||
|
||||
|
||||
$albumname = trim($_POST['albumname']);
|
||||
$albumdesc = trim($_POST['albumdesc']);
|
||||
|
||||
if($albumname == '') {
|
||||
tsNotice("库名称不能为空!");
|
||||
}
|
||||
|
||||
//1审核后显示0不审核
|
||||
if ($TS_APP['isaudit']==1) {
|
||||
$isaudit = 1;
|
||||
} else {
|
||||
$isaudit = 0;
|
||||
}
|
||||
|
||||
if($TS_USER['isadmin']==0){
|
||||
//过滤内容开始
|
||||
aac('system')->antiWord($albumname);
|
||||
aac('system')->antiWord($albumdesc);
|
||||
//过滤内容结束
|
||||
}
|
||||
|
||||
$albumid = $new['attach']->create('attach_album',array(
|
||||
|
||||
'userid'=>$userid,
|
||||
'albumname'=>$albumname,
|
||||
'albumdesc'=>$albumdesc,
|
||||
'isaudit'=>$isaudit,
|
||||
'addtime'=>date('Y-m-d H:i:s'),
|
||||
'uptime'=>date('Y-m-d H:i:s'),
|
||||
|
||||
));
|
||||
|
||||
header("Location: ".tsUrl('attach','album',array('id'=>$albumid)));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$attachid=intval($_GET['id']);
|
||||
$strattach = $new['attach']->find('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
));
|
||||
|
||||
if ($strattach == '') {
|
||||
header ( "HTTP/1.1 404 Not Found" );
|
||||
header ( "Status: 404 Not Found" );
|
||||
$title = '404';
|
||||
include pubTemplate ( "404" );
|
||||
exit ();
|
||||
}
|
||||
|
||||
$arrattachuser = aac ( 'user' )->getSimpleUser ( $strattach ['userid'] );
|
||||
|
||||
|
||||
//是否关注
|
||||
if($TS_USER['userid'] != '' && $TS_USER['userid'] != $arrattachuser['userid']){
|
||||
$userid=$arrattachuser['userid'];
|
||||
$followNum = $db->once_num_rows("select * from ".dbprefix."user_follow where userid='".$TS_USER['userid']."' and userid_follow='$userid'");
|
||||
if($followNum > '0'){
|
||||
$arrattachuser['isfollow'] = true;
|
||||
}else{
|
||||
$arrattachuser['isfollow'] = false;
|
||||
}
|
||||
}else{
|
||||
$arrattachuser['isfollow'] = false;
|
||||
}
|
||||
|
||||
// 是否审核
|
||||
if ($strattach ['isaudit'] == 1 && $TS_USER['isadmin']==0 && $TS_USER['userid']!=$strattach['userid']) {
|
||||
tsNotice ( '内容审核中...' );
|
||||
}
|
||||
|
||||
$file_dir = "uploadfile/attach/".$strattach['attachurl'];
|
||||
$filemd5=md5_file($file_dir);
|
||||
if($filemd5)
|
||||
{
|
||||
|
||||
}else
|
||||
{
|
||||
$filemd5="File_Erro!";
|
||||
|
||||
}
|
||||
|
||||
// 获取评论
|
||||
$page = isset ( $_GET ['page'] ) ? intval ( $_GET ['page'] ) : 1;
|
||||
$url = tsUrl ( 'attach', 'show', array (
|
||||
'id' => $attachid,
|
||||
'page' => ''
|
||||
) );
|
||||
$lstart = $page * 10 - 10;
|
||||
|
||||
$arrComments = $new ['attach']->findAll ( 'attach_comment', array (
|
||||
'attachid' => $attachid
|
||||
), 'addtime desc', null, $lstart . ',10' );
|
||||
|
||||
foreach ( $arrComments as $key => $item ) {
|
||||
$arrComment [] = $item;
|
||||
$arrComment[$key]['content'] = tsDecode($item['content']);
|
||||
$arrComment [$key] ['user'] = aac ( 'user' )->getSimpleUser ( $item ['userid'] );
|
||||
}
|
||||
|
||||
$commentNum = $new ['attach']->findCount ( 'attach_comment', array (
|
||||
'attachid' => $attachid
|
||||
) );
|
||||
|
||||
$pageUrl = pagination ( $commentNum, 10, $page, $url );
|
||||
|
||||
// 标签
|
||||
//$strattach ['tags'] = aac ( 'tag' )->getObjTagByObjid ( 'attach', 'attachid', $strattach ['attachid'] );
|
||||
$title = $strattach['attachname'];
|
||||
include template ( "show" );
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
$userid = aac('user')->isLogin();
|
||||
|
||||
switch($ts){
|
||||
case "":
|
||||
$albumid=intval($_GET['albumid']);
|
||||
include template("upload");
|
||||
break;
|
||||
case "add":
|
||||
$albumid=intval($_GET['albumid']);
|
||||
include template("add");
|
||||
break;
|
||||
case "do":
|
||||
$albumid = intval($_POST['albumid']);
|
||||
|
||||
|
||||
$strAlbum = $new['attach']->find('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
if($strAlbum!=''){
|
||||
if($strAlbum['userid']!=$userid){
|
||||
getJson('非法操作3!');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($_FILES['file']==''){ts404();}
|
||||
//上传
|
||||
$attachid = $new['attach']->create('attach',array(
|
||||
'userid'=>$userid,
|
||||
'albumid'=>$albumid,
|
||||
'locationid'=>aac('user')->getLocationId($userid),
|
||||
'addtime' => date('Y-m-d H:i:s',time()),
|
||||
));
|
||||
//上传
|
||||
$arrUpload = tsUpload($_FILES['file'],$attachid,'attach',array('zip','rar','doc','txt','ppt','pdf','docx','mp4'));
|
||||
|
||||
if($arrUpload && $arrUpload['path'] && $arrUpload['url']){
|
||||
$new['attach']->update('attach',array(
|
||||
'attachid'=>$attachid,
|
||||
),array(
|
||||
'attachname'=>$arrUpload['name'],
|
||||
'attachtype'=>$arrUpload['type'],
|
||||
'path'=>$arrUpload['path'],
|
||||
'attachurl'=>$arrUpload['url'],
|
||||
'attachsize'=>$arrUpload['size'],
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
$count_attach = $new['attach']->findCount('attach',array(
|
||||
'albumid'=>$albumid,
|
||||
));
|
||||
|
||||
$new['attach']->update('attach_album',array(
|
||||
'albumid'=>$albumid,
|
||||
),array(
|
||||
'count_attach'=>$count_attach
|
||||
));
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
class attach extends tsApp{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
defined('IN_TS') or die('Access Denied.');
|
||||
|
||||
|
||||
|
||||
$skin = 'default';
|
||||
|
||||
|
||||
|
||||
$TS_APP['appname'] = 'attach';
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
* APP独立数据库配置
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,64 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
|
||||
|
||||
|
||||
<link href="{SITE_URL}public/js/dropzone/dropzone.css" type="text/css" rel="stylesheet" />
|
||||
<script src="{SITE_URL}public/js/dropzone/dropzone.js"></script>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<div class="alert alert-info fs12">上传文件只支持:zip,rar,doc,txt,ppt,pdf,docx格式 <span class="c9 fs12">(上传格式请在后台配置)</span></div>
|
||||
|
||||
|
||||
|
||||
<form id ="myAwesomeDropzone" style="width:100%;border:dashed" action="/index.php?app=attach&ac=upload&ts=do" class="dropzone">
|
||||
<input type="hidden" name="albumid" value="{$albumid}">
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
|
||||
<div class="mt-3">
|
||||
|
||||
<a class="btn btn-sm btn-outline-info" href="{tsUrl('attach','album',array('id'=>$albumid))}">取消上传</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var locationurl = "{tsUrl('attach','album',array('id'=>$albumid))}"
|
||||
|
||||
Dropzone.options.myAwesomeDropzone = {
|
||||
paramName: "file", // The name that will be used to transfer the file
|
||||
maxFilesize: 50, // MB
|
||||
acceptedFiles:".zip,.rar,.doc,.txt,.ppt,.pdf,.docx",
|
||||
accept: function(file, done) {
|
||||
done();
|
||||
|
||||
},
|
||||
queuecomplete:function (file) {
|
||||
window.location = locationurl;
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,114 @@
|
||||
{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('attach')}">附件库</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">{$strAlbum['albumname']}</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<h1 class="h3 fw400">{$title}</h1>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="c9 fs12">
|
||||
|
||||
<span class="mr-2">{$strAlbum[count_view]} 人浏览</span>
|
||||
|
||||
<span class="mr-2">{$strAlbum[count_attach]} 文件</span>
|
||||
<span>{$strAlbum[addtime]} 创建</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row mt-3">
|
||||
|
||||
|
||||
{if $arrattach}
|
||||
<div class="page">{$pageUrl}</div>
|
||||
<table class="table table-sm table-bordered table-hover" style="font-size: 14px;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>file id</th>
|
||||
<th>名称</th>
|
||||
<th>Size</th>
|
||||
<th>积分</th>
|
||||
<th>下载量</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop $arrattach $key $item}
|
||||
|
||||
<tr>
|
||||
<td>{$item[attachid]}</td>
|
||||
<td><a href="{tsUrl('attach','show',array('id'=>$item['attachid']))}">{$item[attachname]}</a></td>
|
||||
<td>{$item[attachsize]}</td>
|
||||
<td>{if $item[pay]==0}<font color="red">Free</font>{else}{$item[pay]}{/if}</td>
|
||||
<td>{$item[count_view]}</td>
|
||||
<td>
|
||||
<a href="{tsUrl('attach','down',array('id'=>$item[attachid]))}">下载</a>
|
||||
<a href="{tsUrl('attach','edit',array('id'=>$item[attachid]))}">修改</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
{else}
|
||||
<br>
|
||||
<div class="pl">这个附件库现在还没有文件
|
||||
{if $strAlbum[userid] == $TS_USER[userid]}, 你可以<a href="{tsUrl('attach','upload',array('albumid'=>$strAlbum['albumid'],'ts'=>'add'))}">添加文件</a>{/if}
|
||||
</div>
|
||||
<br>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
|
||||
<div class="text-black-50">{$strAlbum[albumdesc]}</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="tar fs12 c9 mt-3">
|
||||
|
||||
{if $strAlbum[userid] == $TS_USER[userid] || $TS_USER[isadmin]==1}
|
||||
{if $albumid!=0}
|
||||
> <a href="{tsUrl('attach','album',array('ts'=>'edit','albumid'=>$strAlbum['albumid']))}">修改附件库</a>
|
||||
{/if}
|
||||
> <a href="{tsUrl('attach','upload',array('albumid'=>$strAlbum['albumid'],'ts'=>'add'))}">添加文件</a>
|
||||
{/if}
|
||||
|
||||
|
||||
{if $strAlbum[userid] == $TS_USER[userid] || $TS_USER[isadmin]==1}
|
||||
{if $albumid!=0}
|
||||
> <a href="{tsUrl('attach','album',array('ts'=>'del','albumid'=>$strAlbum['albumid']))}">删除附件库</a>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
{if $albumid!=0}
|
||||
> <a href="{tsUrl('attach','user',array('id'=>$strAlbum['userid']))}">{$strUser['username']}的附件库</a>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,68 @@
|
||||
{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('attach')}">附件</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('attach','album',array('id'=>$strAlbum['albumid']))}">{$strAlbum['albumname']}</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-3"></div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<form role="form" method="POST" action="{tsUrl('attach','album',array('ts'=>'editdo'))}">
|
||||
<div class="form-group">
|
||||
<label>附件名称(必填)</label>
|
||||
<input type="text" name="albumname" value="{$strAlbum['albumname']}" class="form-control" >
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>附件介绍:</label>
|
||||
<textarea class="form-control" rows="3" name="albumdesc">{$strAlbum['albumdesc']}</textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden" name="albumid" value="{$strAlbum['albumid']}" />
|
||||
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
<button class="btn btn-sm btn-info" type="submit">修改附件</button>
|
||||
<a class="btn btn-sm text-black-50" href="{tsUrl('attach','album',array('id'=>$strAlbum['albumid']))}">返回附件</a>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,65 @@
|
||||
{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('attach')}">库</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">创建新库</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{template menu}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
|
||||
<form role="form" method="POST" action="{tsUrl('attach','new',array('ts'=>'do'))}">
|
||||
<div class="form-group">
|
||||
<label>库名称(必填)</label>
|
||||
<input type="text" name="albumname" class="form-control" >
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>库介绍:</label>
|
||||
<textarea class="form-control" rows="3" name="albumdesc"></textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
<button class="btn btn-sm btn-info" type="submit">创建库</button>
|
||||
<a class="btn btn-sm text-black-50" href="{tsUrl('attach','user',array('id'=>$userid))}">返回我的库</a>
|
||||
</form>
|
||||
|
||||
<p>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-md-4"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,61 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="position-relative">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('attach')}">附件</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" style="max-width:100%;flex:100%;">
|
||||
|
||||
|
||||
|
||||
<form method="POST" action="{SITE_URL}index.php?app=attach&ac=editdo" enctype="multipart/form-data">
|
||||
<input name="attachid" value="{$stredit[attachid]}" hidden></input>
|
||||
<div class="form-group">
|
||||
<label>标题</label>
|
||||
<input name="attachname" type="text" class="form-control" required="required" value="{$stredit[attachname]}">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<label>价格(积分型只能用整数)</label>
|
||||
<input name="pay" type="text" class="form-control" value="{$stredit[pay]}" required="required" oninput = "value=value.replace(/[^\d]/g,'')">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<button class="btn btn-sm btn-info" type="submit">提交修改</button>
|
||||
|
||||
|
||||
|
||||
<p></p>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-2"></div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,96 @@
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Title</title>
|
||||
|
||||
<link rel="stylesheet" href="/public/bootstrap/css/bootstrap.min.css" >
|
||||
<script>var siteUrl = '';</script>
|
||||
<script src="/public/js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="/public/bootstrap/js/bootstrap.min.js"></script>
|
||||
<link href="/public/fontawesome/css/fontawesome-all.css" rel="stylesheet">
|
||||
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-6">
|
||||
|
||||
<form method="get" action="/index.php">
|
||||
<input type="hidden" name="app" value="attach" />
|
||||
<input type="hidden" name="ac" value="editor" />
|
||||
<input type="hidden" name="ts" value="list" />
|
||||
<div class="input-group mb-3">
|
||||
<input type="text" class="form-control form-control-sm" placeholder="关键词" aria-label="Recipient's username" aria-describedby="button-addon2" name="kw" value="">
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-sm btn-outline-secondary" type="submit" id="button-addon2">搜索</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 col-2">
|
||||
</div>
|
||||
|
||||
<div class="col-md-4 col-4 text-right">
|
||||
|
||||
<a class="btn btn-sm btn-info" href="/index.php?app=attach&ac=editor&ts=upload">上传新附件</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="page">{$pageUrl}</div>
|
||||
|
||||
<table class="table table-sm table-bordered table-hover" style="font-size: 14px;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th>Size</th>
|
||||
<th>积分</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{loop $attachlist $key $item}
|
||||
<tr>
|
||||
<td>{$item[attachname]}</td>
|
||||
<td>{$item[attachsize]}</td>
|
||||
<td>{if $item[pay]==0}<font color="red">Free</font>{else}{$item[pay]}{/if}</td>
|
||||
<td>
|
||||
<a href="javascript:void('0');" onclick="insertAttach('{tsUrl('attach','show',array('id'=>$item[attachid]))}','{$item[pay]}','{$item[attachname]}')">插入</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<div class="page">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
//插入附件
|
||||
function insertAttach(downurl,pay,attachname){
|
||||
|
||||
|
||||
var html = '<a class="font-weight-bold" target="_blank" href="'+downurl+'">'+attachname+'</a>';
|
||||
|
||||
self.parent.$('#tseditor').summernote('pasteHTML', html);
|
||||
self.parent.$('.ts-attach').removeClass('open').hide();
|
||||
self.parent.$('.note-modal-backdrop').hide();
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,49 @@
|
||||
{php include pubTemplate("header")}
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
<nav aria-label="breadcrumb" class="position-relative">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page">附件</li>
|
||||
</ol>
|
||||
|
||||
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:120px;background-color:#FF9933" href="{tsUrl('attach','album')}">个人附件库</a>
|
||||
<a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('attach','new')}">创建附件库</a>
|
||||
|
||||
</nav>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
{template menu}
|
||||
|
||||
|
||||
<div class="row">
|
||||
{loop $arrAlbum $key $item}
|
||||
<div class="col-6 col-md-2 mb-3">
|
||||
<a href="{tsUrl('attach','album',array('id'=>$item[albumid]))}">
|
||||
<img class="mw100" src="{if $item[albumface] == ''}{SITE_URL}app/{$app}/skins/{$skin}/attach_album.png{else}{php echo tsXimg($item[albumface],'attach',320,'320',$item[path],1)}{/if}" alt="{$item[albumname]}">
|
||||
</a>
|
||||
|
||||
<div class="caption">
|
||||
<div class="title-cut mt-2">{$item[albumname]}</div>
|
||||
<div class="c9 fs12"> {$item[count_attach]}个附件</div>
|
||||
<div class="fs12 c9">{php echo date('Y-m-d',strtotime($item['addtime']))} 创建</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="clear"></div>
|
||||
<div class="page">{$pageUrl}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,172 @@
|
||||
{php include pubTemplate("header")}
|
||||
<div class="container">
|
||||
<nav aria-label="breadcrumb" class="position-relative">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
|
||||
<li class="breadcrumb-item"><a href="{tsUrl('attach')}">附件</a></li>
|
||||
|
||||
<li class="breadcrumb-item active" aria-current="page">{$strattach[attachname]}</li>
|
||||
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
{if $strattach['tags']}
|
||||
<div class="mb-3 mt-3">
|
||||
{loop $strattach[tags] $key $strattach}
|
||||
<a class="badge badge-secondary fw300 mr-2" href="{tsUrl('attach','tag',array('id'=>$strattach['tagname']))}">{$strattach[tagname]}</a>
|
||||
{/loop}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
{/if}
|
||||
<hr />
|
||||
<div><h1 class="h3 pb-3 fw400">{$strattach[attachname]}</h1></div>
|
||||
<table class="table table-sm table-bordered table-hover" style="font-size: 14px;">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>file id</th>
|
||||
<th>MD5值</th>
|
||||
<th>Size</th>
|
||||
<th>下载需要积分</th>
|
||||
<th>下载量</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{$strattach[attachid]}</td>
|
||||
<td>{$filemd5}</td>
|
||||
<td>{$strattach[attachsize]}</td>
|
||||
<td>{if $strattach[pay]==0}<font color="red">Free</font>{else}{$strattach[pay]}{/if}</td>
|
||||
<td>{$strattach[count_view]}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<a class="btn btn-sm btn-info position-absolute" href="{tsUrl('attach','down',array('id'=>$strattach['attachid']))}">下载{if $strattach[pay]>0}-{$strattach[pay]}积分{/if}</a>
|
||||
<br />
|
||||
<hr />
|
||||
<div>{php doAction('group_topic_footer')}</div>
|
||||
<hr />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">up主</div>
|
||||
<div class="card-body">
|
||||
<div class="facebox">
|
||||
<div class="face">
|
||||
<a href="{tsUrl('user','space',array('id'=>$arrattachuser['userid']))}"><img class="rounded-circle" title="{$arrattachuser[username]}" alt="{$arrattachuser[username]}" src="{$arrattachuser[face]}" width="36" height="36"></a>
|
||||
</div>
|
||||
<div class="info">
|
||||
{$arrattachuser[username]}
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<ul class="other">
|
||||
<div class="mt-2 text-right">
|
||||
{if $arrattachuser[userid] != $TS_USER[userid]}
|
||||
{if $arrattachuser[isfollow]}
|
||||
<a class="btn btn-outline-secondary btn-sm" href="javascript:void('0');" onclick="unfollow('{$arrattachuser['userid']}','{$_SESSION['token']}');">取消关注</a>
|
||||
{else}
|
||||
<a class="btn btn-info btn-sm" href="javascript:void('0')" onclick="follow('{$arrattachuser['userid']}','{$_SESSION['token']}');">关注</a>
|
||||
{/if}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
</ul>
|
||||
<ul class="other"></ul>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">评论</div>
|
||||
<div class="card-body">
|
||||
|
||||
{if $arrComment}
|
||||
<div class="comment">
|
||||
<ul>
|
||||
{loop $arrComment $key $strattach}
|
||||
<li class="clearfix">
|
||||
<div class="user-face">
|
||||
<a href="{tsUrl('user','space',array('id'=>$strattach[user][userid]))}"><img class="rounded-circle" title="{$strattach[user][username]}" alt="{$strattach[user][username]}" src="{$strattach[user][face]}" width="48" /></a>
|
||||
</div>
|
||||
<div class="reply-doc">
|
||||
<h4>
|
||||
|
||||
<a class="c9" href="{tsUrl('user','space',array('id'=>$strattach[userid]))}">{$strattach[user][username]}</a>
|
||||
</h4>
|
||||
<p>{$strattach[content]}</p>
|
||||
<h4>{php echo date('Y-m-d H:i:s',$strattach[addtime])}</h4>
|
||||
{if $TS_USER[userid] == $strattach[userid] ||
|
||||
$TS_USER['isadmin']==1}
|
||||
<div class="mb-2 text-right">
|
||||
<a class="fs12 text-secondary" href="{SITE_URL}index.php?app=attach&ac=comment&ts=delete&commentid={$strattach['commentid']}"><i class="far fa-trash-alt"></i> 删除</a>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</li> {/loop}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page">{$pageUrl}</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div>
|
||||
{if intval($TS_USER[userid])==0}
|
||||
<div class="pd20 tac">
|
||||
<a href="{tsUrl('user','login')}">登录</a> | <a href="{tsUrl('user','register')}">注册</a>
|
||||
</div>
|
||||
{else}
|
||||
<form method="POST" action="{SITE_URL}index.php?app=attach&ac=comment&ts=do">
|
||||
|
||||
|
||||
<div id="tseditor"></div>
|
||||
|
||||
<div style="display: none"><textarea name="content"></textarea></div>
|
||||
|
||||
|
||||
|
||||
<div class="mt-2 of">
|
||||
|
||||
|
||||
<div class="float-left">
|
||||
{if $TS_SITE['isauthcode']}
|
||||
验证码:<input name="authcode" />
|
||||
<img align="absmiddle" src="{tsUrl('pubs','code')}" onclick="javascript:newgdcode(this,this.src);" title="点击刷新验证码" alt="点击刷新验证码" style="cursor:pointer;"/>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="float-right">
|
||||
<input type="hidden" name="attachid" value="{$strattach[attachid]}" />
|
||||
<input type="hidden" name="token" value="{$_SESSION['token']}" />
|
||||
|
||||
<button class="btn btn-sm btn-info" type="submit">评论</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{php doAction('tseditor','mini')}
|
||||
{php include pubTemplate("footer")}
|
||||
@@ -0,0 +1,63 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
|
||||
<link rel="stylesheet" href="/public/bootstrap/css/bootstrap.min.css" >
|
||||
<script>var siteUrl = '';</script>
|
||||
<script src="/public/js/jquery.min.js" type="text/javascript"></script>
|
||||
<script src="/public/bootstrap/js/bootstrap.min.js"></script>
|
||||
<link href="/public/fontawesome/css/fontawesome-all.css" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
<link href="/public/js/dropzone/dropzone.css" type="text/css" rel="stylesheet" />
|
||||
<script src="/public/js/dropzone/dropzone.js"></script>
|
||||
|
||||
<style>
|
||||
.fs12{font-size: 12px;}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container">
|
||||
|
||||
|
||||
<div class="alert alert-info fs12">上传文件只支持:zip,rar,doc,txt,ppt,pdf,docx格式 <span class="c9 fs12">(上传格式请在后台配置)</span></div>
|
||||
|
||||
<form id ="myAwesomeDropzone" style="width:100%;border:dashed" action="/index.php?app=attach&ac=upload&ts=do" class="dropzone">
|
||||
<input type="hidden" name="albumid" value="{$albumid}">
|
||||
</form>
|
||||
|
||||
|
||||
<div class="text-center mt-3">
|
||||
<a class="btn btn-sm btn-outline-info" href="{tsUrl('attach','editor',array('ts'=>'list'))}">取消上传</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
var locationurl = "{tsUrl('attach','editor',array('ts'=>'list'))}"
|
||||
|
||||
Dropzone.options.myAwesomeDropzone = {
|
||||
paramName: "file", // The name that will be used to transfer the file
|
||||
maxFilesize: 5000, // MB
|
||||
acceptedFiles:".zip,.rar,.doc,.txt,.ppt,.pdf,.docx,.mp4",
|
||||
accept: function(file, done) {
|
||||
done();
|
||||
|
||||
},
|
||||
queuecomplete:function (file) {
|
||||
window.location = locationurl;
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 188 KiB |
Reference in New Issue
Block a user