From e27ef90cce6caea1f90d03b54757f9dd3993d0b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Thu, 13 Feb 2020 19:07:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=A9=E7=95=A5=E5=9B=BE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- functions/Common.php | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0397dab..41da908 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ desktop.ini .ecloud/* -.git/ \ No newline at end of file +.git/ +public/cache/*.txt diff --git a/functions/Common.php b/functions/Common.php index d6c4d05..beb37ac 100644 --- a/functions/Common.php +++ b/functions/Common.php @@ -954,20 +954,23 @@ function gdk_thumbnail_src() { /** * 获取略缩图,输出img标签代码 * @param [init] $way 缩略图方案代码,1=cdn,2=timthumb,3=aq_resize - * @param [string] $url 缩略图原图链接,调用gdk_thumbnail_src() * @param [init] $width 缩略图宽度 * @param [init] $height 缩略图高度 * @param [string] $style 图片样式,cdn方案时有效 * @param [string] $atrr img标签的属性 * @return [string] img标签的图片代码 */ -function gdk_thumb_img($way,$url,$width,$height,$style,$atrr = 'class="thumb_img"'){ +function gdk_thumb_img($way,$width,$height,$style = '',$atrr = 'class="thumb_img"'){ + $url = gdk_thumbnail_src(); if ($way === 1) {//cdn $src = $url.'!'.$style; }elseif ($way === 2) { $src = GDK_BASE_URL . '/public/timthumb.php?src='.$url.'&h='.$height.'&w='.$width.'&q=90&zc=1&ct=1'; }elseif ($way === 3) { $src = aq_resize( $url, $width , $height , true); + if(empty($src)){ + $src = GDK_BASE_URL . '/public/timthumb.php?src='.$url.'&h='.$height.'&w='.$width.'&q=90&zc=1&ct=1'; + } }else{ return false; }