Compare commits
18 Commits
@@ -33,6 +33,7 @@
|
|||||||
$type = explode('_', $_GET['type']);
|
$type = explode('_', $_GET['type']);
|
||||||
if (in_array('data', $type)) {
|
if (in_array('data', $type)) {
|
||||||
updatecache();
|
updatecache();
|
||||||
|
C::t('pichome_route')->update_route();
|
||||||
}
|
}
|
||||||
if (in_array('tpl', $type) && $_G['config']['output']['tplrefresh']) {
|
if (in_array('tpl', $type) && $_G['config']['output']['tplrefresh']) {
|
||||||
cleartemplatecache();
|
cleartemplatecache();
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class image {
|
|||||||
|
|
||||||
function Thumb($source, $target, $thumbwidth, $thumbheight, $thumbtype = 1, $nosuffix = 0) {
|
function Thumb($source, $target, $thumbwidth, $thumbheight, $thumbtype = 1, $nosuffix = 0) {
|
||||||
$return = $this->init('thumb', $source, $target,$nosuffix);
|
$return = $this->init('thumb', $source, $target,$nosuffix);
|
||||||
|
|
||||||
if($return <= 0) {
|
if($return <= 0) {
|
||||||
return $this->returncode($return);
|
return $this->returncode($return);
|
||||||
}
|
}
|
||||||
@@ -275,9 +276,81 @@ class image {
|
|||||||
}
|
}
|
||||||
return array($x, $y, $w, $h);
|
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() {
|
function loadsource() {
|
||||||
$imagecreatefromfunc = &$this->imagecreatefromfunc;
|
$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);
|
$im = @$imagecreatefromfunc($this->source);
|
||||||
if(!$im) {
|
if(!$im) {
|
||||||
if(!function_exists('imagecreatefromstring')) {
|
if(!function_exists('imagecreatefromstring')) {
|
||||||
@@ -299,7 +372,6 @@ class image {
|
|||||||
if(!function_exists('imagecreatetruecolor') || !function_exists('imagecopyresampled') || !function_exists('imagejpeg') || !function_exists('imagecopymerge')) {
|
if(!function_exists('imagecreatetruecolor') || !function_exists('imagecopyresampled') || !function_exists('imagejpeg') || !function_exists('imagecopymerge')) {
|
||||||
return -4;
|
return -4;
|
||||||
}
|
}
|
||||||
|
|
||||||
$imagefunc = &$this->imagefunc;
|
$imagefunc = &$this->imagefunc;
|
||||||
$attach_photo = $this->loadsource();
|
$attach_photo = $this->loadsource();
|
||||||
if($attach_photo < 0) {
|
if($attach_photo < 0) {
|
||||||
|
|||||||
@@ -351,8 +351,8 @@ class dzz_upgrade
|
|||||||
if (!@mkdir($dir, 0777)) {
|
if (!@mkdir($dir, 0777)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@touch($dir . '/index.htm');
|
// @touch($dir . '/index.html');
|
||||||
@chmod($dir . '/index.htm', 0777);
|
// @chmod($dir . '/index.html', 0777);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,33 @@ class Sysreg{
|
|||||||
$chars[date('s')].substr(md5($onlineip.TIMESTAMP), 0, 4).random(4);
|
$chars[date('s')].substr(md5($onlineip.TIMESTAMP), 0, 4).random(4);
|
||||||
C::t('setting')->update('machinecode',$mcode);
|
C::t('setting')->update('machinecode',$mcode);
|
||||||
C::t('setting')->update('adminfirstlogin',0);
|
C::t('setting')->update('adminfirstlogin',0);
|
||||||
|
include_once libfile('function/cache');
|
||||||
|
updatecache(array('machinecode','adminfirstlogin'));
|
||||||
|
self::upgradeinformation($mcode);
|
||||||
}else{
|
}else{
|
||||||
C::t('setting')->update('adminfirstlogin',0);
|
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 );
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,6 +271,7 @@
|
|||||||
C::t('cache')->insert_cachedata_by_cachename($setarr,3600);
|
C::t('cache')->insert_cachedata_by_cachename($setarr,3600);
|
||||||
return $readperm;
|
return $readperm;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -683,10 +684,10 @@
|
|||||||
}
|
}
|
||||||
if ($oscale > $nscale) {
|
if ($oscale > $nscale) {
|
||||||
//按宽度等比缩放
|
//按宽度等比缩放
|
||||||
return 'imageMogr2/format/'.$format.'/thumbnail/' . $width . 'x' . '/interlace/0 ';
|
return 'imageMogr2/format/'.$format.'/thumbnail/' . $width . 'x' . '/interlace/0';
|
||||||
} else {
|
} 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;
|
else $thumbname = md5($data['path'].$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
|
||||||
$thumbpath = $thumbpath.$thumbname;
|
$thumbpath = $thumbpath.$thumbname;
|
||||||
$defaultspace = $_G['setting']['defaultspacesetting'];
|
$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);
|
$return = IO::moveThumbFile($cloudpath,$url);
|
||||||
if(isset($return['error'])){
|
if(isset($return['error'])){
|
||||||
return false;
|
return false;
|
||||||
@@ -1036,13 +1042,25 @@
|
|||||||
$hostdata = explode(':',$arr['hostname']);
|
$hostdata = explode(':',$arr['hostname']);
|
||||||
$bucketurl = $hostdata[0].'://'.$arr['bucket'].'.cos.'.$hostdata[1].'.myqcloud.com';
|
$bucketurl = $hostdata[0].'://'.$arr['bucket'].'.cos.'.$hostdata[1].'.myqcloud.com';
|
||||||
if($readperm == 2 ){
|
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{
|
}else{
|
||||||
|
|
||||||
$d = $qcos->getObjectUrl($arr['bucket'], $arr['object'], '+120 minutes');
|
$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;
|
return $d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -879,6 +879,65 @@ class io_dzz extends io_api
|
|||||||
$target = $dir . '/' . $subdir;
|
$target = $dir . '/' . $subdir;
|
||||||
return $target;
|
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)
|
public function createThumbByOriginal($path, $data, $width = 0, $height = 0, $thumbtype = 1, $original = 0, $extraparams = array(), $filesize = 0)
|
||||||
{
|
{
|
||||||
global $_G;
|
global $_G;
|
||||||
@@ -898,7 +957,7 @@ class io_dzz extends io_api
|
|||||||
fclose($fp);
|
fclose($fp);
|
||||||
$fileuri = $cachefile;
|
$fileuri = $cachefile;
|
||||||
}
|
}
|
||||||
|
$thumbpath = false;
|
||||||
//如果服务器处理完成后,路径非图片类文件的时候,直接获取文件后缀对应的图片
|
//如果服务器处理完成后,路径非图片类文件的时候,直接获取文件后缀对应的图片
|
||||||
if (!in_array($ext, array('png', 'jpg', 'gif', 'jpeg','webp')) || !$imginfo = @getimagesize($fileuri)) {
|
if (!in_array($ext, array('png', 'jpg', 'gif', 'jpeg','webp')) || !$imginfo = @getimagesize($fileuri)) {
|
||||||
$thumbpath = false;
|
$thumbpath = false;
|
||||||
@@ -920,54 +979,77 @@ class io_dzz extends io_api
|
|||||||
$extraflag .= '_' . $extraparams['watermarktext'];
|
$extraflag .= '_' . $extraparams['watermarktext'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(in_array($data['ext'],array('gif'))){
|
if(in_array($ext,array('gif'))){
|
||||||
$thumbext = 'gif';
|
$thumbext = 'gif';
|
||||||
}else{
|
}else{
|
||||||
$thumbext = 'webp';
|
$thumbext = 'webp';
|
||||||
}
|
}
|
||||||
$thumbpath = self::getthumbpath('pichomethumb');
|
$thumbpathdir = self::getthumbpath('pichomethumb');
|
||||||
if($data['aid']) $thumbname = md5($data['aid'].$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
|
if($data['aid']) $thumbname = md5($data['aid'].$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
|
||||||
else $thumbname = md5($path.$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
|
else $thumbname = md5($path.$data['thumbsign'].$extraflag).'_'.$data['thumbsign'].'.'.$thumbext;
|
||||||
$targetpath = $thumbpath.$thumbname;
|
$targetpath = $thumbpathdir.$thumbname;
|
||||||
}
|
}
|
||||||
$target = $targetpath;
|
$target = $targetpath;
|
||||||
//图片小于最小水印最小设置时,不生成水印
|
if($ext == 'webp'){
|
||||||
if ($extraparams['nomark'] ||($_G['setting']['IsWatermarkstatus'] == 0 || ($imginfo[0] < $_G['setting']['watermarkminwidth'] || $imginfo[1] < $_G['setting']['watermarkminheight']))) {
|
$info = $this->webpinfo($fileuri);
|
||||||
$nomark = 1;
|
if ($info !== false) {
|
||||||
}
|
if ($info['Animation'] || $info['Alpha']) {
|
||||||
//返回原图的时候 或者图片小于缩略图宽高的不生成直接返回原图
|
$target_attach = $_G['setting']['attachdir'] . './' . $target;
|
||||||
if ($original || ($imginfo[0] < $width || $imginfo[1] < $height)) {
|
$targetpath = dirname($target_attach);
|
||||||
$target_attach = $_G['setting']['attachdir'] . './' . $target;
|
dmkdir($targetpath);
|
||||||
$targetpath = dirname($target_attach);
|
|
||||||
dmkdir($targetpath);
|
|
||||||
|
|
||||||
if(copy($fileuri, $target_attach)){
|
if(copy($fileuri, $target_attach)){
|
||||||
$thumbpath = $target_attach;
|
$thumbpath = $target_attach;
|
||||||
if (!$nomark) self::watermark($target_attach = $_G['setting']['attachdir'] . './' . $target, '', $extraparams);
|
$thumbpath = $target;
|
||||||
$thumbpath = $target;
|
}else{
|
||||||
|
$thumbpath = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$thumbpath = false;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
//生成缩略图
|
if(!$thumbpath){
|
||||||
include_once libfile('class/image');
|
//图片小于最小水印最小设置时,不生成水印
|
||||||
$target_attach = $_G['setting']['attachdir'] . './' . $target;
|
if ($extraparams['nomark'] ||($_G['setting']['IsWatermarkstatus'] == 0 || ($imginfo[0] < $_G['setting']['watermarkminwidth'] || $imginfo[1] < $_G['setting']['watermarkminheight']))) {
|
||||||
$targetpath = dirname($target_attach);
|
$nomark = 1;
|
||||||
dmkdir($targetpath);
|
}
|
||||||
$image = new image();
|
//返回原图的时候 或者图片小于缩略图宽高的不生成直接返回原图
|
||||||
try {
|
if ($original || ($imginfo[0] < $width || $imginfo[1] < $height)) {
|
||||||
$thumb = $image->Thumb($fileuri, $target, $width, $height, $thumbtype, 0, $extraparams);
|
$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);
|
if (!$nomark) self::watermark($target_attach = $_G['setting']['attachdir'] . './' . $target, '', $extraparams);
|
||||||
$thumbpath = $target;
|
$thumbpath = $target;
|
||||||
} else {
|
|
||||||
$thumbpath = false;
|
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} else {
|
||||||
$thumbpath = false;
|
//生成缩略图
|
||||||
|
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;
|
//echo $thumbpath;die;
|
||||||
if($cachefile){
|
if($cachefile){
|
||||||
@unlink($cachefile);
|
@unlink($cachefile);
|
||||||
@@ -976,15 +1058,16 @@ class io_dzz extends io_api
|
|||||||
if($extraparams['istmp']){
|
if($extraparams['istmp']){
|
||||||
return $thumbpath;
|
return $thumbpath;
|
||||||
}
|
}
|
||||||
$defaultspace = $_G['setting']['defaultspacesetting'];
|
if($thumbpath){
|
||||||
if($defaultspace['bz'] != 'dzz'){
|
$defaultspace = $_G['setting']['defaultspacesetting'];
|
||||||
$cloudpath = $defaultspace['bz'].':'.$defaultspace['did'] . ':' .$thumbpath;
|
if($defaultspace['bz'] != 'dzz'){
|
||||||
$return = IO::moveThumbFile($cloudpath,$thumbpath);
|
$cloudpath = $defaultspace['bz'].':'.$defaultspace['did'] . ':' .$thumbpath;
|
||||||
//$thumbpath = $return;
|
$return = IO::moveThumbFile($cloudpath,$thumbpath);
|
||||||
|
//$thumbpath = $return;
|
||||||
}
|
}
|
||||||
if(isset($return['error'])){
|
if(isset($return['error'])){
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $thumbpath;
|
return $thumbpath;
|
||||||
|
|
||||||
@@ -1091,11 +1174,16 @@ class io_dzz extends io_api
|
|||||||
$extraparams['nomark'] = 1;
|
$extraparams['nomark'] = 1;
|
||||||
$thumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, 0, $extraparams);
|
$thumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, 0, $extraparams);
|
||||||
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
|
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
|
||||||
$thumbpath = $bz.$thumbpath;
|
if($thumbpath)$thumbpath = $bz.$thumbpath;
|
||||||
if($thumbpath){
|
if($thumbpath){
|
||||||
$img = IO::getFileUri($thumbpath);
|
if($returnurl == 1){
|
||||||
if ($returnurl) return $img;
|
return IO::getFileUri($thumbpath);
|
||||||
else IO::output_thumb($img);
|
}elseif($returnurl == 2){
|
||||||
|
return $thumbpath;
|
||||||
|
}else {
|
||||||
|
$img = IO::getStream($thumbpath);
|
||||||
|
IO::output_thumb($img);
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1305,7 +1393,7 @@ class io_dzz extends io_api
|
|||||||
if(!$thumbpath){
|
if(!$thumbpath){
|
||||||
$cthumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, $original, $extraparams, $filesize);
|
$cthumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, $original, $extraparams, $filesize);
|
||||||
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
|
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
|
||||||
$thumbpath = $bz.$cthumbpath;
|
if($cthumbpath)$thumbpath = $bz.$cthumbpath;
|
||||||
if($cthumbpath){
|
if($cthumbpath){
|
||||||
$cacheid = '';
|
$cacheid = '';
|
||||||
if($data['aid']){
|
if($data['aid']){
|
||||||
@@ -1434,7 +1522,7 @@ class io_dzz extends io_api
|
|||||||
//创建缩略图
|
//创建缩略图
|
||||||
$cthumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, $original, $extraparams, $filesize);
|
$cthumbpath = IO::createThumbByOriginal($filepath, $data, $width, $height, $thumbtype, $original, $extraparams, $filesize);
|
||||||
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
|
$bz = io_remote::getBzByRemoteid($defaultspace['remoteid']);
|
||||||
$thumbpath = $bz.$cthumbpath;
|
if($cthumbpath)$thumbpath = $bz.$cthumbpath;
|
||||||
if($cthumbpath){
|
if($cthumbpath){
|
||||||
$cacheid = '';
|
$cacheid = '';
|
||||||
if($rdata['aid']){
|
if($rdata['aid']){
|
||||||
|
|||||||
@@ -331,15 +331,18 @@ class table_pichome_resources extends dzz_table
|
|||||||
$hascoverrids[] = $v['rid'];
|
$hascoverrids[] = $v['rid'];
|
||||||
}
|
}
|
||||||
$rids = array_diff($rids, $hascoverrids);
|
$rids = array_diff($rids, $hascoverrids);
|
||||||
foreach (DB::fetch_all("select * from %t where rid in(%n)", array('thumb_record', $rids)) as $v) {
|
if(!empty($rids)){
|
||||||
if ($v['rid']) $return[$v['rid']]['imgstatus'] = 1;
|
foreach (DB::fetch_all("select * from %t where rid in(%n)", array('thumb_record', $rids)) as $v) {
|
||||||
if ($v['sstatus']) {
|
if ($v['rid']) $return[$v['rid']]['imgstatus'] = 1;
|
||||||
$return[$v['rid']]['icondata'] =IO::getFileUri($v['spath']);
|
if ($v['sstatus']) {
|
||||||
} else $return[$v['rid']]['icondata'] = false;
|
$return[$v['rid']]['icondata'] =IO::getFileUri($v['spath']);
|
||||||
if ($v['lstatus']) {
|
} else $return[$v['rid']]['icondata'] = false;
|
||||||
$return[$v['rid']]['originalimg'] =IO::getFileUri($v['lpath']);
|
if ($v['lstatus']) {
|
||||||
} else $return[$v['rid']]['originalimg'] = false;
|
$return[$v['rid']]['originalimg'] =IO::getFileUri($v['lpath']);
|
||||||
|
} else $return[$v['rid']]['originalimg'] = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,6 +390,7 @@ class table_pichome_resources extends dzz_table
|
|||||||
$smallthumbparams = ['rid' => $resourcesdata['rid'], 'hash' => VERHASH, 'download' => $download,
|
$smallthumbparams = ['rid' => $resourcesdata['rid'], 'hash' => VERHASH, 'download' => $download,
|
||||||
'thumbsign' => '0', 'path'=>$resourcesdata['path'],'ext' => $resourcesdata['ext'], 'appid' => $resourcesdata['appid'],'hasthumb'=>$resourcesdata['hasthumb']];
|
'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['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{
|
}else{
|
||||||
|
|
||||||
$thumbdata = C::t('thumb_record')->fetch($resourcesdata['rid']);
|
$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,
|
$smallthumbparams = ['rid' => $resourcesdata['rid'], 'hash' => VERHASH, 'download' => $download,
|
||||||
'thumbsign' => '0', 'path'=>$resourcesdata['path'],'ext' => $resourcesdata['ext'], 'appid' => $resourcesdata['appid'],'hasthumb'=>$resourcesdata['hasthumb']];
|
'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['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{
|
}else{
|
||||||
$thumbdata = C::t('thumb_record')->fetch($resourcesdata['rid']);
|
$thumbdata = C::t('thumb_record')->fetch($resourcesdata['rid']);
|
||||||
if ($thumbdata['sstatus']) $imgdata['icondata'] = IO::getFileUri($thumbdata['spath']);
|
if ($thumbdata['sstatus']) $imgdata['icondata'] = IO::getFileUri($thumbdata['spath']);
|
||||||
@@ -812,7 +816,7 @@ class table_pichome_resources extends dzz_table
|
|||||||
$setarr = [];
|
$setarr = [];
|
||||||
$setarr['lastdate'] = TIMESTAMP;
|
$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);
|
$resourcesdata = C::t('pichome_resources')->fetch($rid);
|
||||||
$nfids = explode(',', $resourcesdata['fids']);
|
$nfids = explode(',', $resourcesdata['fids']);
|
||||||
$setarr['rid'] = $rid;
|
$setarr['rid'] = $rid;
|
||||||
@@ -897,7 +901,7 @@ class table_pichome_resources extends dzz_table
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
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);
|
$resourcesdata = C::t('pichome_resources')->fetch($rid);
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ const Tmpfile_rec = {
|
|||||||
<el-option label="库" value="1"></el-option>
|
<el-option label="库" value="1"></el-option>
|
||||||
<el-option label="单页" value="2"></el-option>
|
<el-option label="单页" value="2"></el-option>
|
||||||
<el-option label="栏目" value="3"></el-option>
|
<el-option label="栏目" value="3"></el-option>
|
||||||
|
<el-option label="专辑" value="4"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<template v-if="parseInt(item.data[0].link) == 0">
|
<template v-if="parseInt(item.data[0].link) == 0">
|
||||||
<el-input v-model="item.data[0].linkval"></el-input>
|
<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-option v-for="item in typecollection.alonepage" :label="item.pagename" :value="item.id" :key="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</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-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-option v-for="item in typecollection.tab" :label="item.name" :value="item.gid" :key="item.gid"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
{
|
{
|
||||||
key:0,
|
key:0,
|
||||||
url:fitem.imgurl || '',
|
url:fitem.imgurl || '',
|
||||||
img:fitem.imgurl || '',
|
img:fitem.img || '',
|
||||||
aid:fitem.aid || 0,
|
aid:fitem.aid || 0,
|
||||||
link:fitem.link || '',
|
link:fitem.link || '',
|
||||||
linkval:fitem.linkval || '',
|
linkval:fitem.linkval || '',
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
{
|
{
|
||||||
key:0,
|
key:0,
|
||||||
url:fitem.imgurl || '',
|
url:fitem.imgurl || '',
|
||||||
img:fitem.imgurl || '',
|
img:fitem.img || '',
|
||||||
aid:fitem.aid || 0,
|
aid:fitem.aid || 0,
|
||||||
link:fitem.link || '0',
|
link:fitem.link || '0',
|
||||||
linkval:fitem.linkval || '',
|
linkval:fitem.linkval || '',
|
||||||
@@ -206,7 +206,7 @@
|
|||||||
key:0,
|
key:0,
|
||||||
title:ditem.title || '',
|
title:ditem.title || '',
|
||||||
url:ditem.imgurl || '',
|
url:ditem.imgurl || '',
|
||||||
img:ditem.imgurl || '',
|
img:ditem.img || '',
|
||||||
aid:ditem.aid || 0,
|
aid:ditem.aid || 0,
|
||||||
link:ditem.link || '0',
|
link:ditem.link || '0',
|
||||||
linkval:ditem.linkval || '',
|
linkval:ditem.linkval || '',
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ $appdata = C::t('pichome_vapp')->fetch($resourcesdata['appid']);
|
|||||||
if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){
|
if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){
|
||||||
exit(lang('no_perm'));
|
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'])) . '"';
|
$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));
|
$attach = DB::fetch_first("select path,appid from %t where rid = %s",array('pichome_resources_attr',$rid));
|
||||||
if(is_numeric($attach['path'])){
|
if(is_numeric($attach['path'])){
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
:showmessage="bannerData.ImageLayout.showmessage"
|
:showmessage="bannerData.ImageLayout.showmessage"
|
||||||
:url="bannerData.ImageLayout.url"
|
:url="bannerData.ImageLayout.url"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:parentbox="bannerData.ImageLayout.parentbox"
|
:parentbox="bannerData.ImageLayout.parentbox">
|
||||||
:ischecked="false">
|
|
||||||
</Image-Layout>
|
</Image-Layout>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,6 @@
|
|||||||
:showmessage="bannerData.ImageLayout.showmessage"
|
:showmessage="bannerData.ImageLayout.showmessage"
|
||||||
:url="bannerData.ImageLayout.url"
|
:url="bannerData.ImageLayout.url"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:parentbox="bannerData.ImageLayout.parentbox"
|
:parentbox="bannerData.ImageLayout.parentbox">
|
||||||
:ischecked="false">
|
|
||||||
</Image-Layout>
|
</Image-Layout>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
:showmessage="bannerData.ImageLayout.showmessage"
|
:showmessage="bannerData.ImageLayout.showmessage"
|
||||||
:url="bannerData.ImageLayout.url"
|
:url="bannerData.ImageLayout.url"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:parentbox="bannerData.ImageLayout.parentbox"
|
:parentbox="bannerData.ImageLayout.parentbox">
|
||||||
:ischecked="false">
|
|
||||||
</Image-Layout>
|
</Image-Layout>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
:showmessage="bannerData.ImageLayout.showmessage"
|
:showmessage="bannerData.ImageLayout.showmessage"
|
||||||
:url="bannerData.ImageLayout.url"
|
:url="bannerData.ImageLayout.url"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:parentbox="bannerData.ImageLayout.parentbox"
|
:parentbox="bannerData.ImageLayout.parentbox">
|
||||||
:ischecked="false">
|
|
||||||
</Image-Layout>
|
</Image-Layout>
|
||||||
</div>
|
</div>
|
||||||
@@ -9,7 +9,6 @@
|
|||||||
:showmessage="bannerData.ImageLayout.showmessage"
|
:showmessage="bannerData.ImageLayout.showmessage"
|
||||||
:url="bannerData.ImageLayout.url"
|
:url="bannerData.ImageLayout.url"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:parentbox="bannerData.ImageLayout.parentbox"
|
:parentbox="bannerData.ImageLayout.parentbox">
|
||||||
:ischecked="false">
|
|
||||||
</Image-Layout>
|
</Image-Layout>
|
||||||
</div>
|
</div>
|
||||||
@@ -51,7 +51,6 @@
|
|||||||
:showmessage="bannerData.ImageLayout.showmessage"
|
:showmessage="bannerData.ImageLayout.showmessage"
|
||||||
:url="bannerData.ImageLayout.url"
|
:url="bannerData.ImageLayout.url"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:parentbox="bannerData.ImageLayout.parentbox"
|
:parentbox="bannerData.ImageLayout.parentbox">
|
||||||
:ischecked="false">
|
|
||||||
</Image-Layout>
|
</Image-Layout>
|
||||||
</div>
|
</div>
|
||||||
@@ -451,7 +451,7 @@ class billfishxport
|
|||||||
//$rgbarr = [$rgbcolor['r'],$rgbcolor['g'],$rgbcolor['b']];
|
//$rgbarr = [$rgbcolor['r'],$rgbcolor['g'],$rgbcolor['b']];
|
||||||
// $color = new Color($rgbarr);
|
// $color = new Color($rgbarr);
|
||||||
$palettesnum[] = $p = $this->getPaletteNumber($intcolor);
|
$palettesnum[] = $p = $this->getPaletteNumber($intcolor);
|
||||||
$colorarr = ['rid' => $rid,
|
$pcolorarr = ['rid' => $rid,
|
||||||
'color' => $tmpcolor[1],
|
'color' => $tmpcolor[1],
|
||||||
'weight' => $tmpcolor[0],
|
'weight' => $tmpcolor[0],
|
||||||
'r' => $rgbcolor['r'],
|
'r' => $rgbcolor['r'],
|
||||||
@@ -459,9 +459,10 @@ class billfishxport
|
|||||||
'b' => $rgbcolor['b'],
|
'b' => $rgbcolor['b'],
|
||||||
'p' => $p
|
'p' => $p
|
||||||
];
|
];
|
||||||
|
C::t('pichome_palette')->insert($pcolorarr);
|
||||||
}
|
}
|
||||||
|
|
||||||
C::t('pichome_palette')->insert($colorarr);
|
|
||||||
}
|
}
|
||||||
$isgray = $this->isgray($intcolorsarr);
|
$isgray = $this->isgray($intcolorsarr);
|
||||||
$attrcolorsetarr = [
|
$attrcolorsetarr = [
|
||||||
|
|||||||
@@ -246,7 +246,7 @@
|
|||||||
async rightShare() {
|
async rightShare() {
|
||||||
var self = this;
|
var self = this;
|
||||||
if (self.imagesData.dpath){
|
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;
|
var data = res.data;
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
CopyTxt(self, data.success);
|
CopyTxt(self, data.success);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class imageColor
|
|||||||
}
|
}
|
||||||
$width = 64;
|
$width = 64;
|
||||||
$height = 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);
|
$img = IO::getStream($img);
|
||||||
if (!$img) {
|
if (!$img) {
|
||||||
C::t('pichome_resources_attr')->update($data['rid'], array('isget' => -1));
|
C::t('pichome_resources_attr')->update($data['rid'], array('isget' => -1));
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use \core as C;
|
|||||||
class addfileafter{
|
class addfileafter{
|
||||||
public function run($data)
|
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);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ $appdata = C::t('pichome_vapp')->fetch($resourcesdata['appid']);
|
|||||||
if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){
|
if(!C::t('pichome_vapp')->getpermbypermdata($appdata['download'],$resourcesdata['appid'],'download')){
|
||||||
exit(lang('no_perm'));
|
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'])) . '"';
|
$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));
|
$attach = DB::fetch_first("select path,appid from %t where rid = %s",array('pichome_resources_attr',$rid));
|
||||||
if(is_numeric($attach['path'])){
|
if(is_numeric($attach['path'])){
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
if (!defined('IN_OAOOA')) {
|
if (!defined('IN_OAOOA')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
|
global $_G;
|
||||||
|
$_G['setting']['sitename']=addslashes($_G['setting']['sitename']);
|
||||||
$overt = getglobal('setting/overt');
|
$overt = getglobal('setting/overt');
|
||||||
if (!$overt && !$overt = C::t('setting')->fetch('overt')) {
|
if (!$overt && !$overt = C::t('setting')->fetch('overt')) {
|
||||||
Hook::listen('check_login');//检查是否登录,未登录跳转到登录界面
|
Hook::listen('check_login');//检查是否登录,未登录跳转到登录界面
|
||||||
|
|||||||
@@ -2112,6 +2112,8 @@ elseif($operation == 'realfianllypath'){
|
|||||||
|
|
||||||
}elseif($operation == 'getTaskByAppid'){
|
}elseif($operation == 'getTaskByAppid'){
|
||||||
$appid = isset($_GET['appid']) ? trim($_GET['appid']):'';
|
$appid = isset($_GET['appid']) ? trim($_GET['appid']):'';
|
||||||
|
$appdata = C::t('pichome_vapp')->fetch($appid);
|
||||||
|
if($appdata['type'] == 1 || $appdata['type'] == 3){
|
||||||
$taskarr = [
|
$taskarr = [
|
||||||
'改名',
|
'改名',
|
||||||
'打标签',
|
'打标签',
|
||||||
@@ -2122,12 +2124,9 @@ elseif($operation == 'realfianllypath'){
|
|||||||
foreach($taskarr as $k=>$v){
|
foreach($taskarr as $k=>$v){
|
||||||
$datanums[] = ['lablename'=>$taskarr[$k],'data'=>$aitaskdata[$k] ? intval($aitaskdata[$k]):0];
|
$datanums[] = ['lablename'=>$taskarr[$k],'data'=>$aitaskdata[$k] ? intval($aitaskdata[$k]):0];
|
||||||
}
|
}
|
||||||
|
if($appdata['type'] == 1) unset($datanums[0]);
|
||||||
$queryInterval = 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){
|
if(!$queryInterval){
|
||||||
foreach($datanums as $v){
|
foreach($datanums as $v){
|
||||||
if($v['data']){
|
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]));
|
exit(json_encode(['success'=>true,'data'=>$datanums,'queryInterval'=>$queryInterval]));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
if (!defined('IN_OAOOA')) {
|
if (!defined('IN_OAOOA')) {
|
||||||
exit('Access Denied');
|
exit('Access Denied');
|
||||||
}
|
}
|
||||||
|
$_G['setting']['sitename']=addslashes($_G['setting']['sitename']);
|
||||||
$operation = isset($_GET['operation']) ? trim($_GET['operation']) : '';
|
$operation = isset($_GET['operation']) ? trim($_GET['operation']) : '';
|
||||||
global $_G;
|
global $_G;
|
||||||
if ($operation == 'filelist') {
|
if ($operation == 'filelist') {
|
||||||
|
|||||||
@@ -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']) : '';
|
$appid = isset($_GET['appid']) ? trim($_GET['appid']) : '';
|
||||||
$url = 'index.php?mod=pichome&op=fileview#appid=' . $appid;
|
$url = 'index.php?mod=pichome&op=fileview#appid=' . $appid;
|
||||||
$sid = 'vapp_'.$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]));
|
exit(json_encode(['success' => true, 'qrcode' => $qrcode]));
|
||||||
} else {
|
} else {
|
||||||
$theme = GetThemeColor();
|
$theme = GetThemeColor();
|
||||||
|
|||||||
@@ -362,8 +362,8 @@ if($operation == 'save'){
|
|||||||
//$attrs['searchval'] = $resourcesattrdata['link'].$resourcesattrdata['name'].getstr($val,255).implode('',$annotationdatas);
|
//$attrs['searchval'] = $resourcesattrdata['link'].$resourcesattrdata['name'].getstr($val,255).implode('',$annotationdatas);
|
||||||
C::t('pichome_resources_attr')->update_by_rids($appid,$rid,$attrs);
|
C::t('pichome_resources_attr')->update_by_rids($appid,$rid,$attrs);
|
||||||
}elseif($flag == 'link'){
|
}elseif($flag == 'link'){
|
||||||
/* $attrs['searchval'] = $resourcesattrdata['name'].getstr($resourcesattrdata['desc'],255).htmlspecialchars($val).implode('',$annotationdatas);
|
/* $attrs['searchval'] = $resourcesattrdata['name'].getstr($resourcesattrdata['desc'],255).htmlspecialchars($val).implode('',$annotationdatas);*/
|
||||||
C::t('pichome_resources_attr')->update_by_rid($appid,$rid,$attrs);*/
|
C::t('pichome_resources_attr')->update_by_rid($appid,$rid,$attrs);
|
||||||
}
|
}
|
||||||
$returndata[] = ['rid'=>$rid,$flag=>$val];
|
$returndata[] = ['rid'=>$rid,$flag=>$val];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ if ($do == 'addspace') {
|
|||||||
C::t('connect_storage')->update($id, $setarr);
|
C::t('connect_storage')->update($id, $setarr);
|
||||||
updateMediaStatus('dzz::', $setarr['mediastatus']);
|
updateMediaStatus('dzz::', $setarr['mediastatus']);
|
||||||
} else {
|
} else {
|
||||||
exit(json_encode(array('error' => true, 'msg' => 'ffmpeg开启失败')));
|
exit(json_encode(array('success' => false, 'msg' => 'ffmpeg开启失败')));
|
||||||
}
|
}
|
||||||
} elseif ($connectdata['bz'] == 'QCOS') {
|
} elseif ($connectdata['bz'] == 'QCOS') {
|
||||||
if ($setarr['mediastatus']) {
|
if ($setarr['mediastatus']) {
|
||||||
@@ -121,7 +121,7 @@ if ($do == 'addspace') {
|
|||||||
updateMediaStatus('QCOS:' . $id . ':', $setarr['mediastatus']);
|
updateMediaStatus('QCOS:' . $id . ':', $setarr['mediastatus']);
|
||||||
// dfsockopen(getglobal('localurl') . 'index.php?mod=pichome&op=convert', 0, '', '', false, '', 1);
|
// dfsockopen(getglobal('localurl') . 'index.php?mod=pichome&op=convert', 0, '', '', false, '', 1);
|
||||||
} else {
|
} else {
|
||||||
exit(json_encode(array('error' => true, 'msg' => '请检查存储桶是否开启媒体处理')));
|
exit(json_encode(array('success' => false, 'msg' => '请检查存储桶是否开启媒体处理')));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
C::t('connect_storage')->update($id, $setarr);
|
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)));
|
C::t("app_market")->update($app['appid'], array("extra" => serialize($extra)));
|
||||||
if ($setarr['docstatus']) {
|
if ($setarr['docstatus']) {
|
||||||
$onlyDocumentUrl = rtrim(str_replace('web-apps/apps/api/documents/api.js', '', $extra["DocumentUrl"]), '/') . '/web-apps/apps/api/documents/api.js';
|
$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 {
|
} else {
|
||||||
C::t('app_market')->update_by_identifier($app['appid'], ['available' => 0]);
|
C::t('app_market')->update($app['appid'], ['available' => 0]);
|
||||||
}
|
}
|
||||||
//updatesetting($setting, $settingnew);
|
//updatesetting($setting, $settingnew);
|
||||||
C::t('connect_storage')->update($id, $setarr);
|
C::t('connect_storage')->update($id, $setarr);
|
||||||
@@ -168,7 +168,7 @@ if ($do == 'addspace') {
|
|||||||
C::t('connect_storage')->update($id, $setarr);
|
C::t('connect_storage')->update($id, $setarr);
|
||||||
updateDocStatus('QCOS:' . $id . ':', $setarr['docstatus']);
|
updateDocStatus('QCOS:' . $id . ':', $setarr['docstatus']);
|
||||||
} else {
|
} else {
|
||||||
exit(json_encode(array('error' => true, 'msg' => '请检查存储桶是否开启文档处理')));
|
exit(json_encode(array('success' => false, 'msg' => '请检查存储桶是否开启文档处理')));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
@@ -23,46 +23,48 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
|
||||||
|
<template v-if="DocumentVapp.type == 3 || DocumentVapp.type == 1">
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
width="220"
|
width="220"
|
||||||
@show="HeaderRightBtntaskShow(true)"
|
@show="HeaderRightBtntaskShow(true)"
|
||||||
@hide="HeaderRightBtntaskHide">
|
@hide="HeaderRightBtntaskHide">
|
||||||
<el-text tag="p" size="large" style="margin-bottom: 10px;" v-cloak>待完成的任务</el-text>
|
<el-text tag="p" size="large" style="margin-bottom: 10px;" v-cloak>待完成的任务</el-text>
|
||||||
<el-space
|
<el-space
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
alignment="flex-start"
|
alignment="flex-start"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
size="large"
|
size="large"
|
||||||
:fill="true">
|
:fill="true">
|
||||||
<template v-if="HeaderRightBtnTask.loading">
|
<template v-if="HeaderRightBtnTask.loading">
|
||||||
<div style="width: 100px;height: 100px;" v-loading="HeaderRightBtnTask.loading"></div>
|
<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>
|
</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>
|
||||||
|
</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>
|
</template>
|
||||||
</el-space>
|
</el-popover>
|
||||||
<template #reference>
|
</template>
|
||||||
<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>
|
|
||||||
<el-popover
|
<el-popover
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
|
|||||||
@@ -413,17 +413,18 @@
|
|||||||
this.ImagePageTurning(event.data.dpath);
|
this.ImagePageTurning(event.data.dpath);
|
||||||
},
|
},
|
||||||
ImageClick({id,CheckedKeys}){//单击事件
|
ImageClick({id,CheckedKeys}){//单击事件
|
||||||
|
return false;
|
||||||
const self = this;
|
const self = this;
|
||||||
if(this.LeftCurrenType == 'filelist'){
|
if(this.LeftCurrenType == 'filelist'){
|
||||||
self.$refs.ImageFileRef.EmpytActivefid();
|
self.$refs.ImageFileRef.EmpytActivefid();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(CheckedKeys && !CheckedKeys.length){
|
// if(CheckedKeys && !CheckedKeys.length){
|
||||||
this.Imagedragselect({
|
// this.Imagedragselect({
|
||||||
CheckedKeys:[]
|
// CheckedKeys:[]
|
||||||
})
|
// })
|
||||||
return false;
|
// return false;
|
||||||
}
|
// }
|
||||||
this.ImageParam.checkedKdys = CheckedKeys;
|
this.ImageParam.checkedKdys = CheckedKeys;
|
||||||
if(this.RightActiveRid.length==1 && this.RightActiveRid[0] == id){
|
if(this.RightActiveRid.length==1 && this.RightActiveRid[0] == id){
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -305,13 +305,10 @@
|
|||||||
});
|
});
|
||||||
if(item){
|
if(item){
|
||||||
if(!item['md5']){
|
if(!item['md5']){
|
||||||
let buffer = await this.fileToBuffer(item.raw)
|
item['fileStatus'] = 1;
|
||||||
// 根据文件内容生成 hash 值
|
item['md5'] = await this.getSparkMd5(item.raw,item.id);
|
||||||
const spark = new SparkMD5.ArrayBuffer()
|
|
||||||
spark.append(buffer)
|
|
||||||
item['md5'] = spark.end();
|
|
||||||
}
|
}
|
||||||
item['fileStatus'] = 1;
|
|
||||||
let param = {
|
let param = {
|
||||||
md5:item['md5'],
|
md5:item['md5'],
|
||||||
appid:this.DocumentAppid,
|
appid:this.DocumentAppid,
|
||||||
@@ -341,6 +338,7 @@
|
|||||||
item['Md5Status'] = 4;
|
item['Md5Status'] = 4;
|
||||||
}
|
}
|
||||||
item['fileStatus'] = 2;
|
item['fileStatus'] = 2;
|
||||||
|
item['percentage'] = 0;
|
||||||
switch (item.Md5Status){
|
switch (item.Md5Status){
|
||||||
// case 1:
|
// case 1:
|
||||||
// if(self.UploaderData.FileType==1){
|
// if(self.UploaderData.FileType==1){
|
||||||
@@ -679,17 +677,40 @@
|
|||||||
if(findex>-1) self.UploaderData.fdata.splice(findex,1);
|
if(findex>-1) self.UploaderData.fdata.splice(findex,1);
|
||||||
},time);
|
},time);
|
||||||
},
|
},
|
||||||
fileToBuffer(file) {
|
|
||||||
|
getSparkMd5(file,fileid) {
|
||||||
|
let self=this;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const fr = new FileReader()
|
let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice,
|
||||||
fr.onload = e => {
|
chunkSize = 20097152, // Read in chunks of 2MB
|
||||||
resolve(e.target.result)
|
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)
|
loadNext();
|
||||||
fr.onerror = () => {
|
});
|
||||||
reject(new Error('转换文件格式发生错误'))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
uploaderdrawerOperation(action,item){
|
uploaderdrawerOperation(action,item){
|
||||||
let self=this;
|
let self=this;
|
||||||
|
|||||||
@@ -233,7 +233,7 @@
|
|||||||
pathkey:res.data.pathkey,
|
pathkey:res.data.pathkey,
|
||||||
pfid:pfid
|
pfid:pfid
|
||||||
};
|
};
|
||||||
if(this.LeftCurrenType == 'filelist' && this.hassub){
|
if(this.LeftCurrenType == 'filelist' && type == 'addchild' && this.hassub){
|
||||||
var str1 = {
|
var str1 = {
|
||||||
fid:res.data.fid,
|
fid:res.data.fid,
|
||||||
fname:this.LeftTreeDialogAdd.name,
|
fname:this.LeftTreeDialogAdd.name,
|
||||||
|
|||||||
@@ -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="marginTop">
|
||||||
<div class="tag-box" style="min-height: 31px;">
|
<div class="tag-box" style="min-height: 31px;">
|
||||||
<el-tag
|
<el-tag
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
},
|
},
|
||||||
urlparam:{},
|
urlparam:{},
|
||||||
operation:{
|
operation:{
|
||||||
click:false,//节点是否可被选择
|
click:true,//节点是否可被选择
|
||||||
dblclick:true,//节点是否可被双击选择
|
dblclick:false,//节点是否可被双击选择
|
||||||
ctrl:false,//是否开启ctrl选中
|
ctrl:false,//是否开启ctrl选中
|
||||||
shift:false,//是否开启shift选中
|
shift:false,//是否开启shift选中
|
||||||
contextmenu:false,//是否开启右键
|
contextmenu:false,//是否开启右键
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
@returnparam="Imagereturnparam"
|
@returnparam="Imagereturnparam"
|
||||||
:scrollref="scrollref"
|
:scrollref="scrollref"
|
||||||
:screenshow="Screenshow"
|
:screenshow="Screenshow"
|
||||||
:ischecked="false"
|
|
||||||
:hassub="hassub">
|
:hassub="hassub">
|
||||||
<template v-slot:operation="{ data }">
|
<template v-slot:operation="{ data }">
|
||||||
<template v-if="data.share || data.down">
|
<template v-if="data.share || data.down">
|
||||||
@@ -89,8 +88,8 @@
|
|||||||
},
|
},
|
||||||
urlparam:{},
|
urlparam:{},
|
||||||
operation:{
|
operation:{
|
||||||
click:false,//节点是否可被选择
|
click:true,//节点是否可被选择
|
||||||
dblclick:true,//节点是否可被双击选择
|
dblclick:false,//节点是否可被双击选择
|
||||||
ctrl:false,//是否开启ctrl选中
|
ctrl:false,//是否开启ctrl选中
|
||||||
shift:false,//是否开启shift选中
|
shift:false,//是否开启shift选中
|
||||||
contextmenu:false,//是否开启右键
|
contextmenu:false,//是否开启右键
|
||||||
|
|||||||
@@ -166,7 +166,7 @@
|
|||||||
self.LeftTreePathKeys.forEach(element => {
|
self.LeftTreePathKeys.forEach(element => {
|
||||||
pathkeys.push(element.pathkey)
|
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,
|
appid:this.DocumentAppid,
|
||||||
pathkeys:pathkeys.join(',')
|
pathkeys:pathkeys.join(',')
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -77,8 +77,8 @@
|
|||||||
},
|
},
|
||||||
urlparam:{},
|
urlparam:{},
|
||||||
operation:{
|
operation:{
|
||||||
click:false,//节点是否可被选择
|
click:true,//节点是否可被选择
|
||||||
dblclick:true,//节点是否可被双击选择
|
dblclick:false,//节点是否可被双击选择
|
||||||
ctrl:false,//是否开启ctrl选中
|
ctrl:false,//是否开启ctrl选中
|
||||||
shift:false,//是否开启shift选中
|
shift:false,//是否开启shift选中
|
||||||
contextmenu:false,//是否开启右键
|
contextmenu:false,//是否开启右键
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ INSERT INTO `dzz_app_market` (`appid`, `mid`, `appname`, `appico`, `appdesc`, `a
|
|||||||
-- 转存表中的数据 `dzz_cron`
|
-- 转存表中的数据 `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'),
|
(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'),
|
(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'),
|
(3, 1, 'system', '定时删除删除状态库', 'cron_pichome_delete.php', 1714468813, 1714469100, -1, -1, -1, '0 5 10 15 20 25 30 35 40 45 50 55'),
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ elseif($method == 'admin_init') {
|
|||||||
$ctype = 1;
|
$ctype = 1;
|
||||||
$data = addslashes(serialize($userstats));
|
$data = addslashes(serialize($userstats));
|
||||||
$db->query("REPLACE INTO {$tablepre}syscache (cname, ctype, dateline, data) VALUES ('userstats', '$ctype', '".time()."', '$data')");
|
$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");
|
header("location: index.php?step=5");
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ if ($_GET['step'] == 'start') {
|
|||||||
|
|
||||||
];
|
];
|
||||||
foreach ($cornarr as $v) {
|
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);
|
DB::insert('cron', $v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -495,7 +495,7 @@ if ($_GET['step'] == 'start') {
|
|||||||
'description' => 'ImagetagAnddesc',
|
'description' => 'ImagetagAnddesc',
|
||||||
'type' => 1,
|
'type' => 1,
|
||||||
'update_time' => 0,
|
'update_time' => 0,
|
||||||
'addons' => 'dzz\aiXhimage\classes\ImagetagAnddes',
|
'addons' => 'dzz\aiXhimage\classes\ImagetagAnddesc',
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'priority' => 0
|
'priority' => 0
|
||||||
), false, true);
|
), false, true);
|
||||||
|
|||||||
@@ -22,11 +22,15 @@ if ($locked) {
|
|||||||
}
|
}
|
||||||
$limit = 100;
|
$limit = 100;
|
||||||
foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_task')) as $v) {
|
foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_task')) as $v) {
|
||||||
|
|
||||||
if ($v['aikey'] == 'aiXh::chatImage') {
|
if ($v['aikey'] == 'aiXh::chatImage') {
|
||||||
require_once DZZ_ROOT . './dzz/aiXhimage/class/xhChat.php';
|
require_once DZZ_ROOT . './dzz/aiXhimage/class/xhChat.php';
|
||||||
$tplid = $v['tplid'];
|
$tplid = $v['tplid'];
|
||||||
$promptdata = C::t('#aiXhimage#ai_xhimageprompt')->fetch($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'];
|
$getType = $promptdata['cate'];
|
||||||
if ($promptdata['cate'] == 1) {
|
if ($promptdata['cate'] == 1) {
|
||||||
$question = $promptdata['prompt'] . '。返回结果的格式为“标签1,标签2,标签3”,其中标签之间使用逗号分割。';
|
$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']);
|
C::t('ai_task')->delete($v['id']);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$imgurl = FALSE;
|
$imgurl = FALSE;
|
||||||
$thumbdata = DB::fetch_first("select * from %t where rid =%s", array('thumb_record', $rid));
|
$thumbdata = DB::fetch_first("select * from %t where rid =%s", array('thumb_record', $rid));
|
||||||
if ($thumbdata['sstatus']) {
|
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;
|
if(!$metadata['aid']) $metadata['aid'] = 0;
|
||||||
$setarr = ['aid' => $metadata['aid'], 'rid' => $rid, 'gettype' => $getType, 'tplid' => $tplid, 'aikey' => $v['aikey']];
|
$setarr = ['aid' => $metadata['aid'], 'rid' => $rid, 'gettype' => $getType, 'tplid' => $tplid, 'aikey' => $v['aikey']];
|
||||||
$cachedata = C::t('ai_imageparse')->insertData($setarr);
|
$cachedata = C::t('ai_imageparse')->insertData($setarr);
|
||||||
|
|
||||||
if ($cachedata) {
|
if ($cachedata) {
|
||||||
if ($cachedata['isget'] && $cachedata['data']) {
|
if ($cachedata['isget'] && $cachedata['data']) {
|
||||||
$content = $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;
|
$params['processname'] = $return;
|
||||||
}
|
}
|
||||||
$chatclinet = new xhChat();
|
$chatclinet = new xhChat();
|
||||||
|
|
||||||
$aireturn = $chatclinet->getApiData('aiXh::chatImage', $params);
|
$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['result']) {
|
||||||
if ($aireturn['totaltoken']) {
|
if ($aireturn['totaltoken']) {
|
||||||
$tokendatas = [
|
$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']);
|
C::t('ai_task')->delete($v['id']);
|
||||||
} elseif ($getType == 2) {
|
} elseif ($getType == 2) {
|
||||||
$desc = getstr($content);
|
$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']);
|
C::t('ai_task')->delete($v['id']);
|
||||||
} elseif ($getType == 0) {
|
} elseif ($getType == 0) {
|
||||||
|
|
||||||
$name = trim(name_filter($content));
|
$name = trim(name_filter($content));
|
||||||
$name = str_replace([',',',','.','。'],'',$name);
|
$name = str_replace([',',',','.','。'],'',$name);
|
||||||
$name = getstr($name,30);
|
$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']);
|
C::t('ai_task')->delete($v['id']);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
try{
|
try{
|
||||||
$return = $eagleexport->execExport($force);
|
$return = $eagleexport->execExport($force);
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
C::t('pichome_vapp')->update($appid,['state'=>0]);
|
// C::t('pichome_vapp')->update($appid,['state'=>0]);
|
||||||
runlog('eagleexporterror',$appid.$e->getMessage());
|
runlog('eagleexporterror',$appid.$e->getMessage());
|
||||||
dzz_process::unlock($processname);
|
dzz_process::unlock($processname);
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
try{
|
try{
|
||||||
$return = $localexport->execExport($force);
|
$return = $localexport->execExport($force);
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
C::t('pichome_vapp')->update($appid,['state'=>0]);
|
//C::t('pichome_vapp')->update($appid,['state'=>0]);
|
||||||
runlog('localexporterror',$appid.$e->getMessage());
|
runlog('localexporterror',$appid.$e->getMessage());
|
||||||
dzz_process::unlock($processname);
|
dzz_process::unlock($processname);
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
try{
|
try{
|
||||||
$return = $billfishxport->execExport($force);
|
$return = $billfishxport->execExport($force);
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
C::t('pichome_vapp')->update($appid,['state'=>0]);
|
// C::t('pichome_vapp')->update($appid,['state'=>0]);
|
||||||
runlog('billfishexporterror',$appid.$e->getMessage());
|
runlog('billfishexporterror',$appid.$e->getMessage());
|
||||||
dzz_process::unlock($processname);
|
dzz_process::unlock($processname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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['state'] != 3 || $data['isdelete'] > 0) exit(json_encode(array('error' => 'is deleted or state is not allow')));
|
||||||
if ($data['type'] == 0) {
|
if ($data['type'] == 0) {
|
||||||
include_once DZZ_ROOT.'dzz'.BS.'eagle'.BS.'class'.BS.'class_eagleexport.php';
|
include_once DZZ_ROOT.'dzz'.BS.'eagle'.BS.'class'.BS.'class_eagleexport.php';
|
||||||
//include_once dzz_libfile('eagleexport');
|
|
||||||
$eagleexport = new eagleexport($data);
|
$eagleexport = new eagleexport($data);
|
||||||
try{
|
try{
|
||||||
$return = $eagleexport->execCheckFile();
|
$return = $eagleexport->execCheckFile();
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
C::t('pichome_vapp')->update($appid,['state'=>0]);
|
//C::t('pichome_vapp')->update($appid,['state'=>0]);
|
||||||
runlog('eagleexporterror', $appid . $e->getMessage());
|
runlog('eagleexporterror', $appid . $e->getMessage());
|
||||||
dzz_process::unlock($processname);
|
dzz_process::unlock($processname);
|
||||||
}
|
}
|
||||||
@@ -41,7 +40,7 @@ if ($data['type'] == 0) {
|
|||||||
try{
|
try{
|
||||||
$return = $localexport->execCheckFile();
|
$return = $localexport->execCheckFile();
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
C::t('pichome_vapp')->update($appid,['state'=>0]);
|
//C::t('pichome_vapp')->update($appid,['state'=>0]);
|
||||||
runlog('localexporterror', $appid . $e->getMessage());
|
runlog('localexporterror', $appid . $e->getMessage());
|
||||||
dzz_process::unlock($processname);
|
dzz_process::unlock($processname);
|
||||||
}
|
}
|
||||||
@@ -52,7 +51,7 @@ if ($data['type'] == 0) {
|
|||||||
try{
|
try{
|
||||||
$return = $billfishxport->execCheckFile();
|
$return = $billfishxport->execCheckFile();
|
||||||
}catch (Exception $e){
|
}catch (Exception $e){
|
||||||
C::t('pichome_vapp')->update($appid,['state'=>0]);
|
//C::t('pichome_vapp')->update($appid,['state'=>0]);
|
||||||
runlog('billfishexporterror', $appid . $e->getMessage());
|
runlog('billfishexporterror', $appid . $e->getMessage());
|
||||||
dzz_process::unlock($processname);
|
dzz_process::unlock($processname);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ $start = $i * $limit;
|
|||||||
if ($locked) {
|
if ($locked) {
|
||||||
exit(json_encode(array('error' => '进程已被锁定请稍后再试')));
|
exit(json_encode(array('error' => '进程已被锁定请稍后再试')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$imageCacheName = 'PICHOMETHUMBSTATUS';
|
$imageCacheName = 'PICHOMETHUMBSTATUS';
|
||||||
$docCacheName = 'PICHOMEDOCSTATUS';
|
$docCacheName = 'PICHOMEDOCSTATUS';
|
||||||
$mediaCacheName = 'PICHOMECONVERTSTATUS';
|
$mediaCacheName = 'PICHOMECONVERTSTATUS';
|
||||||
@@ -79,16 +78,18 @@ foreach (DB::fetch_all("select appid,path,`type` from %t where (`type` = %d or `
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($appids)) {
|
if (empty($appids)) {
|
||||||
|
dzz_process::unlock($processname);
|
||||||
exit('success');
|
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
|
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));
|
order by mintimes asc,r.dateline asc limit $start,$limit", array('thumb_record', 'pichome_resources', 6, $appids));
|
||||||
|
|
||||||
if ($datas) {
|
if ($datas) {
|
||||||
foreach ($datas as $v) {
|
foreach ($datas as $v) {
|
||||||
|
|
||||||
$processname1 = 'PICHOMEGETTHUMB_' . $v['rid'];
|
$processname1 = 'PICHOMEGETTHUMB_' . $v['rid'];
|
||||||
//dzz_process::unlock($processname1);
|
//dzz_process::unlock($processname1);
|
||||||
//如果当前数据是锁定状态则跳过
|
//如果当前数据是锁定状态则跳过
|
||||||
@@ -124,10 +125,14 @@ if ($datas) {
|
|||||||
dzz_process::unlock($processname1);
|
dzz_process::unlock($processname1);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
try{
|
||||||
//调用系统获取缩略图
|
//调用系统获取缩略图
|
||||||
$returnurl = IO::getThumb($v['rid'], $thumbsign, 0, 1, 1);
|
$returnurl = IO::getThumb($v['rid'], $thumbsign, 0, 1, 1);
|
||||||
dzz_process::unlock($processname1);
|
dzz_process::unlock($processname1);
|
||||||
|
}catch (Exception $e){
|
||||||
|
runlog('createThumbError',$e->getMessage()."\t".$v['rid']);
|
||||||
|
dzz_process::unlock($processname1);
|
||||||
|
}
|
||||||
//exit('aaaa');
|
//exit('aaaa');
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -155,6 +160,7 @@ function getDzzExt($ext){
|
|||||||
}else{
|
}else{
|
||||||
$imageext = $gdlimitext;
|
$imageext = $gdlimitext;
|
||||||
}
|
}
|
||||||
|
$imageext[] = 'webp';
|
||||||
$mediaext = explode(',',$_G['config']['pichomeconvertext']);
|
$mediaext = explode(',',$_G['config']['pichomeconvertext']);
|
||||||
if(in_array($ext,$docext)){
|
if(in_array($ext,$docext)){
|
||||||
$type = 'docstatus';
|
$type = 'docstatus';
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user