Skip to content

Commit

Permalink
0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
solstice23 committed Sep 4, 2019
1 parent 6000fb8 commit 85fac18
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 13 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ Argon - 一个轻盈、简洁、美观的 WordPress 主题
![截图4](https://abc233.site/argon-theme-docs/img/screenshot4.png)

# 更新日志

## 20190904 v0.3
+ Pjax 加载时替换 WordPress Adminbar
+ 修复后台评论提示验证码错误问题
+ 手机减小文章页面 margin
+ Pjax 加载逻辑修改
+ 博主评论免验证码

## 20190829 v0.2
+ 修复一些 BUG
+ checkbox 增加可选的 `inline` 属性
Expand Down
4 changes: 2 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@
</div>
</div>
</div>
<?php $commentCaptchaSeed = get_comment_captcha_seed();?>
<div class="col-md-3">
<div class="form-group">
<div class="input-group input-group-alternative mb-4 post-comment-captcha-container">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-key"></i></span>
</div>
<input id="post_comment_captcha" class="form-control" placeholder="验证码" type="text">
<input id="post_comment_captcha" class="form-control" placeholder="验证码" type="text" <?php if (current_user_can('level_7')) {echo('value="' . get_comment_captcha_answer($commentCaptchaSeed) . '" disabled');}?>>
<style>
<?php $commentCaptchaSeed = get_comment_captcha_seed();?>
.post-comment-captcha-container:before{
content: "<?php echo get_comment_captcha($commentCaptchaSeed);?>";
}
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?php
echo get_option('argon_footer_html');
?>
<div>Theme Argon By abc2237512422</div>
<div>Theme <a href="https://abc233.site/argon"><strong>Argon</strong></a> By abc2237512422</div>
</footer>
</main>
</div>
Expand Down
36 changes: 35 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function argon_comment_format($comment, $args, $depth){
<div class="comment-item-inner" id="comment-inner-<?php comment_ID();?>">
<div class="comment-item-title">
<?php echo get_comment_author_link();?>
<?php if( user_can($comment->user_id , "update_core") ){
<?php if( user_can($comment -> user_id , "update_core") ){
echo '<span class="badge badge-primary badge-admin">博主</span>';}
?>
</div>
Expand Down Expand Up @@ -244,11 +244,45 @@ function get_comment_captcha($captchaSeed){
break;
}
}
function get_comment_captcha_answer($captchaSeed){
mt_srand($captchaSeed + 10007);
$oper = mt_rand(1 , 4);
$num1 = 0;
$num2 = 0;
switch ($oper){
case 1:
$num1 = mt_rand(1 , 20);
$num2 = mt_rand(0 , 20 - $num1);
return $num1 + $num2;
break;
case 2:
$num1 = mt_rand(10 , 20);
$num2 = mt_rand(1 , $num1);
return $num1 - $num2;
break;
case 3:
$num1 = mt_rand(3 , 9);
$num2 = mt_rand(3 , 9);
return $num1 * $num2;
break;
case 4:
$num2 = mt_rand(2 , 9);
$num1 = $num2 * mt_rand(2 , 9);
return $num1 / $num2;
break;
default:
break;
}
return "";
}
function wrong_captcha(){
wp_die('验证码错误,评论失败');
}
function check_comment_captcha($comment){
$answer = $_POST['comment_captcha'];
if(current_user_can('level_7')){
return $comment;
}
mt_srand($_POST['comment_captcha_seed'] + 10007);
$oper = mt_rand(1 , 4);
$num1 = 0;
Expand Down
5 changes: 0 additions & 5 deletions info.json

This file was deleted.

4 changes: 4 additions & 0 deletions js/argontheme.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,13 @@ function pjaxLoadUrl(url , pushstate){
$("#leftbar_part2_inner").html($("#leftbar_part2_inner" , $vdom)[0].innerHTML);
$("#primary").html($("#primary" , $vdom)[0].innerHTML);
$("#leftbar_part1_menu").html($("#leftbar_part1_menu" , $vdom)[0].innerHTML);
$("#wpadminbar").html($("#wpadminbar" , $vdom).html());

$("#content .page-infomation-card").remove();
if ($(".page-infomation-card" , $vdom).length > 0){
$("#content").prepend($(".page-infomation-card" , $vdom)[0].outerHTML);
}


NProgress.inc();

Expand Down Expand Up @@ -504,6 +506,7 @@ function pjaxLoadUrl(url , pushstate){
window.pjaxLoaded();
}
}catch (err){
NProgress.done();
if (pjaxUrlChanged){
pjaxLoading = false;
window.location.reload();
Expand All @@ -528,6 +531,7 @@ function pjaxLoadUrl(url , pushstate){
window.location.href = url;
}
}
NProgress.done();
}
$(document).ready(function(){
$(document).on("click" , "a[href]:not([no-pjax]):not(.no-pjax):not([href^='#']):not([target='_blink'])" , function(){
Expand Down
3 changes: 2 additions & 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.2
Version: 0.3
License: MIT License
License URI: https://opensource.org/licenses/MIT
Tags: 两栏, 侧栏在左边, 浮动侧栏, 文章目录, 自适应, 夜间模式, 可自定义
Expand Down Expand Up @@ -1416,6 +1416,7 @@ article img.lazyload[src^='data:image/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPg'

/*Wordpress Adminbar*/
#wpadminbar{
position: fixed !important;
width: max-content !important;
height: max-content !important;
width: -moz-max-content !important;
Expand Down
9 changes: 9 additions & 0 deletions style_mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,17 @@
#primary{
width: 100%;
}
#main{
padding: 5px;
}
}

@media screen and (max-width:900px){
/*TimeLine*/
.argon-timeline {
margin-left: 75px;
}
}

@media screen and (max-width:690px){
/*文章分享的浮动二维码*/
Expand Down
6 changes: 3 additions & 3 deletions theme_update_info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version" : "0.2",
"details_url" : "https://github.com/abc2237512422/argon-theme/",
"download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.2/argon.zip"
"version" : "0.3",
"details_url" : "https://github.com/abc2237512422/argon-theme/releases",
"download_url" : "https://github.com/abc2237512422/argon-theme/releases/download/v0.3/argon.zip"
}

0 comments on commit 85fac18

Please sign in to comment.