mirror of
https://github.com/yunluo/gdk.git
synced 2024-05-05 07:53:34 +02:00
代码优化
This commit is contained in:
parent
71b7783aa0
commit
3d36179f4b
|
@ -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*/
|
||||
|
|
|
@ -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("检测失败,网络错误");
|
||||
}
|
||||
|
|
|
@ -33,9 +33,9 @@ function gdk_ajax_get_update()
|
|||
$version = $plugin_info['version'];
|
||||
|
||||
if (version_compare($version, GDK_PLUGIN_VER, '>')) {
|
||||
exit('<span class="get_update_res">插件有更新,新版本:<span class="key_word">' . $version . '</span> <a class="feedback add-new-h2" href="' . $plugin_info['details_url'] . '" target="_blank">查看更新内容</a></span>');
|
||||
exit('<span class="get_update_res has_new_version">插件有更新,已安装版本:<span class="key_word">' . GDK_PLUGIN_VER . '</span> 新版本:<span class="key_word">' . $version . '</span> <a class="feedback add-new-h2" href="' . $plugin_info['details_url'] . '" target="_blank">查看更新内容</a></span>');
|
||||
} else {
|
||||
exit('<span class="get_update_res">你的插件目前已经是最新版了!</span>');
|
||||
exit('<span class="get_update_res no_new_version">你的插件目前已经是最新版了!</span>');
|
||||
}
|
||||
}
|
||||
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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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 = '<fieldset id="hide_notice" class="fieldset pull-center"><legend class="legend">付费内容</legend>';
|
||||
$notice = '<fieldset id="hide_notice" class="fieldset ta-center"><legend class="legend ta-left">付费内容</legend>';
|
||||
$notice .= '<p>当前隐藏内容需要支付</p><span class="cm-coin">' . $money . '元</span>';
|
||||
$notice .= '<p>已有<span class="red">' . $pay_count . '</span>人支付</p>';
|
||||
$notice .= '<p><button id="pay_view" type="button" data-action="pay_view" data-money="' . $money . '" data-id="' . $pid . '">立即查看</button></p>';
|
||||
|
|
|
@ -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__)); //插件目录路径
|
Loading…
Reference in a new issue