修复一些问题

This commit is contained in:
zyx0814
2024-05-11 00:27:45 +08:00
Unverified
parent 588b8ec561
commit 5b855704ff
23 changed files with 227 additions and 116 deletions

View File

@@ -338,7 +338,7 @@ class image {
function loadsource() {
$imagecreatefromfunc = &$this->imagecreatefromfunc;
if($imagecreatefromfunc == 'imagecreatefromwebp'){
/*if($imagecreatefromfunc == 'imagecreatefromwebp'){
$info = $this->webpinfo($this->source);
if ($info !== false) {
if ($info['Animation']) {
@@ -350,7 +350,7 @@ class image {
}else{
return -1;
}
}
}*/
$im = @$imagecreatefromfunc($this->source);
if(!$im) {
if(!function_exists('imagecreatefromstring')) {

View File

@@ -351,8 +351,8 @@ class dzz_upgrade
if (!@mkdir($dir, 0777)) {
return false;
}
@touch($dir . '/index.htm');
@chmod($dir . '/index.htm', 0777);
// @touch($dir . '/index.html');
// @chmod($dir . '/index.html', 0777);
}
return true;
}

View File

@@ -17,10 +17,33 @@ class Sysreg{
$chars[date('s')].substr(md5($onlineip.TIMESTAMP), 0, 4).random(4);
C::t('setting')->update('machinecode',$mcode);
C::t('setting')->update('adminfirstlogin',0);
include_once libfile('function/cache');
updatecache(array('machinecode','adminfirstlogin'));
self::upgradeinformation($mcode);
}else{
C::t('setting')->update('adminfirstlogin',0);
}
}
private static function upgradeinformation($machinecode) {
global $_SERVER;
$update = array();
$update[ 'mcode' ] = $machinecode;
$update[ 'usum' ] = 1;
$update[ 'siteurl' ] = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST'];
$update[ 'sitename' ] = getglobal('sitename');
$update[ 'version' ] = CORE_VERSION;
$update[ 'version_level' ] = CORE_VERSION_LEVEL;
$update[ 'release' ] = CORE_RELEASE;
$update[ 'fixbug' ] = CORE_FIXBUG;
$update[ 'license_version' ] = LICENSE_VERSION;
$update[ 'license_limit' ] = LICENSE_LIMIT;
$data = '';
foreach ( $update as $key => $value ) {
$data .= $key . '=' . rawurlencode( $value ) . '&';
}
$upgradeurl = APP_CHECK_URL . "authlicense/count/info/" . rawurlencode( base64_encode( $data ) ) . "/" . time();
dfopen( $upgradeurl );
}
}

View File

@@ -879,6 +879,65 @@ class io_dzz extends io_api
$target = $dir . '/' . $subdir;
return $target;
}
function webpinfo($file) {
if (!is_file($file)) {
return false;
} else {
$file = realpath($file);
}
$fp = fopen($file, 'rb');
if (!$fp) {
return false;
}
$data = fread($fp, 90);
fclose($fp);
unset($fp);
$header_format = 'A4Riff/' . // 获取4个字符的字符串
'I1Filesize/' . // 获取一个整数(文件大小,但不是实际大小)
'A4Webp/' . // 获取4个字符的字符串
'A4Vp/' . // 获取4个字符的字符串
'A74Chunk'; // 获取74个字符的字符串
$header = unpack($header_format, $data);
unset($data, $header_format);
if (!isset($header['Riff']) || strtoupper($header['Riff']) !== 'RIFF') {
return false;
}
if (!isset($header['Webp']) || strtoupper($header['Webp']) !== 'WEBP') {
return false;
}
if (!isset($header['Vp']) || strpos(strtoupper($header['Vp']), 'VP8') === false) {
return false;
}
if (
strpos(strtoupper($header['Chunk']), 'ANIM') !== false ||
strpos(strtoupper($header['Chunk']), 'ANMF') !== false
) {
$header['Animation'] = true;
} else {
$header['Animation'] = false;
}
if (strpos(strtoupper($header['Chunk']), 'ALPH') !== false) {
$header['Alpha'] = true;
} else {
if (strpos(strtoupper($header['Vp']), 'VP8L') !== false) {
// 如果是VP8L假设该图像会有透明度
// 如Google文档中描述的WebP简单文件格式无损部分
$header['Alpha'] = true;
} else {
$header['Alpha'] = false;
}
}
unset($header['Chunk']);
return $header;
}
public function createThumbByOriginal($path, $data, $width = 0, $height = 0, $thumbtype = 1, $original = 0, $extraparams = array(), $filesize = 0)
{
global $_G;
@@ -898,7 +957,7 @@ class io_dzz extends io_api
fclose($fp);
$fileuri = $cachefile;
}
$thumbpath = false;
//如果服务器处理完成后,路径非图片类文件的时候,直接获取文件后缀对应的图片
if (!in_array($ext, array('png', 'jpg', 'gif', 'jpeg','webp')) || !$imginfo = @getimagesize($fileuri)) {
$thumbpath = false;
@@ -920,54 +979,77 @@ class io_dzz extends io_api
$extraflag .= '_' . $extraparams['watermarktext'];
}
if(in_array($data['ext'],array('gif'))){
if(in_array($ext,array('gif'))){
$thumbext = 'gif';
}else{
$thumbext = 'webp';
}
$thumbpath = self::getthumbpath('pichomethumb');
$thumbpathdir = self::getthumbpath('pichomethumb');
if($data['aid']) $thumbname = md5($data['aid'].$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
else $thumbname = md5($path.$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
$targetpath = $thumbpath.$thumbname;
$targetpath = $thumbpathdir.$thumbname;
}
$target = $targetpath;
//图片小于最小水印最小设置时,不生成水印
if ($extraparams['nomark'] ||($_G['setting']['IsWatermarkstatus'] == 0 || ($imginfo[0] < $_G['setting']['watermarkminwidth'] || $imginfo[1] < $_G['setting']['watermarkminheight']))) {
$nomark = 1;
}
//返回原图的时候 或者图片小于缩略图宽高的不生成直接返回原图
if ($original || ($imginfo[0] < $width || $imginfo[1] < $height)) {
$target_attach = $_G['setting']['attachdir'] . './' . $target;
$targetpath = dirname($target_attach);
dmkdir($targetpath);
if($ext == 'webp'){
$info = $this->webpinfo($fileuri);
if ($info !== false) {
if ($info['Animation'] || $info['Alpha']) {
$target_attach = $_G['setting']['attachdir'] . './' . $target;
$targetpath = dirname($target_attach);
dmkdir($targetpath);
if(copy($fileuri, $target_attach)){
$thumbpath = $target_attach;
if (!$nomark) self::watermark($target_attach = $_G['setting']['attachdir'] . './' . $target, '', $extraparams);
$thumbpath = $target;
if(copy($fileuri, $target_attach)){
$thumbpath = $target_attach;
$thumbpath = $target;
}else{
$thumbpath = false;
}
}
}else{
$thumbpath = false;
}
} else {
//生成缩略图
include_once libfile('class/image');
$target_attach = $_G['setting']['attachdir'] . './' . $target;
$targetpath = dirname($target_attach);
dmkdir($targetpath);
$image = new image();
try {
$thumb = $image->Thumb($fileuri, $target, $width, $height, $thumbtype, 0, $extraparams);
}
if(!$thumbpath){
//图片小于最小水印最小设置时,不生成水印
if ($extraparams['nomark'] ||($_G['setting']['IsWatermarkstatus'] == 0 || ($imginfo[0] < $_G['setting']['watermarkminwidth'] || $imginfo[1] < $_G['setting']['watermarkminheight']))) {
$nomark = 1;
}
//返回原图的时候 或者图片小于缩略图宽高的不生成直接返回原图
if ($original || ($imginfo[0] < $width || $imginfo[1] < $height)) {
$target_attach = $_G['setting']['attachdir'] . './' . $target;
$targetpath = dirname($target_attach);
dmkdir($targetpath);
if ($thumb) {
if(copy($fileuri, $target_attach)){
$thumbpath = $target_attach;
if (!$nomark) self::watermark($target_attach = $_G['setting']['attachdir'] . './' . $target, '', $extraparams);
$thumbpath = $target;
} else {
$thumbpath = false;
}
} catch (\Exception $e) {
$thumbpath = false;
} else {
//生成缩略图
include_once libfile('class/image');
$target_attach = $_G['setting']['attachdir'] . './' . $target;
$targetpath = dirname($target_attach);
dmkdir($targetpath);
$image = new image();
try {
$thumb = $image->Thumb($fileuri, $target, $width, $height, $thumbtype, 0, $extraparams);
if ($thumb) {
if (!$nomark) self::watermark($target_attach = $_G['setting']['attachdir'] . './' . $target, '', $extraparams);
$thumbpath = $target;
} else {
$thumbpath = false;
}
} catch (\Exception $e) {
$thumbpath = false;
}
}
}
}
}
//echo $thumbpath;die;
if($cachefile){
@unlink($cachefile);
@@ -1094,9 +1176,14 @@ class io_dzz extends io_api
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
if($thumbpath)$thumbpath = $bz.$thumbpath;
if($thumbpath){
$img = IO::getFileUri($thumbpath);
if ($returnurl) return $img;
else IO::output_thumb($img);
if($returnurl == 1){
return IO::getFileUri($thumbpath);
}elseif($returnurl == 2){
return $thumbpath;
}else {
$img = IO::getStream($thumbpath);
IO::output_thumb($img);
}
}else{
return false;
}

View File

@@ -153,7 +153,7 @@
{
key:0,
url:fitem.imgurl || '',
img:fitem.imgurl || '',
img:fitem.img || '',
aid:fitem.aid || 0,
link:fitem.link || '',
linkval:fitem.linkval || '',
@@ -178,7 +178,7 @@
{
key:0,
url:fitem.imgurl || '',
img:fitem.imgurl || '',
img:fitem.img || '',
aid:fitem.aid || 0,
link:fitem.link || '0',
linkval:fitem.linkval || '',
@@ -206,7 +206,7 @@
key:0,
title:ditem.title || '',
url:ditem.imgurl || '',
img:ditem.imgurl || '',
img:ditem.img || '',
aid:ditem.aid || 0,
link:ditem.link || '0',
linkval:ditem.linkval || '',

View File

@@ -50,7 +50,6 @@
:showmessage="bannerData.ImageLayout.showmessage"
:url="bannerData.ImageLayout.url"
:scrollref="scrollref"
:parentbox="bannerData.ImageLayout.parentbox"
:ischecked="false">
:parentbox="bannerData.ImageLayout.parentbox">
</Image-Layout>
</div>

View File

@@ -51,7 +51,6 @@
:showmessage="bannerData.ImageLayout.showmessage"
:url="bannerData.ImageLayout.url"
:scrollref="scrollref"
:parentbox="bannerData.ImageLayout.parentbox"
:ischecked="false">
:parentbox="bannerData.ImageLayout.parentbox">
</Image-Layout>
</div>

View File

@@ -50,7 +50,6 @@
:showmessage="bannerData.ImageLayout.showmessage"
:url="bannerData.ImageLayout.url"
:scrollref="scrollref"
:parentbox="bannerData.ImageLayout.parentbox"
:ischecked="false">
:parentbox="bannerData.ImageLayout.parentbox">
</Image-Layout>
</div>

View File

@@ -50,7 +50,6 @@
:showmessage="bannerData.ImageLayout.showmessage"
:url="bannerData.ImageLayout.url"
:scrollref="scrollref"
:parentbox="bannerData.ImageLayout.parentbox"
:ischecked="false">
:parentbox="bannerData.ImageLayout.parentbox">
</Image-Layout>
</div>

View File

@@ -9,7 +9,6 @@
:showmessage="bannerData.ImageLayout.showmessage"
:url="bannerData.ImageLayout.url"
:scrollref="scrollref"
:parentbox="bannerData.ImageLayout.parentbox"
:ischecked="false">
:parentbox="bannerData.ImageLayout.parentbox">
</Image-Layout>
</div>

View File

@@ -51,7 +51,6 @@
:showmessage="bannerData.ImageLayout.showmessage"
:url="bannerData.ImageLayout.url"
:scrollref="scrollref"
:parentbox="bannerData.ImageLayout.parentbox"
:ischecked="false">
:parentbox="bannerData.ImageLayout.parentbox">
</Image-Layout>
</div>

View File

@@ -71,7 +71,7 @@ class imageColor
}
$width = 64;
$height = 64;
$img = IO::gettmpThumb($data['rid'], $width, $height, 1, 1);
$img = IO::gettmpThumb($data['rid'], $width, $height, 2, 1);
$img = IO::getStream($img);
if (!$img) {
C::t('pichome_resources_attr')->update($data['rid'], array('isget' => -1));

View File

@@ -5,7 +5,7 @@ use \core as C;
class addfileafter{
public function run($data)
{
dfsockopen(getglobal('localurl') . 'misc.php?mod=addfileafter&rid='.$data['rid'].'&aid='.$data['aid'], 0, '', '', false, '',0.1);
dfsockopen(getglobal('localurl') . 'misc.php?mod=addfileafter&rid='.$data['rid'].'&aid='.$data['aid'], 0, '', '', false, '',10);
}

View File

@@ -2112,6 +2112,8 @@ elseif($operation == 'realfianllypath'){
}elseif($operation == 'getTaskByAppid'){
$appid = isset($_GET['appid']) ? trim($_GET['appid']):'';
$appdata = C::t('pichome_vapp')->fetch($appid);
if($appdata['type'] == 1 || $appdata['type'] == 3){
$taskarr = [
'改名',
'打标签',
@@ -2122,12 +2124,9 @@ elseif($operation == 'realfianllypath'){
foreach($taskarr as $k=>$v){
$datanums[] = ['lablename'=>$taskarr[$k],'data'=>$aitaskdata[$k] ? intval($aitaskdata[$k]):0];
}
if($appdata['type'] == 1) unset($datanums[0]);
$queryInterval = 0;
//计算待生成缩略图总文件数
$filenum = DB::result_first("select count(rid) as num from %t where appid = %s and isdelete = 0",array('pichome_resources',$appid));
$getthumbnum = DB::result_first("select count(t.rid) from %t t left join %t r on r.rid=t.rid where
r.appid = %s and t.sstatus = %d and r.isdelete = 0",['thumb_record','pichome_resources',$appid,1]);
if($getthumbnum < $filenum) $queryInterval = 3;
if(!$queryInterval){
foreach($datanums as $v){
if($v['data']){
@@ -2136,6 +2135,13 @@ elseif($operation == 'realfianllypath'){
}
}
}
$datanums[] = ['lablename'=>'生成缩略图','data'=>$getthumbnum.'/'.$filenum];
//计算待生成缩略图总文件数
$filenum = DB::result_first("select count(rid) as num from %t where appid = %s and isdelete = 0",array('pichome_resources',$appid));
$getthumbnum = DB::result_first("select count(t.rid) from %t t left join %t r on r.rid=t.rid where
r.appid = %s and t.sstatus = %d and r.isdelete = 0",['thumb_record','pichome_resources',$appid,1]);
if($getthumbnum < $filenum) $queryInterval = 3;
$datanums[] = ['lablename'=>'生成缩略图','data'=>$getthumbnum.'/'.$filenum];
}
exit(json_encode(['success'=>true,'data'=>$datanums,'queryInterval'=>$queryInterval]));
}

View File

@@ -23,46 +23,48 @@
</el-button>
</el-tooltip>
<el-popover
placement="bottom"
trigger="click"
width="220"
@show="HeaderRightBtntaskShow(true)"
@hide="HeaderRightBtntaskHide">
<el-text tag="p" size="large" style="margin-bottom: 10px;" v-cloak>待完成的任务</el-text>
<el-space
direction="vertical"
alignment="flex-start"
style="width: 100%;"
size="large"
:fill="true">
<template v-if="HeaderRightBtnTask.loading">
<div style="width: 100px;height: 100px;" v-loading="HeaderRightBtnTask.loading"></div>
</template>
<template v-else>
<template v-for="item in HeaderRightBtnTask.data" :key="item.id">
<div style="display: flex;align-items: center;justify-content: space-between;">
<el-text tag="b">{{item.lablename}}</el-text>
<el-text>{{item.data}}</el-text>
</div>
<template v-if="DocumentVapp.type == 3 || DocumentVapp.type == 1">
<el-popover
placement="bottom"
trigger="click"
width="220"
@show="HeaderRightBtntaskShow(true)"
@hide="HeaderRightBtntaskHide">
<el-text tag="p" size="large" style="margin-bottom: 10px;" v-cloak>待完成的任务</el-text>
<el-space
direction="vertical"
alignment="flex-start"
style="width: 100%;"
size="large"
:fill="true">
<template v-if="HeaderRightBtnTask.loading">
<div style="width: 100px;height: 100px;" v-loading="HeaderRightBtnTask.loading"></div>
</template>
</template>
</el-space>
<template #reference>
<div style="margin-left: 12px;">
<el-tooltip content="任务列表" placement="bottom">
<template v-else>
<template v-for="item in HeaderRightBtnTask.data" :key="item.id">
<div style="display: flex;align-items: center;justify-content: space-between;">
<el-text tag="b">{{item.lablename}}</el-text>
<el-text>{{item.data}}</el-text>
</div>
</template>
</template>
</el-space>
<template #reference>
<div style="margin-left: 12px;">
<el-tooltip content="任务列表" placement="bottom">
<button class="el-button el-button--large is-circle is-text" style="font-size: var(--el-font-size-extra-large);" >
<el-icon>
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 42H42V6H32H30C28.6758 9.15854 26.6758 10.7378 24 10.7378C21.3242 10.7378 19.3242 9.15854 18 6H16H6V42Z" fill="none" stroke="var(--el-button-text-color)" stroke-width="3.5" stroke-linejoin="round"/><path d="M15 24L21 30L33 18" stroke="var(--el-button-text-color)" stroke-width="3.5" stroke-linecap="butt" stroke-linejoin="round"/></svg>
</el-icon>
</button>
</el-tooltip>
</div>
</template>
</el-popover>
</template>
<button class="el-button el-button--large is-circle is-text" style="font-size: var(--el-font-size-extra-large);" >
<el-icon>
<svg viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 42H42V6H32H30C28.6758 9.15854 26.6758 10.7378 24 10.7378C21.3242 10.7378 19.3242 9.15854 18 6H16H6V42Z" fill="none" stroke="var(--el-button-text-color)" stroke-width="3.5" stroke-linejoin="round"/><path d="M15 24L21 30L33 18" stroke="var(--el-button-text-color)" stroke-width="3.5" stroke-linecap="butt" stroke-linejoin="round"/></svg>
</el-icon>
</button>
</el-tooltip>
</div>
</template>
</el-popover>
<el-popover
placement="bottom"
trigger="click"

View File

@@ -413,17 +413,18 @@
this.ImagePageTurning(event.data.dpath);
},
ImageClick({id,CheckedKeys}){//单击事件
return false;
const self = this;
if(this.LeftCurrenType == 'filelist'){
self.$refs.ImageFileRef.EmpytActivefid();
}
if(CheckedKeys && !CheckedKeys.length){
this.Imagedragselect({
CheckedKeys:[]
})
return false;
}
// if(CheckedKeys && !CheckedKeys.length){
// this.Imagedragselect({
// CheckedKeys:[]
// })
// return false;
// }
this.ImageParam.checkedKdys = CheckedKeys;
if(this.RightActiveRid.length==1 && this.RightActiveRid[0] == id){
return false;

View File

@@ -233,7 +233,7 @@
pathkey:res.data.pathkey,
pfid:pfid
};
if(this.LeftCurrenType == 'filelist' && this.hassub){
if(this.LeftCurrenType == 'filelist' && type == 'addchild' && this.hassub){
var str1 = {
fid:res.data.fid,
fname:this.LeftTreeDialogAdd.name,

View File

@@ -1,4 +1,3 @@
<p class="marginTop" style="font-size: var(--el-font-size-base);font-weight: 700;color: var(--el-text-color-regular);">{{ item.name }}</p>
<div class="marginTop">
<div class="tag-box" style="min-height: 31px;">
<el-tag

View File

@@ -21,7 +21,6 @@
@returnparam="Imagereturnparam"
:scrollref="scrollref"
:screenshow="Screenshow"
:ischecked="false"
:hassub="hassub">
<template v-slot:operation="{ data }">
<template v-if="data.share || data.down">
@@ -89,8 +88,8 @@
},
urlparam:{},
operation:{
click:false,//节点是否可被选择
dblclick:true,//节点是否可被双击选择
click:true,//节点是否可被选择
dblclick:false,//节点是否可被双击选择
ctrl:false,//是否开启ctrl选中
shift:false,//是否开启shift选中
contextmenu:false,//是否开启右键

View File

@@ -77,8 +77,8 @@
},
urlparam:{},
operation:{
click:false,//节点是否可被选择
dblclick:true,//节点是否可被双击选择
click:true,//节点是否可被选择
dblclick:false,//节点是否可被双击选择
ctrl:false,//是否开启ctrl选中
shift:false,//是否开启shift选中
contextmenu:false,//是否开启右键

View File

@@ -420,7 +420,7 @@ elseif($method == 'admin_init') {
$ctype = 1;
$data = addslashes(serialize($userstats));
$db->query("REPLACE INTO {$tablepre}syscache (cname, ctype, dateline, data) VALUES ('userstats', '$ctype', '".time()."', '$data')");
exit("<script>window.location.href='index.php?step=5';</script>");
header("location: index.php?step=5");
exit();
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long