complete thumb preivew in folder shareing page

pull/87/head
HFO4 7 years ago
parent c7f7e20978
commit a1a9f7cdb0

@ -133,14 +133,17 @@ class Share extends Controller{
}
public function Thumb(){
$filePath = input("get.path");
$shareId = input('get.shareKey');
$filePath = input('get.path');
if(input("get.isImg") != "true"){
return "";
}
$fileObj = new FileManage($filePath,$this->userObj->uid);
$Redirect = $fileObj->getThumb();
$shareObj = new ShareHandler($shareId,false);
$Redirect = $shareObj->getThumb($this->userObj,$filePath);
if($Redirect[0]){
$this->redirect($Redirect[1],302);
}else{
$this->error($Redirect[1],403,$this->siteOptions);
}
}

@ -1104,7 +1104,7 @@ class FileManage extends Model{
->where('uid',$uid)
->where('dlay_time',">",time())
->sum('pack_size');
return (int)$addOnStorage+(int)$basicStronge["max_storage"];
return $addOnStorage+$basicStronge["max_storage"];
}
static function getUsedStorage($uid){

@ -81,6 +81,20 @@ class ShareHandler extends Model{
}
}
public function getThumb($user,$path,$folder=false){
$checkStatus = $this->checkSession($user);
if(!$checkStatus[0]){
return [$checkStatus[0],$checkStatus[1]];
}
$reqPath = Db::name('folders')->where('position_absolute',$this->shareData["source_name"])->find();
if($folder){
$fileObj = new FileManage($path,$this->shareData["owner"]);
}else{
$fileObj = new FileManage($reqPath["position_absolute"].$path,$this->shareData["owner"]);
}
return $fileObj->getThumb();
}
public function checkSession($user){
if($this->lockStatus){
return [false,"会话过期,请刷新页面"];

@ -1040,4 +1040,11 @@ video {
}
.btn-group-vertical.open>.dropdown-toggle.btn, .btn-group-vertical.open>.dropdown-toggle.btn.btn-default, .btn-group.open>.dropdown-toggle.btn, .btn-group.open>.dropdown-toggle.btn.btn-default {
background-color: #5468d6;
}
.smallImg {
max-width: 90px;
max-height: 39px;
}
.item-icon{
min-height: 39px;
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save