18 Commits

45 changed files with 458 additions and 196 deletions

View File

@@ -33,6 +33,7 @@
$type = explode('_', $_GET['type']);
if (in_array('data', $type)) {
updatecache();
C::t('pichome_route')->update_route();
}
if (in_array('tpl', $type) && $_G['config']['output']['tplrefresh']) {
cleartemplatecache();

View File

@@ -50,6 +50,7 @@ class image {
function Thumb($source, $target, $thumbwidth, $thumbheight, $thumbtype = 1, $nosuffix = 0) {
$return = $this->init('thumb', $source, $target,$nosuffix);
if($return <= 0) {
return $this->returncode($return);
}
@@ -275,9 +276,81 @@ class image {
}
return array($x, $y, $w, $h);
}
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;
}
function loadsource() {
$imagecreatefromfunc = &$this->imagecreatefromfunc;
/*if($imagecreatefromfunc == 'imagecreatefromwebp'){
$info = $this->webpinfo($this->source);
if ($info !== false) {
if ($info['Animation']) {
return -1;
}
if ($info['Alpha']) {
return -1;
}
}else{
return -1;
}
}*/
$im = @$imagecreatefromfunc($this->source);
if(!$im) {
if(!function_exists('imagecreatefromstring')) {
@@ -299,7 +372,6 @@ class image {
if(!function_exists('imagecreatetruecolor') || !function_exists('imagecopyresampled') || !function_exists('imagejpeg') || !function_exists('imagecopymerge')) {
return -4;
}
$imagefunc = &$this->imagefunc;
$attach_photo = $this->loadsource();
if($attach_photo < 0) {

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

@@ -271,6 +271,7 @@
C::t('cache')->insert_cachedata_by_cachename($setarr,3600);
return $readperm;
}
}
@@ -683,10 +684,10 @@
}
if ($oscale > $nscale) {
//按宽度等比缩放
return 'imageMogr2/format/'.$format.'/thumbnail/' . $width . 'x' . '/interlace/0 ';
return 'imageMogr2/format/'.$format.'/thumbnail/' . $width . 'x' . '/interlace/0';
} else {
//按高度度等比缩放
return 'imageMogr2/format/'.$format.'/thumbnail/x' . $height . '/interlace/0 ';
return 'imageMogr2/format/'.$format.'/thumbnail/x' . $height . '/interlace/0';
}
}
@@ -933,7 +934,12 @@
else $thumbname = md5($data['path'].$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
$thumbpath = $thumbpath.$thumbname;
$defaultspace = $_G['setting']['defaultspacesetting'];
$cloudpath = $defaultspace['bz'].':'.$defaultspace['did'] . ':/' .$thumbpath;
if($defaultspace['bz'] == 'dzz::'){
$cloudpath = $defaultspace['bz'].'::/' .$thumbpath;
}else{
$cloudpath = $defaultspace['bz'].':'.$defaultspace['did'] . ':/' .$thumbpath;
}
$return = IO::moveThumbFile($cloudpath,$url);
if(isset($return['error'])){
return false;
@@ -1036,13 +1042,25 @@
$hostdata = explode(':',$arr['hostname']);
$bucketurl = $hostdata[0].'://'.$arr['bucket'].'.cos.'.$hostdata[1].'.myqcloud.com';
if($readperm == 2 ){
$d = ($this->host) ? $this->host .'/'. $arr['object']:$bucketurl.'/'.$arr['object'];
$d = ($this->host) ? 'https://'.$this->host .'/'. $arr['object']:$bucketurl.'/'.$arr['object'];
}else{
$d = $qcos->getObjectUrl($arr['bucket'], $arr['object'], '+120 minutes');
if($this->host) $d = str_replace($bucketurl,$this->host,$d);
}
if($this->host) {
$secret_id = $this->qcos_config['credentials']['secretId'];
$secret_key = $this->qcos_config['credentials']['secretKey'];
$StartTimestamp = time();
$EndTimestamp = $StartTimestamp + 7200;
//请求头
$headers = [];
$fileUri = '/'. $arr['object'];
$authorization = $this->get_authorization($secret_key,$secret_id,$StartTimestamp, $EndTimestamp, $fileUri, $headers);
$d = 'https://'.$this->host .'/'. $arr['object'].'?'. $authorization;
}
}
$d = str_replace('#','%23',$d);
return $d;
}

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);
@@ -976,15 +1058,16 @@ class io_dzz extends io_api
if($extraparams['istmp']){
return $thumbpath;
}
$defaultspace = $_G['setting']['defaultspacesetting'];
if($defaultspace['bz'] != 'dzz'){
$cloudpath = $defaultspace['bz'].':'.$defaultspace['did'] . ':' .$thumbpath;
$return = IO::moveThumbFile($cloudpath,$thumbpath);
//$thumbpath = $return;
}
if(isset($return['error'])){
return false;
if($thumbpath){
$defaultspace = $_G['setting']['defaultspacesetting'];
if($defaultspace['bz'] != 'dzz'){
$cloudpath = $defaultspace['bz'].':'.$defaultspace['did'] . ':' .$thumbpath;
$return = IO::moveThumbFile($cloudpath,$thumbpath);
//$thumbpath = $return;
}
if(isset($return['error'])){
return false;
}
}
return $thumbpath;
@@ -1091,11 +1174,16 @@ class io_dzz extends io_api
$extraparams['nomark'] = 1;
$thumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, 0, $extraparams);
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
$thumbpath = $bz.$thumbpath;
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;
}
@@ -1305,7 +1393,7 @@ class io_dzz extends io_api
if(!$thumbpath){
$cthumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, $original, $extraparams, $filesize);
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
$thumbpath = $bz.$cthumbpath;
if($cthumbpath)$thumbpath = $bz.$cthumbpath;
if($cthumbpath){
$cacheid = '';
if($data['aid']){
@@ -1434,7 +1522,7 @@ class io_dzz extends io_api
//创建缩略图
$cthumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, $original, $extraparams, $filesize);
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
$thumbpath = $bz.$cthumbpath;
if($cthumbpath)$thumbpath = $bz.$cthumbpath;
if($cthumbpath){
$cacheid = '';
if($rdata['aid']){

View File

@@ -331,15 +331,18 @@ class table_pichome_resources extends dzz_table
$hascoverrids[] = $v['rid'];
}
$rids = array_diff($rids, $hascoverrids);
foreach (DB::fetch_all("select * from %t where rid in(%n)", array('thumb_record', $rids)) as $v) {
if ($v['rid']) $return[$v['rid']]['imgstatus'] = 1;
if ($v['sstatus']) {
$return[$v['rid']]['icondata'] =IO::getFileUri($v['spath']);
} else $return[$v['rid']]['icondata'] = false;
if ($v['lstatus']) {
$return[$v['rid']]['originalimg'] =IO::getFileUri($v['lpath']);
} else $return[$v['rid']]['originalimg'] = false;
if(!empty($rids)){
foreach (DB::fetch_all("select * from %t where rid in(%n)", array('thumb_record', $rids)) as $v) {
if ($v['rid']) $return[$v['rid']]['imgstatus'] = 1;
if ($v['sstatus']) {
$return[$v['rid']]['icondata'] =IO::getFileUri($v['spath']);
} else $return[$v['rid']]['icondata'] = false;
if ($v['lstatus']) {
$return[$v['rid']]['originalimg'] =IO::getFileUri($v['lpath']);
} else $return[$v['rid']]['originalimg'] = false;
}
}
return $return;
}
@@ -387,6 +390,7 @@ class table_pichome_resources extends dzz_table
$smallthumbparams = ['rid' => $resourcesdata['rid'], 'hash' => VERHASH, 'download' => $download,
'thumbsign' => '0', 'path'=>$resourcesdata['path'],'ext' => $resourcesdata['ext'], 'appid' => $resourcesdata['appid'],'hasthumb'=>$resourcesdata['hasthumb']];
$imgdata['iconimg'] = getglobal('siteurl') . 'index.php?mod=io&op=getImg&path=' . Pencode($smallthumbparams, 0, '') . '&' . VERHASH;
$imgdata['originalimg'] = (!$return) ? false: getglobal('siteurl') . 'index.php?mod=io&op=createThumb&path='.$resourcesdata['dpath'].'&size=large';
}else{
$thumbdata = C::t('thumb_record')->fetch($resourcesdata['rid']);
@@ -474,7 +478,7 @@ class table_pichome_resources extends dzz_table
$smallthumbparams = ['rid' => $resourcesdata['rid'], 'hash' => VERHASH, 'download' => $download,
'thumbsign' => '0', 'path'=>$resourcesdata['path'],'ext' => $resourcesdata['ext'], 'appid' => $resourcesdata['appid'],'hasthumb'=>$resourcesdata['hasthumb']];
$imgdata['iconimg'] = getglobal('siteurl') . 'index.php?mod=io&op=getImg&path=' . Pencode($smallthumbparams, 0, '') . '&' . VERHASH;
$imgdata['originalimg'] = (!$return) ? false: getglobal('siteurl') . 'index.php?mod=io&op=createThumb&path='.$resourcesdata['dpath'].'&size=large';
}else{
$thumbdata = C::t('thumb_record')->fetch($resourcesdata['rid']);
if ($thumbdata['sstatus']) $imgdata['icondata'] = IO::getFileUri($thumbdata['spath']);
@@ -812,7 +816,7 @@ class table_pichome_resources extends dzz_table
$setarr = [];
$setarr['lastdate'] = TIMESTAMP;
//如果当前库有该文件,则使用当前文件
if ($rid = DB::result_first("select rid from %t where path = %d and appid = %s ", array('pichome_resources_attr', $aid, $appid))) {
if ($rid = DB::result_first("select rid from %t where path = %s and appid = %s ", array('pichome_resources_attr', $aid, $appid))) {
$resourcesdata = C::t('pichome_resources')->fetch($rid);
$nfids = explode(',', $resourcesdata['fids']);
$setarr['rid'] = $rid;
@@ -897,7 +901,7 @@ class table_pichome_resources extends dzz_table
} else {
return false;
}
} elseif ($rid = DB::result_first("select rid from %t where path = %d ", array('pichome_resources_attr', $aid))) {
} elseif ($rid = DB::result_first("select rid from %t where path = %s ", array('pichome_resources_attr', $aid))) {
//如果当前库无该文件但其它库有
//获取原文件基本数据
$resourcesdata = C::t('pichome_resources')->fetch($rid);

View File

@@ -190,6 +190,7 @@ const Tmpfile_rec = {
<el-option label="库" value="1"></el-option>
<el-option label="单页" value="2"></el-option>
<el-option label="栏目" value="3"></el-option>
<el-option label="专辑" value="4"></el-option>
</el-select>
<template v-if="parseInt(item.data[0].link) == 0">
<el-input v-model="item.data[0].linkval"></el-input>
@@ -204,7 +205,7 @@ const Tmpfile_rec = {
<el-option v-for="item in typecollection.alonepage" :label="item.pagename" :value="item.id" :key="item.id"></el-option>
</el-select>
</template>
<template v-else-if="parseInt(item.row.link) == 4">
<template v-else-if="parseInt(item.data[0].link) == 4">
<el-select v-model="item.data[0].linkval" style="width: 100%">
<el-option v-for="item in typecollection.tab" :label="item.name" :value="item.gid" :key="item.gid"></el-option>
</el-select>

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

@@ -15,6 +15,10 @@ $appdata = C::t('pichome_vapp')->fetch($resourcesdata['appid']);
if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){
exit(lang('no_perm'));
}
$extension = substr($resourcesdata['name'], strrpos($resourcesdata['name'], '.') + 1);
if($extension != $resourcesdata['ext']){
$resourcesdata['name'] = $resourcesdata['name'].'.'.$resourcesdata['ext'];
}
$resourcesdata['name'] = '"' . (strtolower(CHARSET) == 'utf-8' && (strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strexists($_SERVER['HTTP_USER_AGENT'], 'Edge') || strexists($_SERVER['HTTP_USER_AGENT'], 'rv:11')) ? urlencode($resourcesdata['name']) : ($resourcesdata['name'])) . '"';
$attach = DB::fetch_first("select path,appid from %t where rid = %s",array('pichome_resources_attr',$rid));
if(is_numeric($attach['path'])){

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

@@ -451,7 +451,7 @@ class billfishxport
//$rgbarr = [$rgbcolor['r'],$rgbcolor['g'],$rgbcolor['b']];
// $color = new Color($rgbarr);
$palettesnum[] = $p = $this->getPaletteNumber($intcolor);
$colorarr = ['rid' => $rid,
$pcolorarr = ['rid' => $rid,
'color' => $tmpcolor[1],
'weight' => $tmpcolor[0],
'r' => $rgbcolor['r'],
@@ -459,9 +459,10 @@ class billfishxport
'b' => $rgbcolor['b'],
'p' => $p
];
C::t('pichome_palette')->insert($pcolorarr);
}
C::t('pichome_palette')->insert($colorarr);
}
$isgray = $this->isgray($intcolorsarr);
$attrcolorsetarr = [

View File

@@ -246,7 +246,7 @@
async rightShare() {
var self = this;
if (self.imagesData.dpath){
var res = await axios.post('index.php?mod=pichome&op=library&do=ajax&operation=createshare',{path: self.imagesData.dpath});
var res = await axios.post('index.php?mod=banner&op=appajax&do=createshare',{path: self.imagesData.dpath});
var data = res.data;
if (data.success) {
CopyTxt(self, data.success);

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

@@ -15,6 +15,10 @@ $appdata = C::t('pichome_vapp')->fetch($resourcesdata['appid']);
if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){
exit(lang('no_perm'));
}
$extension = substr($resourcesdata['name'], strrpos($resourcesdata['name'], '.') + 1);
if($extension != $resourcesdata['ext']){
$resourcesdata['name'] = $resourcesdata['name'].'.'.$resourcesdata['ext'];
}
$resourcesdata['name'] = '"' . (strtolower(CHARSET) == 'utf-8' && (strexists($_SERVER['HTTP_USER_AGENT'], 'MSIE') || strexists($_SERVER['HTTP_USER_AGENT'], 'Edge') || strexists($_SERVER['HTTP_USER_AGENT'], 'rv:11')) ? urlencode($resourcesdata['name']) : ($resourcesdata['name'])) . '"';
$attach = DB::fetch_first("select path,appid from %t where rid = %s",array('pichome_resources_attr',$rid));
if(is_numeric($attach['path'])){

View File

@@ -2,6 +2,8 @@
if (!defined('IN_OAOOA')) {
exit('Access Denied');
}
global $_G;
$_G['setting']['sitename']=addslashes($_G['setting']['sitename']);
$overt = getglobal('setting/overt');
if (!$overt && !$overt = C::t('setting')->fetch('overt')) {
Hook::listen('check_login');//检查是否登录,未登录跳转到登录界面

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

@@ -3,7 +3,7 @@
if (!defined('IN_OAOOA')) {
exit('Access Denied');
}
$_G['setting']['sitename']=addslashes($_G['setting']['sitename']);
$operation = isset($_GET['operation']) ? trim($_GET['operation']) : '';
global $_G;
if ($operation == 'filelist') {

View File

@@ -1031,7 +1031,7 @@ where r.isdelete = 0 and r.appid = %s order by r.dateline desc ", ['pichome_reso
$appid = isset($_GET['appid']) ? trim($_GET['appid']) : '';
$url = 'index.php?mod=pichome&op=fileview#appid=' . $appid;
$sid = 'vapp_'.$appid;
$qrcode = C::t('pichome_route')->getQRcodeBySid($url, $appid);
$qrcode = C::t('pichome_route')->getQRcodeBySid($url, $sid);
exit(json_encode(['success' => true, 'qrcode' => $qrcode]));
} else {
$theme = GetThemeColor();

View File

@@ -362,8 +362,8 @@ if($operation == 'save'){
//$attrs['searchval'] = $resourcesattrdata['link'].$resourcesattrdata['name'].getstr($val,255).implode('',$annotationdatas);
C::t('pichome_resources_attr')->update_by_rids($appid,$rid,$attrs);
}elseif($flag == 'link'){
/* $attrs['searchval'] = $resourcesattrdata['name'].getstr($resourcesattrdata['desc'],255).htmlspecialchars($val).implode('',$annotationdatas);
C::t('pichome_resources_attr')->update_by_rid($appid,$rid,$attrs);*/
/* $attrs['searchval'] = $resourcesattrdata['name'].getstr($resourcesattrdata['desc'],255).htmlspecialchars($val).implode('',$annotationdatas);*/
C::t('pichome_resources_attr')->update_by_rid($appid,$rid,$attrs);
}
$returndata[] = ['rid'=>$rid,$flag=>$val];
}

View File

@@ -102,7 +102,7 @@ if ($do == 'addspace') {
C::t('connect_storage')->update($id, $setarr);
updateMediaStatus('dzz::', $setarr['mediastatus']);
} else {
exit(json_encode(array('error' => true, 'msg' => 'ffmpeg开启失败')));
exit(json_encode(array('success' => false, 'msg' => 'ffmpeg开启失败')));
}
} elseif ($connectdata['bz'] == 'QCOS') {
if ($setarr['mediastatus']) {
@@ -121,7 +121,7 @@ if ($do == 'addspace') {
updateMediaStatus('QCOS:' . $id . ':', $setarr['mediastatus']);
// dfsockopen(getglobal('localurl') . 'index.php?mod=pichome&op=convert', 0, '', '', false, '', 1);
} else {
exit(json_encode(array('error' => true, 'msg' => '请检查存储桶是否开启媒体处理')));
exit(json_encode(array('success' => false, 'msg' => '请检查存储桶是否开启媒体处理')));
}
} else {
C::t('connect_storage')->update($id, $setarr);
@@ -145,9 +145,9 @@ if ($do == 'addspace') {
C::t("app_market")->update($app['appid'], array("extra" => serialize($extra)));
if ($setarr['docstatus']) {
$onlyDocumentUrl = rtrim(str_replace('web-apps/apps/api/documents/api.js', '', $extra["DocumentUrl"]), '/') . '/web-apps/apps/api/documents/api.js';
C::t('app_market')->update_by_identifier($app['appid'], ['available' => 1]);
C::t('app_market')->update($app['appid'], ['available' => 1]);
} else {
C::t('app_market')->update_by_identifier($app['appid'], ['available' => 0]);
C::t('app_market')->update($app['appid'], ['available' => 0]);
}
//updatesetting($setting, $settingnew);
C::t('connect_storage')->update($id, $setarr);
@@ -168,7 +168,7 @@ if ($do == 'addspace') {
C::t('connect_storage')->update($id, $setarr);
updateDocStatus('QCOS:' . $id . ':', $setarr['docstatus']);
} else {
exit(json_encode(array('error' => true, 'msg' => '请检查存储桶是否开启文档处理')));
exit(json_encode(array('success' => false, 'msg' => '请检查存储桶是否开启文档处理')));
}
} else {

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

@@ -305,13 +305,10 @@
});
if(item){
if(!item['md5']){
let buffer = await this.fileToBuffer(item.raw)
// 根据文件内容生成 hash 值
const spark = new SparkMD5.ArrayBuffer()
spark.append(buffer)
item['md5'] = spark.end();
item['fileStatus'] = 1;
item['md5'] = await this.getSparkMd5(item.raw,item.id);
}
item['fileStatus'] = 1;
let param = {
md5:item['md5'],
appid:this.DocumentAppid,
@@ -341,6 +338,7 @@
item['Md5Status'] = 4;
}
item['fileStatus'] = 2;
item['percentage'] = 0;
switch (item.Md5Status){
// case 1:
// if(self.UploaderData.FileType==1){
@@ -679,17 +677,40 @@
if(findex>-1) self.UploaderData.fdata.splice(findex,1);
},time);
},
fileToBuffer(file) {
getSparkMd5(file,fileid) {
let self=this;
return new Promise((resolve, reject) => {
const fr = new FileReader()
fr.onload = e => {
resolve(e.target.result)
let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,
chunkSize = 20097152, // Read in chunks of 2MB
chunks = Math.ceil(file.size / chunkSize),
currentChunk = 0,
spark = new SparkMD5.ArrayBuffer(),
fileReader = new FileReader();
let item = self.UploaderData.data[fileid];
fileReader.onload = function (e) {
spark.append(e.target.result); // Append array buffer
currentChunk++;
if (currentChunk < chunks) {
loadNext();
if(item) item['percentage']=currentChunk*chunkSize;
} else {
let sparkmd5 = spark.end();
resolve(sparkmd5);
}
};
fileReader.onerror = function () {
reject(new Error('spark md5 error'))
};
function loadNext() {
let start = currentChunk * chunkSize,
end = ((start + chunkSize) >= file.size) ? file.size : start + chunkSize;
fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
}
fr.readAsArrayBuffer(file)
fr.onerror = () => {
reject(new Error('转换文件格式发生错误'))
}
})
loadNext();
});
},
uploaderdrawerOperation(action,item){
let self=this;

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

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

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

@@ -166,7 +166,7 @@
self.LeftTreePathKeys.forEach(element => {
pathkeys.push(element.pathkey)
});
let {data: res} = await axios.post(MOD_URL+'&op=library&do=ajax&operation=getsearchfoldernum',{
let {data: res} = await axios.post('index.php?mod=banner&op=appajax&do=getsearchfoldernum',{
appid:this.DocumentAppid,
pathkeys:pathkeys.join(',')
});

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

@@ -20,7 +20,7 @@ INSERT INTO `dzz_app_market` (`appid`, `mid`, `appname`, `appico`, `appdesc`, `a
-- 转存表中的数据 `dzz_cron`
--
INSERT INTO `pichome_cron` (`cronid`, `available`, `type`, `name`, `filename`, `lastrun`, `nextrun`, `weekday`, `day`, `hour`, `minute`) VALUES
INSERT INTO `dzz_cron` (`cronid`, `available`, `type`, `name`, `filename`, `lastrun`, `nextrun`, `weekday`, `day`, `hour`, `minute`) VALUES
(1, 1, 'system', '每月通知清理', 'cron_clean_notification_month.php', 1711936031, 1714510800, -1, 1, 5, '0'),
(2, 1, 'system', '每周清理缓存文件', 'cron_cache_cleanup_week.php', 1714354813, 1714942800, 1, -1, 5, '0'),
(3, 1, 'system', '定时删除删除状态库', 'cron_pichome_delete.php', 1714468813, 1714469100, -1, -1, -1, '0 5 10 15 20 25 30 35 40 45 50 55'),

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();
}

View File

@@ -415,7 +415,7 @@ if ($_GET['step'] == 'start') {
];
foreach ($cornarr as $v) {
if (DB::result_first("select cronid from %t where filename = %s", array('cron', $v['filename']))) {
if (!DB::result_first("select cronid from %t where filename = %s", array('cron', $v['filename']))) {
DB::insert('cron', $v);
}
}
@@ -495,7 +495,7 @@ if ($_GET['step'] == 'start') {
'description' => 'ImagetagAnddesc',
'type' => 1,
'update_time' => 0,
'addons' => 'dzz\aiXhimage\classes\ImagetagAnddes',
'addons' => 'dzz\aiXhimage\classes\ImagetagAnddesc',
'status' => 1,
'priority' => 0
), false, true);

View File

@@ -22,11 +22,15 @@ if ($locked) {
}
$limit = 100;
foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_task')) as $v) {
if ($v['aikey'] == 'aiXh::chatImage') {
require_once DZZ_ROOT . './dzz/aiXhimage/class/xhChat.php';
$tplid = $v['tplid'];
$promptdata = C::t('#aiXhimage#ai_xhimageprompt')->fetch($tplid);
if (!$promptdata) continue;
if (!$promptdata){
C::t('ai_task')->delete($v['id']);
continue;
}
$getType = $promptdata['cate'];
if ($promptdata['cate'] == 1) {
$question = $promptdata['prompt'] . '。返回结果的格式为“标签1,标签2,标签3”其中标签之间使用逗号分割。';
@@ -40,6 +44,7 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
C::t('ai_task')->delete($v['id']);
continue;
}
$imgurl = FALSE;
$thumbdata = DB::fetch_first("select * from %t where rid =%s", array('thumb_record', $rid));
if ($thumbdata['sstatus']) {
@@ -56,6 +61,7 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
if(!$metadata['aid']) $metadata['aid'] = 0;
$setarr = ['aid' => $metadata['aid'], 'rid' => $rid, 'gettype' => $getType, 'tplid' => $tplid, 'aikey' => $v['aikey']];
$cachedata = C::t('ai_imageparse')->insertData($setarr);
if ($cachedata) {
if ($cachedata['isget'] && $cachedata['data']) {
$content = $cachedata['data'];
@@ -69,8 +75,14 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
$params['processname'] = $return;
}
$chatclinet = new xhChat();
$aireturn = $chatclinet->getApiData('aiXh::chatImage', $params);
if ($aireturn['error_msg']) return ['error' => $aireturn['error_msg']];
if ($aireturn['error_msg']){
C::t('ai_imageparse')->update($cachedata['id'], ['isget' => 1, 'data' => '']);
C::t('ai_task')->delete($v['id']);
continue;
}
if ($aireturn['result']) {
if ($aireturn['totaltoken']) {
$tokendatas = [
@@ -120,14 +132,19 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
C::t('ai_task')->delete($v['id']);
} elseif ($getType == 2) {
$desc = getstr($content);
C::t('pichome_resources_attr')->update_by_rids($metadata['appid'], $rid, ['desc' => $desc]);
if($desc)C::t('pichome_resources_attr')->update_by_rids($metadata['appid'], $rid, ['desc' => $desc]);
C::t('ai_task')->delete($v['id']);
} elseif ($getType == 0) {
$name = trim(name_filter($content));
$name = str_replace([',','','.','。'],'',$name);
$name = getstr($name,30);
C::t('pichome_resources')->update_by_rids($metadata['appid'], $rid, ['name' => $name.'.'.$metadata['ext']]);
if($content){
C::t('pichome_resources')->update_by_rids($metadata['appid'], $rid, ['name' => $name.'.'.$metadata['ext']]);
}
C::t('ai_task')->delete($v['id']);
}
}

View File

@@ -43,7 +43,7 @@
try{
$return = $eagleexport->execExport($force);
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
// C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('eagleexporterror',$appid.$e->getMessage());
dzz_process::unlock($processname);
}
@@ -57,7 +57,7 @@
try{
$return = $localexport->execExport($force);
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('localexporterror',$appid.$e->getMessage());
dzz_process::unlock($processname);
}
@@ -67,7 +67,7 @@
try{
$return = $billfishxport->execExport($force);
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
// C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('billfishexporterror',$appid.$e->getMessage());
dzz_process::unlock($processname);
}

View File

@@ -24,12 +24,11 @@ if (!$data) exit(json_encode(array('error' => 'no data')));
if ($data['state'] != 3 || $data['isdelete'] > 0) exit(json_encode(array('error' => 'is deleted or state is not allow')));
if ($data['type'] == 0) {
include_once DZZ_ROOT.'dzz'.BS.'eagle'.BS.'class'.BS.'class_eagleexport.php';
//include_once dzz_libfile('eagleexport');
$eagleexport = new eagleexport($data);
try{
$return = $eagleexport->execCheckFile();
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('eagleexporterror', $appid . $e->getMessage());
dzz_process::unlock($processname);
}
@@ -41,7 +40,7 @@ if ($data['type'] == 0) {
try{
$return = $localexport->execCheckFile();
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('localexporterror', $appid . $e->getMessage());
dzz_process::unlock($processname);
}
@@ -52,7 +51,7 @@ if ($data['type'] == 0) {
try{
$return = $billfishxport->execCheckFile();
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('billfishexporterror', $appid . $e->getMessage());
dzz_process::unlock($processname);
}

View File

@@ -26,7 +26,6 @@ $start = $i * $limit;
if ($locked) {
exit(json_encode(array('error' => '进程已被锁定请稍后再试')));
}
$imageCacheName = 'PICHOMETHUMBSTATUS';
$docCacheName = 'PICHOMEDOCSTATUS';
$mediaCacheName = 'PICHOMECONVERTSTATUS';
@@ -79,16 +78,18 @@ foreach (DB::fetch_all("select appid,path,`type` from %t where (`type` = %d or `
}
if (empty($appids)) {
dzz_process::unlock($processname);
exit('success');
}
$datas = DB::fetch_all("select r.rid,r.appid,t.rid,t.sstatus,t.lstatus,t.ltimes,t.stimes,least(t.ltimes,t.stimes) as mintimes
$datas = DB::fetch_all("select r.rid,r.appid,t.rid,t.sstatus,t.lstatus,t.ltimes,t.stimes,t.ltimes+t.stimes as mintimes
from %t t left join %t r on t.rid = r.rid
where (t.sstatus < 1 or t.lstatus < 1) and ((t.ltimes+t.stimes) < %d) and r.isdelete = 0 and r.appid in(%n)
where (t.sstatus < 1 or t.lstatus < 1) and ((t.ltimes+t.stimes) < %d) and r.isdelete = 0 and r.appid in(%n)
order by mintimes asc,r.dateline asc limit $start,$limit", array('thumb_record', 'pichome_resources', 6, $appids));
if ($datas) {
foreach ($datas as $v) {
$processname1 = 'PICHOMEGETTHUMB_' . $v['rid'];
//dzz_process::unlock($processname1);
//如果当前数据是锁定状态则跳过
@@ -124,10 +125,14 @@ if ($datas) {
dzz_process::unlock($processname1);
continue;
}
//调用系统获取缩略图
$returnurl = IO::getThumb($v['rid'], $thumbsign, 0, 1, 1);
dzz_process::unlock($processname1);
try{
//调用系统获取缩略图
$returnurl = IO::getThumb($v['rid'], $thumbsign, 0, 1, 1);
dzz_process::unlock($processname1);
}catch (Exception $e){
runlog('createThumbError',$e->getMessage()."\t".$v['rid']);
dzz_process::unlock($processname1);
}
//exit('aaaa');
}
@@ -155,6 +160,7 @@ function getDzzExt($ext){
}else{
$imageext = $gdlimitext;
}
$imageext[] = 'webp';
$mediaext = explode(',',$_G['config']['pichomeconvertext']);
if(in_array($ext,$docext)){
$type = 'docstatus';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long