begin of thinksaas 3.68

Signed-off-by: kevin <kevin@lmve.net>
This commit is contained in:
2023-06-22 13:33:25 +08:00
commit 963ec1b2ea
2746 changed files with 331806 additions and 0 deletions
+219
View File
@@ -0,0 +1,219 @@
<?php
defined('IN_TS') or die('Access Denied.');
switch($ts){
case "list":
$page = tsIntval($_GET['page'],1);
$lstart = $page*10-10;
$url = SITE_URL.'index.php?app=photo&ac=admin&mg=album&ts=list&page=';
$arrAlbum = $new['photo']->findAll('photo_album',null,'albumid desc',null,$lstart.',10');
$albumNum = $new['photo']->findCount('photo_album');
$pageUrl = pagination($albumNum, 10, $page, $url);
include template("admin/album_list");
break;
//图片
case "photo":
$albumid = tsIntval($_GET['albumid']);
$page = tsIntval($_GET['page'],1);
$lstart = $page*10-10;
$url = SITE_URL.'index.php?app=photo&ac=admin&mg=album&ts=photo&albumid='.$albumid.'&page=';
$arrPhoto = $db->fetch_all_assoc("select * from ".dbprefix."photo where albumid='$albumid' limit $lstart,10");
$photo_num = $db->once_fetch_assoc("select count(photoid) from ".dbprefix."photo where albumid='$albumid'");
$pageUrl = pagination($photo_num['count(photoid)'], 10, $page, $url);
include template("admin/album_photo");
break;
//删除相册
case "del_album":
$albumid = tsIntval($_GET['albumid']);
$new['photo']->deletePhotoAlbum($albumid);
qiMsg("相册删除成功!");
break;
//删除照片
case "del_photo":
$photoid = tsIntval($_GET['photoid']);
$strPhoto = $new['photo']->find('photo',array(
'photoid'=>$photoid,
));
$albumid = $strPhoto['albumid'];
$new['photo']->deletePhoto($strPhoto);
$count_photo = $db->once_num_rows("select * from ".dbprefix."photo where albumid='$albumid'");
$db->query("update ".dbprefix."photo_album set `count_photo`='$count_photo' where albumid='$albumid'");
qiMsg("图片删除成功!");
break;
//设为封面
case "face":
$photoid = tsIntval($_GET['photoid']);
$strPhoto = $db->once_fetch_assoc("select * from ".dbprefix."photo where photoid='$photoid'");
$albumid = $strPhoto['albumid'];
$albumface = $strPhoto['photourl'];
$db->query("update ".dbprefix."photo_album set `albumface`='$albumface' where albumid='$albumid'");
qiMsg("封面设置成功!");
break;
//统计
case "count":
$arrAlbum = $db->fetch_all_assoc("select albumid from ".dbprefix."photo_album");
foreach($arrAlbum as $item){
$albumid = $item['albumid'];
$count_photo = $db->once_num_rows("select photoid from ".dbprefix."photo where albumid='$albumid'");
$db->query("update ".dbprefix."photo_album set `count_photo`='$count_photo' where albumid='$albumid'");
}
qiMsg("统计完成!");
break;
//推荐相册
case "isrecommend":
$albumid = tsIntval($_GET['albumid']);
$strAlbum = $db->once_fetch_assoc("select isrecommend from ".dbprefix."photo_album where `albumid`='$albumid'");
if($strAlbum['isrecommend']==0){
$db->query("update ".dbprefix."photo_album set `isrecommend`='1' where `albumid`='$albumid'");
}else{
$db->query("update ".dbprefix."photo_album set `isrecommend`='0' where `albumid`='$albumid'");
}
qiMsg("操作成功!");
break;
//是否审核
case "isaudit":
$albumid = tsIntval($_GET['albumid']);
$strAlbum = $new['photo']->find('photo_album',array(
'albumid'=>$albumid,
));
if($strAlbum['isaudit']==0){
$new['photo']->update('photo_album',array(
'albumid'=>$albumid,
),array(
'isaudit'=>1,
));
}else{
$new['photo']->update('photo_album',array(
'albumid'=>$albumid,
),array(
'isaudit'=>0,
));
}
qiMsg("操作成功!");
break;
//删除没有图片的相册
case "nophoto":
$arrAlbum = $new['photo']->findAll('photo_album',"`count_photo`=0");
foreach($arrAlbum as $key=>$item){
$isPhoto = $new['photo']->findCount('photo',array(
'albumid'=>$item['albumid'],
));
if($isPhoto == 0){
$new['photo']->delete('photo_album',array(
'albumid'=>$item['albumid'],
));
}else{
$count_photo = $new['photo']->findCount('photo',array(
'albumid'=>$item['albumid'],
));
$new['photo']->update('photo_album',array(
'albumid'=>$item['albumid'],
),array(
'count_photo'=>$count_photo,
));
}
}
qiMsg('操作成功!');
break;
case "isaudit":
$albumid = tsIntval($_GET['albumid']);
$strAlbum = $new['attach']->find('photo_album',array(
'albumid'=>$albumid,
));
if($strAlbum['isaudit']==1){
$new['attach']->update('photo_album',array(
'albumid'=>$albumid,
),array(
'isaudit'=>0
));
}
if($strAlbum['isaudit']==0){
$new['attach']->update('photo_album',array(
'albumid'=>$albumid,
),array(
'isaudit'=>1
));
}
qiMsg('操作成功!');
break;
}
+73
View File
@@ -0,0 +1,73 @@
<?php
defined('IN_TS') or die('Access Denied.');
switch ($ts){
case "list":
$userid = intval($_GET['userid']);
$photoid = intval($_GET['photoid']);
$page = isset($_GET['page']) ? intval($_GET['page']) : 1;
$url = SITE_URL.'index.php?app=photo&ac=admin&mg=comment&ts=list&page=';
$lstart = $page*10-10;
$where = null;
if($userid){
$where = array(
'userid'=>$userid,
);
}
if($photoid){
$where = array(
'photoid'=>$photoid,
);
}
$arrComment = $new['photo']->findAll('photo_comment',$where,'addtime desc',null,$lstart.',10');
$commentNum = $new['photo']->findCount('photo_comment',$where);
$pageUrl = pagination($commentNum, 10, $page, $url);
include template("admin/comment_list");
break;
case "delete":
$commentid = intval($_GET['commentid']);
$strComment = $new['photo']->find('photo_comment',array(
'commentid'=>$commentid,
));
$new['photo']->delete('photo_comment',array(
'commentid'=>$commentid,
));
#统计评论数
$count_comment = $new['photo']->findCount('photo_comment',array(
'photoid'=>$strComment['photoid'],
));
//更新评论数
$new['photo']->update('photo',array(
'photoid'=>$strComment['photoid'],
),array(
'count_comment'=>$count_comment,
));
#处理积分
aac('user') -> doScore($TS_URL['app'], $TS_URL['ac'], $TS_URL['ts'],$strComment['userid'],$TS_URL['mg']);
qiMsg('删除成功');
break;
}
+26
View File
@@ -0,0 +1,26 @@
<?php
defined('IN_TS') or die('Access Denied.');
switch($ts){
//基本配置
case "":
$strOption = getAppOptions('photo');
include template("admin/options");
break;
case "do":
$arrOption = $_POST['option'];
#更新app配置选项
upAppOptions('photo',$arrOption);
#更新app导航和我的导航
upAppNav('photo',$arrOption['appname']);
qiMsg('修改成功!');
break;
}
+39
View File
@@ -0,0 +1,39 @@
<?php
defined('IN_TS') or die('Access Denied.');
switch($ts){
case "":
$ugid = tsIntval($_GET['ugid'],1);
$arrUg = $new['photo']->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,'photo',$arrOption);
qiMsg('操作成功!');
break;
}
+40
View File
@@ -0,0 +1,40 @@
<?php
defined('IN_TS') or die('Access Denied.');
switch($ts){
case "list":
$page = tsIntval($_GET['page'],1);
$lstart = $page*10-10;
$url = SITE_URL.'index.php?app=photo&ac=admin&mg=photo&ts=list&page=';
$arrPhoto = $db->fetch_all_assoc("select * from ".dbprefix."photo order by addtime desc limit $lstart,10");
$photoNum = $db->once_fetch_assoc("select count(*) from ".dbprefix."photo");
$pageUrl = pagination($photoNum['count(*)'], 10, $page, $url);
include template("admin/photo_list");
break;
//推荐图片
case "isrecommend":
$photoid = tsIntval($_GET['photoid']);
$strPhoto = $db->once_fetch_assoc("select isrecommend from ".dbprefix."photo where `photoid`='$photoid'");
if($strPhoto['isrecommend']==0){
$db->query("update ".dbprefix."photo set `isrecommend`='1' where `photoid`='$photoid'");
}else{
$db->query("update ".dbprefix."photo set `isrecommend`='0' where `photoid`='$photoid'");
}
qiMsg("操作成功!");
break;
}