From 3d36179f4b4ef472491bbe5e9bfafd93842c0780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=91=E8=90=BD?= Date: Sun, 22 Mar 2020 22:10:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/gdk.css | 2 +- framework/plugin-options.php | 5 +++-- functions/Ajax.php | 6 +++--- functions/shortcode.php | 2 +- gdk_route.php => gdk.php | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) rename gdk_route.php => gdk.php (96%) diff --git a/assets/css/gdk.css b/assets/css/gdk.css index ad53e57..557c5ac 100644 --- a/assets/css/gdk.css +++ b/assets/css/gdk.css @@ -20,7 +20,7 @@ body.compensate-for-scrollbar{overflow:hidden}.fancybox-active{height:auto}.fanc .alert-error,.error{background-color:#f17783;border-color:#e66465;color:#fff;} .red{color:#f6003c}.purple{color:#6b48ff}.black{color:#060608}.pink{color:#FF5F5F} -.pull-center{text-align:center;} +.ta-center{text-align:center;}.ta-left{text-align:left;}.ta-right{text-align:right;} /**millgram mod end*/ /*文字tooltips*/ diff --git a/framework/plugin-options.php b/framework/plugin-options.php index 83b5b5f..407c834 100644 --- a/framework/plugin-options.php +++ b/framework/plugin-options.php @@ -397,8 +397,9 @@ jQuery(function ($) { if (a !== '400') { if ($(".get_update_res").length > 0) return; $(".get_new_version").after(a); - $(".install_new_version").show(); - + if ($(".has_new_version").length > 0) { + $(".install_new_version").show(); + } }else{ $(".get_new_version").after("检测失败,网络错误"); } diff --git a/functions/Ajax.php b/functions/Ajax.php index bd2aeab..6695841 100644 --- a/functions/Ajax.php +++ b/functions/Ajax.php @@ -33,9 +33,9 @@ function gdk_ajax_get_update() $version = $plugin_info['version']; if (version_compare($version, GDK_PLUGIN_VER, '>')) { - exit('插件有更新,新版本:' . $version . ' '); + exit('插件有更新,已安装版本:' . GDK_PLUGIN_VER . ' 新版本:' . $version . ' '); } else { - exit('你的插件目前已经是最新版了!'); + exit('你的插件目前已经是最新版了!'); } } add_action('wp_ajax_nopriv_get_new_version', 'gdk_ajax_get_update'); @@ -45,7 +45,7 @@ add_action('wp_ajax_get_new_version', 'gdk_ajax_get_update'); function gdk_ajax_install_update() { $url = 'http://a.gitcafe.net/gdk.zip?v=' . date("His"); - unzip_url($url, ABSPATH . 'wp-content/plugins'); + unzip_url($url, WP_PLUGIN_DIR); exit(1); } diff --git a/functions/shortcode.php b/functions/shortcode.php index c42e156..8b79b4d 100644 --- a/functions/shortcode.php +++ b/functions/shortcode.php @@ -419,7 +419,7 @@ function gdk_pay_nologin($atts, $content = '') $pay_log = get_post_meta($pid, 'pay_log', true); //购买记录数据 $pay_arr = explode(",", $pay_log); $pay_count = count($pay_arr); //已购买人数 - $notice = '
付费内容'; + $notice = '
付费内容'; $notice .= '

当前隐藏内容需要支付

' . $money . '元'; $notice .= '

已有' . $pay_count . '人支付

'; $notice .= '

'; diff --git a/gdk_route.php b/gdk.php similarity index 96% rename from gdk_route.php rename to gdk.php index a75d172..fb458b8 100644 --- a/gdk_route.php +++ b/gdk.php @@ -3,7 +3,7 @@ Plugin Name: GitCafe Development Kit 极客公园开发套件 Plugin URI: https://gitcafe.net/ Description: 为WordPress主题开发提供底层支持 -Version: 0.0.3 +Version: 0.0.1 Author: 云落 Author URI: https://gitcafe.net/ Compatible:5.3.2 @@ -28,7 +28,7 @@ if (!version_compare(PHP_VERSION, '7.2', '>=')) { } //定义各种常量 -define('GDK_PLUGIN_VER', '0.0.3'); +define('GDK_PLUGIN_VER', '0.0.1'); define('GDK_PLUGIN_FILE', __FILE__); //插件入口文件 define('GDK_BASE_URL', plugin_dir_url(__FILE__)); //插件目录url define('GDK_ROOT_PATH', plugin_dir_path(__FILE__)); //插件目录路径