Skip to content

Commit

Permalink
0.52
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Oct 12, 2019
1 parent 22791df commit bdaeead
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ Argon - 一个轻盈、简洁、美观的 WordPress 主题

# 更新日志

## 20191010 v0.5
## 20191010 v0.52
+ 增加安装统计
+ 增加时区修复

## 20191010 v0.51
+ "说说"增加点赞功能
+ 微调弹出提示的样式

Expand Down
36 changes: 36 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,31 @@ function theme_slug_setup() {
'argon',
'https://raw.githubusercontent.com/abc2237512422/argon-theme/master/info.json'
);
//初次使用时发送安装量统计信息
function post_analytics_info(){
if(function_exists('file_get_contents')){
$contexts = stream_context_create(
array(
'http' => array(
'method'=>"GET",
'header'=>"User-Agent: ArgonTheme\r\n"
)
)
);
$result = file_get_contents('http://api.abc233.site/argon_analytics/index.php?domain=' . $_SERVER['HTTP_HOST'], false, $contexts);
update_option('argon_has_inited', 'true');
return $result;
}else{
update_option('argon_has_inited', 'true');
}
}
if (get_option('argon_has_inited') != 'true'){
post_analytics_info();
}
//时区修正
if (get_option('argon_enable_timezone_fix') == 'true'){
date_default_timezone_set('UTC');
}
//注册小工具
function argon_widgets_init() {
register_sidebar(
Expand Down Expand Up @@ -1123,6 +1148,15 @@ function themeoptions_page(){
<option value="disabled" <?php if ($enable_smoothscroll_type=='disabled'){echo 'selected';} ?>>不使用平滑滚动</option>
</select>
</p>
<h4>是否修正时区错误</h4>
<p>
如遇到时区错误(例如一条刚发的评论显示 8 小时前),这个选项<strong>可能</strong>可以修复这个问题</br>
<select name="argon_enable_timezone_fix">
<?php $argon_enable_timezone_fix = get_option('argon_enable_timezone_fix'); ?>
<option value="false" <?php if ($argon_enable_timezone_fix=='false'){echo 'selected';} ?>>关闭</option>
<option value="true" <?php if ($argon_enable_timezone_fix=='true'){echo 'selected';} ?>>开启</option>
</select>
</p>
<input type="submit" name="admin_options" value="保存" class="button"/></p>
</form>
</div>
Expand All @@ -1148,6 +1182,8 @@ function themeoptions_page(){
update_option('argon_show_readingtime', $_POST['argon_show_readingtime']);
update_option('argon_reading_speed', $_POST['argon_reading_speed']);
update_option('argon_show_sharebtn', $_POST['argon_show_sharebtn']);
update_option('argon_enable_timezone_fix', $_POST['argon_enable_timezone_fix']);


//LazyLoad 相关
update_option('argon_enable_lazyload', $_POST['argon_enable_lazyload']);
Expand Down
4 changes: 2 additions & 2 deletions info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version" : "0.51",
"version" : "0.52",
"details_url" : "https://github.com/abc2237512422/argon-theme/releases",
"download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.51/argon.zip"
"download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.52/argon.zip"
}
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Theme Name: argon
Author: abc2237512422
Author URI: https://abc233.site/
Description: 轻盈、简洁、美观的 Wordpress 主题 (Beta)
Version: 0.51
Version: 0.52
License: MIT License
License URI: https://opensource.org/licenses/MIT
Tags: 两栏, 侧栏在左边, 浮动侧栏, 文章目录, 自适应, 夜间模式, 可自定义
Expand Down

0 comments on commit bdaeead

Please sign in to comment.