mirror of
https://github.com/yunluo/gdk.git
synced 2024-06-20 06:25:13 +02:00
对缩略图方案略作调整
This commit is contained in:
parent
7d02a72738
commit
cd67c3bc8b
|
@ -97,7 +97,7 @@ if(!class_exists('Aq_Resize')) {
|
||||||
|
|
||||||
// Check if $img_url is local.
|
// Check if $img_url is local.
|
||||||
if ( false === strpos( $url, $upload_url ) )
|
if ( false === strpos( $url, $upload_url ) )
|
||||||
throw new Aq_Exception('Image must be local: ' . $url);
|
throw new Aq_Exception('图片必须是本地图片: ' . $url);
|
||||||
|
|
||||||
// Define path of image.
|
// Define path of image.
|
||||||
$rel_path = str_replace( $upload_url, '', $url );
|
$rel_path = str_replace( $upload_url, '', $url );
|
||||||
|
@ -105,7 +105,7 @@ if(!class_exists('Aq_Resize')) {
|
||||||
|
|
||||||
// Check if img path exists, and is an image indeed.
|
// Check if img path exists, and is an image indeed.
|
||||||
if ( ! file_exists( $img_path ) or ! getimagesize( $img_path ) )
|
if ( ! file_exists( $img_path ) or ! getimagesize( $img_path ) )
|
||||||
throw new Aq_Exception('Image file does not exist (or is not an image): ' . $img_path);
|
throw new Aq_Exception('图片不存在或者不是一个图片文件: ' . $img_path);
|
||||||
|
|
||||||
// Get image info.
|
// Get image info.
|
||||||
$info = pathinfo( $img_path );
|
$info = pathinfo( $img_path );
|
||||||
|
|
|
@ -8,3 +8,5 @@ include( 'updates.php' );//在线更新
|
||||||
|
|
||||||
include( 'Payjs.php' );//支付功能
|
include( 'Payjs.php' );//支付功能
|
||||||
include( 'points/points.php' );//积分功能
|
include( 'points/points.php' );//积分功能
|
||||||
|
|
||||||
|
include( 'aq_resizer.php' );//缩略图功能
|
|
@ -944,10 +944,10 @@ function gdk_thumbnail_src() {
|
||||||
$gdk_thumbnail_src = $matches[1][0]; //获取该图片 src
|
$gdk_thumbnail_src = $matches[1][0]; //获取该图片 src
|
||||||
if (empty($gdk_thumbnail_src)) { //如果日志中没有图片,则显示随机图片
|
if (empty($gdk_thumbnail_src)) { //如果日志中没有图片,则显示随机图片
|
||||||
$random = mt_rand(1, 12);
|
$random = mt_rand(1, 12);
|
||||||
echo GDK_BASE_URL.'assets/img/thumb/' . $random . '.jpg';
|
$gdk_thumbnail_src = GDK_BASE_URL.'assets/img/thumb/' . $random . '.jpg';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
echo $gdk_thumbnail_src;
|
return $gdk_thumbnail_src;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue