Skip to content

Commit 31e08ee

Browse files
authored
Merge pull request #202 from mashirozx/dev
update to v3.3.7
2 parents ccb0b6f + 5c41548 commit 31e08ee

17 files changed

+259
-199
lines changed

cdn/js/lib.js

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

cdn/js/src/11.third-part-functions.js

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

comments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class="tieba-bar">Tieba</th>
8888
'comment_notes_after' => '',
8989
'comment_notes_before' => '',
9090
'fields' => apply_filters( 'comment_form_default_fields', array(
91-
'avatar' => '<div class="cmt-info-container"><div class="comment-user-avatar"><img src="https://gravatar.shino.cc/avatar/f11f237b3de93c93b24045e71f7f65c6?s=80&d=mm&r=g"><div class="socila-check qq-check"><i class="fa fa-qq" aria-hidden="true"></i></div><div class="socila-check gravatar-check"><i class="fa fa-google" aria-hidden="true"></i></div></div>',
91+
'avatar' => '<div class="cmt-info-container"><div class="comment-user-avatar"><img src="https://gravatar.2heng.xin/avatar/f11f237b3de93c93b24045e71f7f65c6?s=80&d=mm&r=g"><div class="socila-check qq-check"><i class="fa fa-qq" aria-hidden="true"></i></div><div class="socila-check gravatar-check"><i class="fa fa-google" aria-hidden="true"></i></div></div>',
9292
'author' =>
9393
'<div class="popup cmt-popup cmt-author" onclick="cmt_showPopup(this)"><span class="popuptext" id="thePopup" style="margin-left: -115px;width: 230px;">' . __("Auto pull nickname and avatar with a QQ num. entered", "sakura")/*输入QQ号将自动拉取昵称和头像*/ . '</span><input type="text" placeholder="' . __("Nickname or QQ number", "sakura") /*昵称或QQ号*/. ' ' . ( $req ? '(' . __("Name* ", "sakura") . ')' : '') . '" name="author" id="author" value="' . esc_attr($comment_author) . '" size="22" autocomplete="off" tabindex="1" ' . ($req ? "aria-required='true'" : '' ). ' /></div>',
9494
'email' =>

functions.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,9 @@ function sakura_scripts()
199199
$movies = akina_option('focus_amv') ? array('url' => akina_option('amv_url'), 'name' => akina_option('amv_title'), 'live' => $mv_live) : 'close';
200200
$auto_height = akina_option('focus_height') ? 'fixed' : 'auto';
201201
$code_lamp = 'close';
202-
if (wp_is_mobile()) {
203-
$auto_height = 'fixed';
204-
}
202+
// if (wp_is_mobile()) {
203+
// $auto_height = 'fixed';
204+
// }
205205
//拦截移动端
206206
version_compare($GLOBALS['wp_version'], '5.1', '>=') ? $reply_link_version = 'new' : $reply_link_version = 'old';
207207
wp_localize_script('app', 'Poi', array(
@@ -215,6 +215,7 @@ function sakura_scripts()
215215
'reply_link_version' => $reply_link_version,
216216
'api' => esc_url_raw(rest_url()),
217217
'nonce' => wp_create_nonce('wp_rest'),
218+
'google_analytics_id' => akina_option('google_analytics_id', '')
218219
));
219220
}
220221
add_action('wp_enqueue_scripts', 'sakura_scripts');
@@ -609,7 +610,9 @@ function get_link_items()
609610
function gravatar_cn($url)
610611
{
611612
$gravatar_url = array('0.gravatar.com', '1.gravatar.com', '2.gravatar.com', 'secure.gravatar.com');
612-
return str_replace($gravatar_url, 'cn.gravatar.com', $url);
613+
//return str_replace($gravatar_url, 'cn.gravatar.com', $url);
614+
//官方服务器近期大陆访问 429,建议使用镜像
615+
return str_replace( $gravatar_url, 'gravatar.2heng.xin', $url );
613616
}
614617
add_filter('get_avatar_url', 'gravatar_cn', 4);
615618

inc/api.php

+9-6
Original file line numberDiff line numberDiff line change
@@ -268,21 +268,24 @@ function SMMS_API($image)
268268
*/
269269
function cache_search_json()
270270
{
271+
global $more;
271272
$vowels = array("[", "{", "]", "}", "<", ">", "\r\n", "\r", "\n", "-", "'", '"', '`', " ", ":", ";", '\\', " ", "toc");
272273
$regex = <<<EOS
273274
/<\/?[a-zA-Z]+("[^"]*"|'[^']*'|[^'">])*>|begin[\S\s]*\/begin|hermit[\S\s]*\/hermit|img[\S\s]*\/img|{{.*?}}|:.*?:/m
274275
EOS;
276+
$more = 1;
275277

276278
$posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post');
277279
while ($posts->have_posts()): $posts->the_post();
278-
$output .= '{"type":"post","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', get_the_content()))) . '},';
280+
$output .= '{"type":"post","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', apply_filters( 'the_content', get_the_content())))) . '},';
279281
endwhile;
280282
wp_reset_postdata();
281283

282-
$pages = get_pages();
283-
foreach ($pages as $page) {
284-
$output .= '{"type":"page","link":"' . get_page_link($page) . '","title":' . json_encode($page->post_title) . ',"comments":"' . $page->comment_count . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', $page->post_content))) . '},';
285-
}
284+
$pages = new WP_Query('posts_per_page=-1&post_status=publish&post_type=page');
285+
while ($pages->have_posts()): $pages->the_post();
286+
$output .= '{"type":"page","link":"' . get_permalink() . '","title":' . json_encode(get_the_title()) . ',"comments":"' . get_comments_number('0', '1', '%') . '","text":' . json_encode(str_replace($vowels, " ", preg_replace($regex, ' ', apply_filters( 'the_content', get_the_content())))) . '},';
287+
endwhile;
288+
wp_reset_postdata();
286289

287290
$tags = get_tags();
288291
foreach ($tags as $tag) {
@@ -402,7 +405,7 @@ function get_qq_avatar(){
402405
$encrypted=$_GET["qq"];
403406
if(isset($encrypted)){
404407
$iv = str_repeat($sakura_privkey, 2);
405-
$encrypted = urldecode(base64_decode($encrypted));
408+
$encrypted = base64_decode(urldecode($encrypted));
406409
$qq_number = openssl_decrypt($encrypted, 'aes-128-cbc', $sakura_privkey, 0, $iv);
407410
preg_match('/^\d{3,}$/', $qq_number, $matches);
408411
$imgurl='https://q2.qlogo.cn/headimg_dl?dst_uin='.$matches[0].'&spec=100';

inc/decorate.php

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ function customizer_css() { ?>
6161
}
6262
<?php } ?>
6363

64+
.post-list-thumb{opacity: 0}
65+
.post-list-show {opacity: 1}
66+
6467
<?php } // theme-skin ?>
6568
<?php // Custom style
6669
if ( akina_option('site_custom_style') ) {

inc/swicher.php

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ function font_end_js_control() { ?>
7373

7474
mashiro_option.cover_api = "<?php echo rest_url('sakura/v1/image/cover'); ?>";
7575

76+
mashiro_option.windowheight = /Mobile|Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? 'fixed' : 'auto';
7677
/*End of Initial Variables*/
7778
</script>
7879
<?php }

inc/theme_plus.php

-3
Original file line numberDiff line numberDiff line change
@@ -791,9 +791,6 @@ function siren_get_browsers($ua){
791791
}elseif (preg_match('#Edge/([a-zA-Z0-9.]+)#i', $ua, $matches)){
792792
$title = 'Edge '. $matches[1];
793793
$icon = 'edge';
794-
}elseif (preg_match('#Edg/([a-zA-Z0-9.]+)#i', $ua, $matches)){
795-
$title = 'Edge Dev (Chromium) '. $matches[1];
796-
$icon = 'edge';
797794
}elseif (preg_match('#360([a-zA-Z0-9.]+)#i', $ua, $matches)) {
798795
$title = '360 Browser '. $matches[1];
799796
$icon = '360se';

0 commit comments

Comments
 (0)