Skip to content

Commit

Permalink
Merge pull request #202 from mashirozx/dev
Browse files Browse the repository at this point in the history
update to v3.3.7
  • Loading branch information
mashirozx authored Mar 22, 2020
2 parents ccb0b6f + 5c41548 commit 31e08ee
Show file tree
Hide file tree
Showing 17 changed files with 259 additions and 199 deletions.
2 changes: 1 addition & 1 deletion cdn/js/lib.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cdn/js/src/11.third-part-functions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class="tieba-bar">Tieba</th>
'comment_notes_after' => '',
'comment_notes_before' => '',
'fields' => apply_filters( 'comment_form_default_fields', array(
'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>',
'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>',
'author' =>
'<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>',
'email' =>
Expand Down
11 changes: 7 additions & 4 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ function sakura_scripts()
$movies = akina_option('focus_amv') ? array('url' => akina_option('amv_url'), 'name' => akina_option('amv_title'), 'live' => $mv_live) : 'close';
$auto_height = akina_option('focus_height') ? 'fixed' : 'auto';
$code_lamp = 'close';
if (wp_is_mobile()) {
$auto_height = 'fixed';
}
// if (wp_is_mobile()) {
// $auto_height = 'fixed';
// }
//拦截移动端
version_compare($GLOBALS['wp_version'], '5.1', '>=') ? $reply_link_version = 'new' : $reply_link_version = 'old';
wp_localize_script('app', 'Poi', array(
Expand All @@ -215,6 +215,7 @@ function sakura_scripts()
'reply_link_version' => $reply_link_version,
'api' => esc_url_raw(rest_url()),
'nonce' => wp_create_nonce('wp_rest'),
'google_analytics_id' => akina_option('google_analytics_id', '')
));
}
add_action('wp_enqueue_scripts', 'sakura_scripts');
Expand Down Expand Up @@ -609,7 +610,9 @@ function get_link_items()
function gravatar_cn($url)
{
$gravatar_url = array('0.gravatar.com', '1.gravatar.com', '2.gravatar.com', 'secure.gravatar.com');
return str_replace($gravatar_url, 'cn.gravatar.com', $url);
//return str_replace($gravatar_url, 'cn.gravatar.com', $url);
//官方服务器近期大陆访问 429,建议使用镜像
return str_replace( $gravatar_url, 'gravatar.2heng.xin', $url );
}
add_filter('get_avatar_url', 'gravatar_cn', 4);

Expand Down
15 changes: 9 additions & 6 deletions inc/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,21 +268,24 @@ function SMMS_API($image)
*/
function cache_search_json()
{
global $more;
$vowels = array("[", "{", "]", "}", "<", ">", "\r\n", "\r", "\n", "-", "'", '"', '`', " ", ":", ";", '\\', " ", "toc");
$regex = <<<EOS
/<\/?[a-zA-Z]+("[^"]*"|'[^']*'|[^'">])*>|begin[\S\s]*\/begin|hermit[\S\s]*\/hermit|img[\S\s]*\/img|{{.*?}}|:.*?:/m
EOS;
$more = 1;

$posts = new WP_Query('posts_per_page=-1&post_status=publish&post_type=post');
while ($posts->have_posts()): $posts->the_post();
$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()))) . '},';
$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())))) . '},';
endwhile;
wp_reset_postdata();

$pages = get_pages();
foreach ($pages as $page) {
$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))) . '},';
}
$pages = new WP_Query('posts_per_page=-1&post_status=publish&post_type=page');
while ($pages->have_posts()): $pages->the_post();
$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())))) . '},';
endwhile;
wp_reset_postdata();

$tags = get_tags();
foreach ($tags as $tag) {
Expand Down Expand Up @@ -402,7 +405,7 @@ function get_qq_avatar(){
$encrypted=$_GET["qq"];
if(isset($encrypted)){
$iv = str_repeat($sakura_privkey, 2);
$encrypted = urldecode(base64_decode($encrypted));
$encrypted = base64_decode(urldecode($encrypted));
$qq_number = openssl_decrypt($encrypted, 'aes-128-cbc', $sakura_privkey, 0, $iv);
preg_match('/^\d{3,}$/', $qq_number, $matches);
$imgurl='https://q2.qlogo.cn/headimg_dl?dst_uin='.$matches[0].'&spec=100';
Expand Down
3 changes: 3 additions & 0 deletions inc/decorate.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ function customizer_css() { ?>
}
<?php } ?>

.post-list-thumb{opacity: 0}
.post-list-show {opacity: 1}

<?php } // theme-skin ?>
<?php // Custom style
if ( akina_option('site_custom_style') ) {
Expand Down
1 change: 1 addition & 0 deletions inc/swicher.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ function font_end_js_control() { ?>

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

mashiro_option.windowheight = /Mobile|Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? 'fixed' : 'auto';
/*End of Initial Variables*/
</script>
<?php }
Expand Down
3 changes: 0 additions & 3 deletions inc/theme_plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,6 @@ function siren_get_browsers($ua){
}elseif (preg_match('#Edge/([a-zA-Z0-9.]+)#i', $ua, $matches)){
$title = 'Edge '. $matches[1];
$icon = 'edge';
}elseif (preg_match('#Edg/([a-zA-Z0-9.]+)#i', $ua, $matches)){
$title = 'Edge Dev (Chromium) '. $matches[1];
$icon = 'edge';
}elseif (preg_match('#360([a-zA-Z0-9.]+)#i', $ua, $matches)) {
$title = '360 Browser '. $matches[1];
$icon = '360se';
Expand Down
Loading

0 comments on commit 31e08ee

Please sign in to comment.