Skip to content

Commit a831ae7

Browse files
Merge pull request #239 from mashirozx/issue-237
Issue 237
2 parents f829ab4 + 34fdb5d commit a831ae7

16 files changed

+1670
-1711
lines changed

cdn/js/lib.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdn/js/src/01.jquery.min.js

100644100755
+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

functions.php

+5-15
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ function akina_comment_format($comment, $args, $depth)
424424
</div>
425425
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));?>
426426
<div class="right">
427-
<div class="info"><time datetime="<?php comment_date('Y-m-d');?>"><?php echo poi_time_since(strtotime($comment->comment_date_gmt), true); //comment_date(get_option('date_format')); ?></time><?php echo siren_get_useragent($comment->comment_agent); ?><?php echo mobile_get_useragent_icon($comment->comment_agent); ?>&nbsp;<?php _e('Location', 'sakura'); /*来自*/?>: <?php echo convertip(get_comment_author_ip()); ?>
427+
<div class="info"><time datetime="<?php comment_date('Y-m-d');?>"><?php echo poi_time_since(strtotime($comment->comment_date_gmt), true); //comment_date(get_option('date_format')); ?></time><?php echo siren_get_useragent($comment->comment_agent); ?><?php echo mobile_get_useragent_icon($comment->comment_agent); ?>&nbsp;<?php if(akina_option('open_location')){ _e('Location', 'sakura'); /*来自*/?>: <?php echo convertip(get_comment_author_ip());} ?>
428428
<?php if (current_user_can('manage_options') and (wp_is_mobile() == false)) {
429429
$comment_ID = $comment->comment_ID;
430430
$i_private = get_comment_meta($comment_ID, '_private', true);
@@ -969,11 +969,11 @@ function comment_mail_notify($comment_id)
969969
<h3>您有一条来自<a style="text-decoration: none;color: orange " target="_blank" href="' . home_url() . '/">' . get_option("blogname") . '</a>的回复</h3>
970970
<br>
971971
<p style="font-size: 14px;">您在文章《' . get_the_title($comment->comment_post_ID) . '》上发表的评论:</p>
972-
<p style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;padding-bottom:20px;background-color:#eee;margin:15px 0px;padding-left:20px;padding-right:20px;border-top:#ddd 1px solid;border-right:#ddd 1px solid;padding-top:20px">'
973-
. trim(get_comment($parent_id)->comment_content) . '</p>
972+
<div style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;padding-bottom:20px;background-color:#eee;margin:15px 0px;padding-left:20px;padding-right:20px;border-top:#ddd 1px solid;border-right:#ddd 1px solid;padding-top:20px">'
973+
. trim(get_comment($parent_id)->comment_content) . '</div>
974974
<p style="font-size: 14px;">' . trim($comment->comment_author) . ' 给您的回复如下:</p>
975-
<p style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;padding-bottom:20px;background-color:#eee;margin:15px 0px;padding-left:20px;padding-right:20px;border-top:#ddd 1px solid;border-right:#ddd 1px solid;padding-top:20px">'
976-
. trim($comment->comment_content) . '</p>
975+
<div style="border-bottom:#ddd 1px solid;border-left:#ddd 1px solid;padding-bottom:20px;background-color:#eee;margin:15px 0px;padding-left:20px;padding-right:20px;border-top:#ddd 1px solid;border-right:#ddd 1px solid;padding-top:20px">'
976+
. trim($comment->comment_content) . '</div>
977977
978978
<div style="text-align: center;">
979979
<img src="https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.4/img/other/hr.png" alt="hr" style="width:100%;
@@ -1762,16 +1762,6 @@ function DEFAULT_FEATURE_IMAGE()
17621762
return rest_url('sakura/v1/image/feature') . '?' . rand(1, 1000);
17631763
}
17641764

1765-
//防止设置置顶文章造成的图片同侧bug
1766-
add_action( 'pre_get_posts', function( $q ){
1767-
if ( $q->is_home() && $q->is_main_query() ){
1768-
$q->set( 'posts_per_page', 10 - sizeof(get_option( 'sticky_posts' )) );
1769-
if ( $q->get( 'paged' ) > 1 )
1770-
$q->set( 'post__not_in', get_option( 'sticky_posts' ) );
1771-
}
1772-
1773-
});
1774-
17751765
//评论回复
17761766
function sakura_comment_notify($comment_id)
17771767
{

inc/api.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ function cover_gallery() {
120120
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/feature
121121
*/
122122
function feature_gallery() {
123-
return cover_gallery();
123+
$imgurl = Images::feature_gallery();
124+
$data = array('feature image');
125+
$response = new WP_REST_Response($data);
126+
$response->set_status(302);
127+
$response->header('Location', $imgurl);
128+
return $response;
124129
}
125130

126131
/*

inc/classes/Images.php

+9
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,13 @@ public static function cover_gallery() {
162162
}
163163
return $imgurl;
164164
}
165+
166+
public static function feature_gallery() {
167+
if (akina_option('post_cover_options') == "type_2") {
168+
$imgurl = akina_option('post_cover');
169+
} else {
170+
$imgurl = self::cover_gallery();
171+
}
172+
return $imgurl;
173+
}
165174
}

inc/css/optionsframework.css

+10-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ body {
88

99
.nav-tab-wrapper {
1010
position: relative;
11-
max-width: 860px;
11+
max-width: 900px;
1212
margin: auto !important;
1313
}
1414

@@ -37,7 +37,7 @@ body {
3737
.nav-tab {
3838
background: none;
3939
border:none;
40-
padding: 10px 20px;
40+
padding: 10px 15px;
4141
font-weight: 300;
4242
font-size: 15px;
4343
color: darkgoldenrod;
@@ -74,17 +74,23 @@ a#options-group-4-tab:before {
7474

7575
a#options-group-5-tab:before {
7676
font-family: "dashicons";
77-
content: "\f110";
77+
content: "\f101";
7878
float: left;
7979
}
8080

8181
a#options-group-6-tab:before {
82+
font-family: "dashicons";
83+
content: "\f110";
84+
float: left;
85+
}
86+
87+
a#options-group-7-tab:before {
8288
font-family: "dashicons";
8389
content: "\f325";
8490
float: left;
8591
}
8692

87-
a#options-group-7-tab:before {
93+
a#options-group-8-tab:before {
8894
font-family: "dashicons";
8995
content: "\f487";
9096
float: left;

inc/decorate.php

+34-1
Large diffs are not rendered by default.

js/sakura-app.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -1051,12 +1051,14 @@ function load_bangumi() {
10511051
var xhr = new XMLHttpRequest();
10521052
xhr.open('POST', this.href + "&_wpnonce=" + Poi.nonce, true);
10531053
xhr.onreadystatechange = function() {
1054-
if (xhr.readyState == 4 && xhr.status == 200) {
1055-
var html = JSON.parse(xhr.responseText);
1056-
$("#bangumi-pagination").remove();
1057-
$(".row").append(html);
1058-
}else{
1059-
$("#bangumi-pagination a").removeClass("loading").html('<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ERROR ');
1054+
if (xhr.readyState == 4 ) {
1055+
if(xhr.status == 200){
1056+
var html = JSON.parse(xhr.responseText);
1057+
$("#bangumi-pagination").remove();
1058+
$(".row").append(html);
1059+
}else{
1060+
$("#bangumi-pagination a").removeClass("loading").html('<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ERROR ');
1061+
}
10601062
}
10611063
};
10621064
xhr.send();

languages/en_US.mo

40 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)