Skip to content

Commit

Permalink
Merge pull request #216 from mashirozx/dev
Browse files Browse the repository at this point in the history
update to v3.3.8
  • Loading branch information
mashirozx authored Apr 12, 2020
2 parents 31e08ee + 85f010d commit 7a1ec65
Show file tree
Hide file tree
Showing 28 changed files with 3,049 additions and 706 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
100644 → 100755

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

1 change: 1 addition & 0 deletions cdn/theme/sakura.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ h1.entry-title {
}

.entry-content tr:nth-child(even){background-color: #f2f2f2}
body.dark .entry-content tr:nth-child(even){background-color: unset}

.entry-content th {
color: white;
Expand Down
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.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>',
'avatar' => '<div class="cmt-info-container"><div class="comment-user-avatar"><img src="' . get_template_directory_uri() . '/images/avatar.jpeg"><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
9 changes: 5 additions & 4 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
<?php wp_nav_menu( array( 'depth' => 2, 'theme_location' => 'primary', 'container' => false ) ); ?>
</div><!-- m-nav-center end -->
<a class="cd-top faa-float animated "></a>
<button onclick="topFunction()" id="moblieGoTop" title="Go to top"><i class="fa fa-chevron-up" aria-hidden="true"></i></button>
<button id="moblieGoTop" title="Go to top"><i class="fa fa-chevron-up" aria-hidden="true"></i></button>
<button id="moblieDarkLight"><i class="fa fa-moon-o" aria-hidden="true"></i></button>
<!-- search start -->
<form class="js-search search-form search-form--modal" method="get" action="<?php echo home_url(); ?>" role="search">
<div class="search-form__inner">
Expand Down Expand Up @@ -148,11 +149,11 @@
<div class="show-hide-wrap"><button class="show-hide"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22 16l-10.105-10.6-1.895 1.987 8.211 8.613-8.211 8.612 1.895 1.988 8.211-8.613z"></path></svg></button></div>
</aside>
<?php endif; ?>
<?php if (akina_option('playlist_id', '')): ?>
<?php if (akina_option('aplayer_server') != 'off'): ?>
<div id="aplayer-float" style="z-index: 100;"
class="aplayer"
data-id="<?php echo akina_option('playlist_id', ''); ?>"
data-server="netease"
data-id="<?php echo akina_option('aplayer_playlistid', ''); ?>"
data-server="<?php echo akina_option('aplayer_server'); ?>"
data-type="playlist"
data-fixed="true"
data-theme="orange">
Expand Down
25 changes: 16 additions & 9 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function sakura_scripts()
// }
//拦截移动端
version_compare($GLOBALS['wp_version'], '5.1', '>=') ? $reply_link_version = 'new' : $reply_link_version = 'old';
$gravatar_url = akina_option('gravatar_proxy') ?: 'secure.gravatar.com/avatar';
wp_localize_script('app', 'Poi', array(
'pjax' => akina_option('poi_pjax'),
'movies' => $movies,
Expand All @@ -215,7 +216,8 @@ 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', '')
'google_analytics_id' => akina_option('google_analytics_id', ''),
'gravatar_url' => $gravatar_url
));
}
add_action('wp_enqueue_scripts', 'sakura_scripts');
Expand Down Expand Up @@ -608,13 +610,15 @@ function get_link_items()
* Gravatar头像使用中国服务器
*/
function gravatar_cn($url)
{
$gravatar_url = array('0.gravatar.com', '1.gravatar.com', '2.gravatar.com', 'secure.gravatar.com');
{
$gravatar_url = array('0.gravatar.com/avatar','1.gravatar.com/avatar','2.gravatar.com/avatar','secure.gravatar.com/avatar');
//return str_replace($gravatar_url, 'cn.gravatar.com', $url);
//官方服务器近期大陆访问 429,建议使用镜像
return str_replace( $gravatar_url, 'gravatar.2heng.xin', $url );
return str_replace( $gravatar_url, akina_option('gravatar_proxy'), $url );
}
if(akina_option('gravatar_proxy')){
add_filter('get_avatar_url', 'gravatar_cn', 4);
}
add_filter('get_avatar_url', 'gravatar_cn', 4);

/*
* 自定义默认头像
Expand Down Expand Up @@ -662,6 +666,7 @@ function akina_body_classes($classes)
/*if(!wp_is_mobile()) {
$classes[] = 'serif';
}*/
$classes[] = $_COOKIE['dark'.akina_option('cookie_version', '')] == '1' ? 'dark' : ' ';
return $classes;
}
add_filter('body_class', 'akina_body_classes');
Expand Down Expand Up @@ -1758,11 +1763,13 @@ function DEFAULT_FEATURE_IMAGE()
}

//防止设置置顶文章造成的图片同侧bug
add_action('pre_get_posts', function ($q) {
if ($q->is_home() && $q->is_main_query() && $q->get('paged') > 1) {
$q->set('post__not_in', get_option('sticky_posts'));
add_action( 'pre_get_posts', function( $q ){
if ( $q->is_home() && $q->is_main_query() ){
$q->set( 'posts_per_page', 10 - sizeof(get_option( 'sticky_posts' )) );
if ( $q->get( 'paged' ) > 1 )
$q->set( 'post__not_in', get_option( 'sticky_posts' ) );
}

});

//评论回复
Expand Down
1 change: 1 addition & 0 deletions header.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<link rel="shortcut icon" href="<?php echo akina_option('favicon_link', ''); ?>"/>
<meta name="theme-color" content="#31363b">
<meta http-equiv="x-dns-prefetch-control" content="on">
<?php wp_head(); ?>
<script type="text/javascript">
Expand Down
Binary file added images/avatar.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified inc/QQWry.Dat
Binary file not shown.
Loading

0 comments on commit 7a1ec65

Please sign in to comment.