From 757d36c760154a09e27ec8defff9ccdf4de9bd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Sun, 22 Mar 2020 00:33:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/options-config.php | 6 ++++++ functions/Ajax.php | 2 +- functions/Common.php | 9 +++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/framework/options-config.php b/framework/options-config.php index ee2241f..ca5cdaf 100644 --- a/framework/options-config.php +++ b/framework/options-config.php @@ -397,6 +397,12 @@ $gdk_options = [ 'id' => 'gdk_sidebar_cache', 'type' => 'checkbox', ], + [ + 'name' => '新窗口打开', + 'desc' => '禁用 【禁用后,所有文章链接将当前窗口打开】', + 'id' => 'gdk_target_blank', + 'type' => 'checkbox', + ], [ 'title' => '统一支付设置', 'type' => 'title', diff --git a/functions/Ajax.php b/functions/Ajax.php index 73b2eda..2f347bb 100644 --- a/functions/Ajax.php +++ b/functions/Ajax.php @@ -32,7 +32,7 @@ function gdk_ajax_get_update() $plugin_info = json_decode($response['body'], true); $version = $plugin_info['version']; - if (version_compare($version, GDK_PLUGIN_VER, '>')) { + if (!version_compare($version, GDK_PLUGIN_VER, '<')) { exit('插件有更新,新版本:' . $version . ' '); } else { exit('你的插件目前已经是最新版了!'); diff --git a/functions/Common.php b/functions/Common.php index dd36dd8..1855f0a 100644 --- a/functions/Common.php +++ b/functions/Common.php @@ -1314,3 +1314,12 @@ function unzip_url($url, $where) usleep(300000); @unlink($zippath); } + +//新窗口打开 +function blank_open() +{ + if (!gdk_option('gdk_target_blank')) { + echo 'target="_blank"'; + } + +} \ No newline at end of file