commit
77722ed4d7
1
404.php
1
404.php
|
@ -12,6 +12,7 @@
|
|||
<head>
|
||||
<meta charset="<?php bloginfo( 'charset' ); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" href="<?php echo akina_option('favicon_link', ''); ?>"/>
|
||||
<title itemprop="name"><?php global $page, $paged;wp_title( '-', true, 'right' );
|
||||
bloginfo( 'name' );$site_description = get_bloginfo( 'description', 'display' );
|
||||
if ( $site_description && ( is_home() || is_front_page() ) ) echo " - $site_description";if ( $paged >= 2 || $page >= 2 ) echo ' - ' . sprintf( __( 'page %s'), max( $paged, $page ) );/*第 %s 页*/?>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -424,7 +424,7 @@ if (!function_exists('akina_comment_format')) {
|
|||
</div>
|
||||
<?php comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));?>
|
||||
<div class="right">
|
||||
<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); ?> <?php _e('Location', 'sakura'); /*来自*/?>: <?php echo convertip(get_comment_author_ip()); ?>
|
||||
<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); ?> <?php if(akina_option('open_location')){ _e('Location', 'sakura'); /*来自*/?>: <?php echo convertip(get_comment_author_ip());} ?>
|
||||
<?php if (current_user_can('manage_options') and (wp_is_mobile() == false)) {
|
||||
$comment_ID = $comment->comment_ID;
|
||||
$i_private = get_comment_meta($comment_ID, '_private', true);
|
||||
|
@ -801,7 +801,7 @@ function custom_login()
|
|||
//echo '<link rel="stylesheet" type="text/css" href="' . get_bloginfo('template_directory') . '/inc/login.css" />'."\n";
|
||||
echo '<link rel="stylesheet" type="text/css" href="' . get_template_directory_uri() . '/inc/login.css?' . SAKURA_VERSION . '" />' . "\n";
|
||||
//echo '<script type="text/javascript" src="'.get_bloginfo('template_directory').'/js/jquery.min.js"></script>'."\n";
|
||||
echo '<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/jquery/jquery@1.8.2/jquery.min.js"></script>' . "\n";
|
||||
echo '<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/jquery/jquery@1.9.0/jquery.min.js"></script>' . "\n";
|
||||
}
|
||||
|
||||
add_action('login_head', 'custom_login');
|
||||
|
@ -969,11 +969,11 @@ function comment_mail_notify($comment_id)
|
|||
<h3>您有一条来自<a style="text-decoration: none;color: orange " target="_blank" href="' . home_url() . '/">' . get_option("blogname") . '</a>的回复</h3>
|
||||
<br>
|
||||
<p style="font-size: 14px;">您在文章《' . get_the_title($comment->comment_post_ID) . '》上发表的评论:</p>
|
||||
<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">'
|
||||
. trim(get_comment($parent_id)->comment_content) . '</p>
|
||||
<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">'
|
||||
. trim(get_comment($parent_id)->comment_content) . '</div>
|
||||
<p style="font-size: 14px;">' . trim($comment->comment_author) . ' 给您的回复如下:</p>
|
||||
<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">'
|
||||
. trim($comment->comment_content) . '</p>
|
||||
<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">'
|
||||
. trim($comment->comment_content) . '</div>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<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()
|
|||
return rest_url('sakura/v1/image/feature') . '?' . rand(1, 1000);
|
||||
}
|
||||
|
||||
//防止设置置顶文章造成的图片同侧bug
|
||||
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' ) );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//评论回复
|
||||
function sakura_comment_notify($comment_id)
|
||||
{
|
||||
|
@ -1817,6 +1807,7 @@ function markdown_parser($incoming_comment)
|
|||
return $incoming_comment;
|
||||
}
|
||||
add_filter('preprocess_comment', 'markdown_parser');
|
||||
remove_filter( 'comment_text', 'make_clickable', 9 );
|
||||
|
||||
//保存Markdown评论
|
||||
function save_markdown_comment($comment_ID, $comment_approved)
|
||||
|
|
|
@ -17,7 +17,7 @@ class Parsedown
|
|||
{
|
||||
# ~
|
||||
|
||||
const version = '1.7.3';
|
||||
const version = '1.7.4';
|
||||
|
||||
# ~
|
||||
|
||||
|
@ -1489,7 +1489,22 @@ class Parsedown
|
|||
}
|
||||
}
|
||||
|
||||
$permitRawHtml = false;
|
||||
|
||||
if (isset($Element['text']))
|
||||
{
|
||||
$text = $Element['text'];
|
||||
}
|
||||
// very strongly consider an alternative if you're writing an
|
||||
// extension
|
||||
elseif (isset($Element['rawHtml']))
|
||||
{
|
||||
$text = $Element['rawHtml'];
|
||||
$allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode'];
|
||||
$permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode;
|
||||
}
|
||||
|
||||
if (isset($text))
|
||||
{
|
||||
$markup .= '>';
|
||||
|
||||
|
@ -1500,11 +1515,15 @@ class Parsedown
|
|||
|
||||
if (isset($Element['handler']))
|
||||
{
|
||||
$markup .= $this->{$Element['handler']}($Element['text'], $Element['nonNestables']);
|
||||
$markup .= $this->{$Element['handler']}($text, $Element['nonNestables']);
|
||||
}
|
||||
elseif (!$permitRawHtml)
|
||||
{
|
||||
$markup .= self::escape($text, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$markup .= self::escape($Element['text'], true);
|
||||
$markup .= $text;
|
||||
}
|
||||
|
||||
$markup .= '</'.$Element['name'].'>';
|
||||
|
|
|
@ -120,7 +120,12 @@ function cover_gallery() {
|
|||
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/feature
|
||||
*/
|
||||
function feature_gallery() {
|
||||
return cover_gallery();
|
||||
$imgurl = Images::feature_gallery();
|
||||
$data = array('feature image');
|
||||
$response = new WP_REST_Response($data);
|
||||
$response->set_status(302);
|
||||
$response->header('Location', $imgurl);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -154,7 +154,7 @@ class Images
|
|||
$img_array = json_decode($sakura_image_array, true);
|
||||
$img = array_rand($img_array);
|
||||
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
|
||||
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
|
||||
if (strpos($_SERVER['HTTP_ACCEPT'], 'image/webp') !== false) {
|
||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
|
||||
} else {
|
||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
|
||||
|
@ -162,4 +162,13 @@ class Images
|
|||
}
|
||||
return $imgurl;
|
||||
}
|
||||
|
||||
public static function feature_gallery() {
|
||||
if (akina_option('post_cover_options') == "type_2") {
|
||||
$imgurl = akina_option('post_cover');
|
||||
} else {
|
||||
$imgurl = self::cover_gallery();
|
||||
}
|
||||
return $imgurl;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ body {
|
|||
|
||||
.nav-tab-wrapper {
|
||||
position: relative;
|
||||
max-width: 860px;
|
||||
max-width: 900px;
|
||||
margin: auto !important;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ body {
|
|||
.nav-tab {
|
||||
background: none;
|
||||
border:none;
|
||||
padding: 10px 20px;
|
||||
padding: 10px 15px;
|
||||
font-weight: 300;
|
||||
font-size: 15px;
|
||||
color: darkgoldenrod;
|
||||
|
@ -74,17 +74,23 @@ a#options-group-4-tab:before {
|
|||
|
||||
a#options-group-5-tab:before {
|
||||
font-family: "dashicons";
|
||||
content: "\f110";
|
||||
content: "\f101";
|
||||
float: left;
|
||||
}
|
||||
|
||||
a#options-group-6-tab:before {
|
||||
font-family: "dashicons";
|
||||
content: "\f325";
|
||||
content: "\f110";
|
||||
float: left;
|
||||
}
|
||||
|
||||
a#options-group-7-tab:before {
|
||||
font-family: "dashicons";
|
||||
content: "\f325";
|
||||
float: left;
|
||||
}
|
||||
|
||||
a#options-group-8-tab:before {
|
||||
font-family: "dashicons";
|
||||
content: "\f487";
|
||||
float: left;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -188,9 +188,7 @@ color: #676767 !important}
|
|||
}
|
||||
|
||||
input[type=checkbox]:checked:before {
|
||||
content: "\f147";
|
||||
margin: -2px 0 0 -2px;
|
||||
color: #FF5656;
|
||||
}
|
||||
|
||||
/* loading */
|
||||
|
|
|
@ -37,6 +37,8 @@ mashiro_option.skin_bg6 = "https://api.mashiro.top/bing/";
|
|||
mashiro_option.skin_bg7 = "https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.2/other-sites/api-index/images/me.png";
|
||||
<?php } ?>
|
||||
|
||||
mashiro_option.darkmode = <?php if ( akina_option('darkmode') ){ echo 'true'; } else { echo 'false'; } ?>;
|
||||
|
||||
<?php if( is_home() ){ ?>
|
||||
mashiro_option.land_at_home = true;
|
||||
<?php }else {?>
|
||||
|
|
|
@ -146,7 +146,7 @@ function code_highlight_style() {
|
|||
}
|
||||
var ele_name = $('pre:eq(' + i + ')')[0].children[0].className;
|
||||
var lang = ele_name.substr(0, ele_name.indexOf(" ")).replace('language-', '');
|
||||
if (lang.toLowerCase() == "hljs") var lang = "text";
|
||||
if (lang.toLowerCase() == "hljs") var lang = $('pre:eq(' + i + ') code').attr("class").replace('hljs', '')?$('pre:eq(' + i + ') code').attr("class").replace('hljs', ''):"text";
|
||||
$('pre:eq(' + i + ')').addClass('highlight-wrap');
|
||||
for (var t in attributes) {
|
||||
$('pre:eq(' + i + ')').attr(t, attributes[t]);
|
||||
|
@ -334,12 +334,11 @@ function checkDarkModeCookie() {
|
|||
var dark = getCookie("dark"),
|
||||
today = new Date(),
|
||||
hour = today.getHours();
|
||||
if ((!dark && (hour > 21 || hour < 7) ) || (dark == '1' && (hour >= 22 || hour <= 6))) {
|
||||
if (mashiro_option.darkmode && ((!dark && (hour > 21 || hour < 7) ) || (dark == '1' && (hour >= 22 || hour <= 6)))) {
|
||||
setTimeout(function () {
|
||||
$("#dark-bg").click();
|
||||
}, 100);
|
||||
$("#moblieDarkLight").html('<i class="fa fa-sun-o" aria-hidden="true"></i>');
|
||||
console.log('夜间模式开启');
|
||||
} else {
|
||||
if (document.body.clientWidth > 860) {
|
||||
setTimeout(function () {
|
||||
|
@ -351,7 +350,6 @@ function checkDarkModeCookie() {
|
|||
$("#moblieDarkLight").html('<i class="fa fa-moon-o" aria-hidden="true"></i>');
|
||||
setCookie("dark", "0", 0.33);
|
||||
}
|
||||
console.log('夜间模式关闭');
|
||||
}
|
||||
}
|
||||
if (!getCookie("darkcache") && (new Date().getHours() > 21 || new Date().getHours() < 7)) {
|
||||
|
@ -399,45 +397,43 @@ $(document).ready(function () {
|
|||
checkskinSecter();
|
||||
}
|
||||
if (tagid == "dark-bg") {
|
||||
addComment.I("content").classList.add('notransition');
|
||||
addComment.I("content").style.backgroundColor = "#fff";
|
||||
addComment.I("content").offsetHeight;
|
||||
addComment.I("content").classList.remove('notransition');
|
||||
$("html").css("background", "#31363b");
|
||||
$(".site-content").css("background-color", "#fff");
|
||||
$("body").addClass("dark");
|
||||
setCookie("dark", "1", 0.33);
|
||||
} else{
|
||||
$("html").css("background", "unset");
|
||||
$("body").removeClass("dark");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
setCookie("dark", "0", 0.33);
|
||||
setCookie("bgImgSetting", tagid, 30);
|
||||
setTimeout(function () {
|
||||
addComment.I("content").style.backgroundColor = "rgba(255, 255, 255, 0.8)";
|
||||
}, 1000);
|
||||
}
|
||||
switch (tagid) {
|
||||
case "white-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg0) + ")");
|
||||
$(".site-content").css("background-color", "#fff");
|
||||
break;
|
||||
case "sakura-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg1) + ")");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
break;
|
||||
case "gribs-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg2) + ")");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
break;
|
||||
case "pixiv-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg3) + ")");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
break;
|
||||
case "KAdots-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg4) + ")");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
break;
|
||||
case "totem-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg5) + ")");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
break;
|
||||
case "bing-bg":
|
||||
$("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg6) + ")");
|
||||
$(".site-content").css("background-color", "rgba(255, 255, 255, .8)");
|
||||
break;
|
||||
// case "dark-bg":
|
||||
// $("body").css("background-image", "url(" + checkskin_bg(mashiro_option.skin_bg7) + ")");
|
||||
|
@ -1055,13 +1051,15 @@ function load_bangumi() {
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', this.href + "&_wpnonce=" + Poi.nonce, true);
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
||||
if (xhr.readyState == 4 ) {
|
||||
if(xhr.status == 200){
|
||||
var html = JSON.parse(xhr.responseText);
|
||||
$("#bangumi-pagination").remove();
|
||||
$(".row").append(html);
|
||||
}else{
|
||||
$("#bangumi-pagination a").removeClass("loading").html('<i class="fa fa-exclamation-triangle" aria-hidden="true"></i> ERROR ');
|
||||
}
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
return false;
|
||||
|
|
Binary file not shown.
1354
languages/en_US.po
1354
languages/en_US.po
File diff suppressed because it is too large
Load Diff
1644
languages/sakura.pot
1644
languages/sakura.pot
File diff suppressed because it is too large
Load Diff
Binary file not shown.
1450
languages/zh_CN.po
1450
languages/zh_CN.po
File diff suppressed because it is too large
Load Diff
298
options.php
298
options.php
|
@ -134,23 +134,10 @@ function optionsframework_options()
|
|||
|
||||
$options[] = array(
|
||||
'name' => __('Theme scheme tool transparency', 'sakura'), /*切换主题菜单透明度*/
|
||||
'desc' => __('Adjust the theme scheme menu transparency, the smaller the value, the more transparent. The default value is 0.8', 'sakura'), /*调整切换主题菜单透明度,值越小越透明。默认透明度0.8*/
|
||||
'desc' => __('Adjust the theme scheme menu transparency, fill in decimals between 0 and 1, the smaller the value, the more transparent. The default value is 0.8', 'sakura'), /*调整切换主题菜单透明度,值越小越透明。默认透明度0.8*/
|
||||
'id' => 'sakura_skin_alpha',
|
||||
'std' => '0.8',
|
||||
'type' => 'select',
|
||||
'options' => array(
|
||||
'0' => __('Transparent', 'sakura'), /*全透明*/
|
||||
'0.1' => __('Transparency 0.1', 'sakura'), /*透明度0.1*/
|
||||
'0.2' => __('Transparency 0.2', 'sakura'), /*透明度0.2*/
|
||||
'0.3' => __('Transparency 0.3', 'sakura'), /*透明度0.3*/
|
||||
'0.4' => __('Transparency 0.4', 'sakura'), /*透明度0.4*/
|
||||
'0.5' => __('Transparency 0.5', 'sakura'), /*透明度0.5*/
|
||||
'0.6' => __('Transparency 0.6', 'sakura'), /*透明度0.6*/
|
||||
'0.7' => __('Transparency 0.7', 'sakura'), /*透明度0.7*/
|
||||
'0.8' => __('Transparency 0.8', 'sakura'), /*透明度0.8*/
|
||||
'0.9' => __('Transparency 0.9', 'sakura'), /*透明度0.9*/
|
||||
'1' => __('Opaque', 'sakura'), /*不透明*/
|
||||
));
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Change web background', 'sakura'), /*切换网页背景*/
|
||||
|
@ -159,6 +146,13 @@ function optionsframework_options()
|
|||
'std' => 'none,https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/sakura.png,https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/plaid2dbf8.jpg,https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/star02.png,https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/kyotoanimation.png,https://cdn.jsdelivr.net/gh/spirit1431007/cdn@1.6/img/dot_orange.gif,https://api.mashiro.top/bing/,https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.2/other-sites/api-index/images/me.png',
|
||||
'type' => 'textarea');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Darkmode', 'sakura'),
|
||||
'desc' => __('Automatically turn on dark mode from 10:00 p.m. to 06:00 a.m.', 'sakura'),
|
||||
'id' => 'darkmode',
|
||||
'std' => '1',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Personal avatar', 'sakura'), /*个人头像*/
|
||||
'desc' => __('The best size is 130px*130px.', 'sakura'), /*最佳尺寸130px*130px。*/
|
||||
|
@ -240,6 +234,25 @@ function optionsframework_options()
|
|||
'imageflow' => __('Graphic', 'sakura'), /*图文*/
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Cover manifest', 'sakura'), /*首页文章特色图选项*/
|
||||
'desc' => __('Select how to call the post featue image, only for the post without feature image', 'sakura'), /*选择文章特色图的调用方式,只对没有设置特色图像的文章生效*/
|
||||
'id' => 'post_cover_options',
|
||||
'std' => "type_1",
|
||||
'type' => "select",
|
||||
'options' => array(
|
||||
'type_1' => __('same as the cover of the first screen (default)', 'sakura'), /*跟随第一屏封面图*/
|
||||
'type_2' => __('custom api (advanced)', 'sakura'), /*外部随机图API*/
|
||||
)
|
||||
);
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Cover images url', 'sakura'), /*图片库url*/
|
||||
'desc' => __('Fill in the custom image api url.', 'sakura'),
|
||||
'id' => 'post_cover',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Home article feature images (only valid for standard mode)', 'sakura'), /*首页文章特色图(仅对标准风格生效)*/
|
||||
'id' => 'list_type',
|
||||
|
@ -740,6 +753,139 @@ function optionsframework_options()
|
|||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
//评论区
|
||||
$options[] = array(
|
||||
'name' => __('Comment field', 'sakura'), /*评论区*/
|
||||
'type' => 'heading');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Gravatar avatar proxy', 'sakura'),
|
||||
'desc' => __('A front-ed proxy for Gravatar, eg. gravatar.2heng.xin/avatar . Leave it blank if you do not need.', 'sakura'),
|
||||
'id' => 'gravatar_proxy',
|
||||
'std' => "gravatar.2heng.xin/avatar",
|
||||
'type' => "text");
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment image upload API', 'sakura'), /*评论图片上传接口*/
|
||||
'id' => 'img_upload_api',
|
||||
'std' => "imgur",
|
||||
'type' => "radio",
|
||||
'options' => array(
|
||||
'imgur' => __('Imgur (https://imgur.com)', 'sakura'),
|
||||
'smms' => __('SM.MS (https://sm.ms)', 'sakura'),
|
||||
'chevereto' => __('Chevereto (https://chevereto.com)', 'sakura'),
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Imgur Client ID', 'sakura'),
|
||||
'desc' => __('Register your application <a href="https://api.imgur.com/oauth2/addclient">here</a>, note we only need the Client ID here.', 'sakura'),
|
||||
'id' => 'imgur_client_id',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('SM.MS Secret Token', 'sakura'),
|
||||
'desc' => __('Register your application <a href="https://sm.ms/home/apitoken">here</a>.', 'sakura'),
|
||||
'id' => 'smms_client_id',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Chevereto API v1 key', 'sakura'),
|
||||
'desc' => __('Get your API key here: ' . akina_option('cheverto_url') . '/dashboard/settings/api', 'sakura'),
|
||||
'id' => 'chevereto_api_key',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Chevereto URL', 'sakura'),
|
||||
'desc' => __('Your Chevereto homepage url, no slash in the end, eg. https://your.cherverto.com', 'sakura'),
|
||||
'id' => 'cheverto_url',
|
||||
'std' => 'https://your.cherverto.com',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment images proxy', 'sakura'),
|
||||
'desc' => __('A front-ed proxy for the uploaded images. Leave it blank if you do not need.', 'sakura'),
|
||||
'id' => 'cmt_image_proxy',
|
||||
'std' => 'https://images.weserv.nl/?url=',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Imgur upload proxy', 'sakura'),
|
||||
'desc' => __('A back-ed proxy to upload images. You may set a self hosted proxy with Nginx, following my <a href="https://2heng.xin/2018/06/06/javascript-upload-images-with-imgur-api/">turtal</a>. This feature is mainly for Chinese who cannot access to Imgur due to the GFW. The default and official setting is 【<a href="https://api.imgur.com/3/image/">https://api.imgur.com/3/image/</a>】', 'sakura'),
|
||||
'id' => 'imgur_upload_image_proxy',
|
||||
'std' => 'https://api.imgur.com/3/image/',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comments reply notification', 'sakura'), /*邮件回复通知*/
|
||||
'desc' => __('WordPress will use email to notify users when their comments receive a reply by default. Tick this item allows users to set their own comments reply notification', 'sakura'), /*WordPress默认会使用邮件通知用户评论收到回复,开启此项允许用户设置自己的评论收到回复时是否使用邮件通知*/
|
||||
'id' => 'mail_notify',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Administrator comment notification', 'sakura'), /*邮件回复通知管理员*/
|
||||
'desc' => __('Whether to use email notification when the administrator\'s comments receive a reply', 'sakura'), /*当管理员评论收到回复时是否使用邮件通知*/
|
||||
'id' => 'admin_notify',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Enable private comment', 'sakura'), /*允许私密评论*/
|
||||
'desc' => __('Allow users to set their own comments to be invisible to others', 'sakura'), /*允许用户设置自己的评论对其他人不可见*/
|
||||
'id' => 'open_private_message',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Human verification', 'sakura'), /*机器人验证*/
|
||||
'desc' => __('Enable human verification', 'sakura'), /*开启机器人验证*/
|
||||
'id' => 'norobot',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('QQ avatar link encryption', 'sakura'), /*QQ头像链接加密*/
|
||||
'desc' => __('Do not display the user\'s qq avatar links directly.', 'sakura'), /*不直接暴露用户qq头像链接*/
|
||||
'id' => 'qq_avatar_link',
|
||||
'std' => "off",
|
||||
'type' => "select",
|
||||
'options' => array(
|
||||
'off' => __('Off (default)', 'sakura'), /*关闭(默认)*/
|
||||
'type_1' => __('use redirect (general security)', 'sakura'), /*使用 重定向(安全性一般)'*/
|
||||
'type_2' => __('fetch data at backend (high security)', 'sakura'), /*后端获取数据(安全性高)*/
|
||||
'type_3' => __('fetch data at backend (high security,slow)', 'sakura'), /*后端获取数据(安全性高, 慢)*/
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment UA infomation', 'sakura'), /*评论UA信息*/
|
||||
'desc' => __('Check to enable, display the user\'s browser, operating system information', 'sakura'), /*勾选开启,显示用户的浏览器,操作系统信息*/
|
||||
'id' => 'open_useragent',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment location infomation', 'sakura'), /*评论位置信息*/
|
||||
'desc' => __('Check to enable, display the user\'s location info', 'sakura'), /*勾选开启,显示用户的位置信息*/
|
||||
'id' => 'open_location',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Enable disqus', 'sakura'), /*开启多说插件支持*/
|
||||
'desc' => __('Enable disqus for comment', 'sakura'), /*多说已经凉了*/
|
||||
'id' => 'general_disqus_plugin_support',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Time Zone adjustment', 'sakura'), /*时区调整*/
|
||||
'desc' => __('If the comment has a time difference problem adjust here, fill in an integer, the calculation method: actual_time = display_error_time - the_integer_you_entered (unit: hour)', 'sakura'), /*如果评论出现时差问题在这里调整,填入一个整数,计算方法:实际时间=显示错误的时间-你输入的整数(单位:小时)*/
|
||||
'id' => 'time_zone_fix',
|
||||
'std' => '0',
|
||||
'type' => 'text');
|
||||
//后台配置
|
||||
$options[] = array(
|
||||
'name' => __('Dashboard configuration', 'sakura'), /*后台配置*/
|
||||
|
@ -1040,66 +1186,6 @@ function optionsframework_options()
|
|||
'type_4' => __('23k Views (chinese)', 'sakura'), /*23k 次访问(中式)*/
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Gravatar avatar proxy', 'sakura'),
|
||||
'desc' => __('A front-ed proxy for Gravatar, eg. gravatar.2heng.xin/avatar . Leave it blank if you do not need.', 'sakura'),
|
||||
'id' => 'gravatar_proxy',
|
||||
'std' => "gravatar.2heng.xin/avatar",
|
||||
'type' => "text");
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment image upload API', 'sakura'), /*评论图片上传接口*/
|
||||
'id' => 'img_upload_api',
|
||||
'std' => "imgur",
|
||||
'type' => "radio",
|
||||
'options' => array(
|
||||
'imgur' => __('Imgur (https://imgur.com)', 'sakura'),
|
||||
'smms' => __('SM.MS (https://sm.ms)', 'sakura'),
|
||||
'chevereto' => __('Chevereto (https://chevereto.com)', 'sakura'),
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Imgur Client ID', 'sakura'),
|
||||
'desc' => __('Register your application <a href="https://api.imgur.com/oauth2/addclient">here</a>, note we only need the Client ID here.', 'sakura'),
|
||||
'id' => 'imgur_client_id',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('SM.MS Secret Token', 'sakura'),
|
||||
'desc' => __('Register your application <a href="https://sm.ms/home/apitoken">here</a>.', 'sakura'),
|
||||
'id' => 'smms_client_id',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Chevereto API v1 key', 'sakura'),
|
||||
'desc' => __('Get your API key here: ' . akina_option('cheverto_url') . '/dashboard/settings/api', 'sakura'),
|
||||
'id' => 'chevereto_api_key',
|
||||
'std' => '',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Chevereto URL', 'sakura'),
|
||||
'desc' => __('Your Chevereto homepage url, no slash in the end, eg. https://your.cherverto.com', 'sakura'),
|
||||
'id' => 'cheverto_url',
|
||||
'std' => 'https://your.cherverto.com',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment images proxy', 'sakura'),
|
||||
'desc' => __('A front-ed proxy for the uploaded images. Leave it blank if you do not need.', 'sakura'),
|
||||
'id' => 'cmt_image_proxy',
|
||||
'std' => 'https://images.weserv.nl/?url=',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Imgur upload proxy', 'sakura'),
|
||||
'desc' => __('A back-ed proxy to upload images. You may set a self hosted proxy with Nginx, following my <a href="https://2heng.xin/2018/06/06/javascript-upload-images-with-imgur-api/">turtal</a>. This feature is mainly for Chinese who cannot access to Imgur due to the GFW. The default and official setting is 【<a href="https://api.imgur.com/3/image/">https://api.imgur.com/3/image/</a>】', 'sakura'),
|
||||
'id' => 'imgur_upload_image_proxy',
|
||||
'std' => 'https://api.imgur.com/3/image/',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Enable live search', 'sakura'), /*启用实时搜索*/
|
||||
'desc' => __('Real-time search in the foreground, call the Rest API to update the cache every hour, you can manually set the cache time in api.php', 'sakura'), /*前台实现实时搜索,调用 Rest API 每小时更新一次缓存,可在 functions.php 里手动设置缓存时间*/
|
||||
|
@ -1149,67 +1235,5 @@ function optionsframework_options()
|
|||
'std' => 'bibi',
|
||||
'type' => 'text');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comments reply notification', 'sakura'), /*邮件回复通知*/
|
||||
'desc' => __('WordPress will use email to notify users when their comments receive a reply by default. Tick this item allows users to set their own comments reply notification', 'sakura'), /*WordPress默认会使用邮件通知用户评论收到回复,开启此项允许用户设置自己的评论收到回复时是否使用邮件通知*/
|
||||
'id' => 'mail_notify',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Administrator comment notification', 'sakura'), /*邮件回复通知管理员*/
|
||||
'desc' => __('Whether to use email notification when the administrator\'s comments receive a reply', 'sakura'), /*当管理员评论收到回复时是否使用邮件通知*/
|
||||
'id' => 'admin_notify',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Enable private comment', 'sakura'), /*允许私密评论*/
|
||||
'desc' => __('Allow users to set their own comments to be invisible to others', 'sakura'), /*允许用户设置自己的评论对其他人不可见*/
|
||||
'id' => 'open_private_message',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Human verification', 'sakura'), /*机器人验证*/
|
||||
'desc' => __('Enable human verification', 'sakura'), /*开启机器人验证*/
|
||||
'id' => 'norobot',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('QQ avatar link encryption', 'sakura'), /*QQ头像链接加密*/
|
||||
'desc' => __('Do not display the user\'s qq avatar links directly.', 'sakura'), /*不直接暴露用户qq头像链接*/
|
||||
'id' => 'qq_avatar_link',
|
||||
'std' => "off",
|
||||
'type' => "select",
|
||||
'options' => array(
|
||||
'off' => __('Off (default)', 'sakura'), /*关闭(默认)*/
|
||||
'type_1' => __('use redirect (general security)', 'sakura'), /*使用 重定向(安全性一般)'*/
|
||||
'type_2' => __('fetch data at backend (high security)', 'sakura'), /*后端获取数据(安全性高)*/
|
||||
'type_3' => __('fetch data at backend (high security,slow)', 'sakura'), /*后端获取数据(安全性高, 慢)*/
|
||||
));
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Comment UA infomation', 'sakura'), /*评论UA信息*/
|
||||
'desc' => __('Check to enable, display the user\'s browser, operating system information', 'sakura'), /*勾选开启,显示用户的浏览器,操作系统信息*/
|
||||
'id' => 'open_useragent',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Enable disqus', 'sakura'), /*开启多说插件支持*/
|
||||
'desc' => __('Enable disqus for comment', 'sakura'), /*多说已经凉了*/
|
||||
'id' => 'general_disqus_plugin_support',
|
||||
'std' => '0',
|
||||
'type' => 'checkbox');
|
||||
|
||||
$options[] = array(
|
||||
'name' => __('Time Zone adjustment', 'sakura'), /*时区调整*/
|
||||
'desc' => __('If the comment has a time difference problem adjust here, fill in an integer, the calculation method: actual_time = display_error_time - the_integer_you_entered (unit: hour)', 'sakura'), /*如果评论出现时差问题在这里调整,填入一个整数,计算方法:实际时间=显示错误的时间-你输入的整数(单位:小时)*/
|
||||
'id' => 'time_zone_fix',
|
||||
'std' => '0',
|
||||
'type' => 'text');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
|
41
style.css
41
style.css
|
@ -5,7 +5,7 @@ Theme URI: https://github.com/mashirozx/Sakura/
|
|||
Author: Mashiro, Spirit, Louie, Fuzzz
|
||||
Author URI: http://2heng.xin
|
||||
Description: A wonderful branch of theme Akina
|
||||
Version: 3.3.8
|
||||
Version: 3.3.9
|
||||
License: GNU General Public License v2 or later
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
Text Domain: sakura
|
||||
|
@ -1278,12 +1278,20 @@ a:hover {
|
|||
padding: 40px 0 0
|
||||
}
|
||||
|
||||
.site-content.notransition {
|
||||
-webkit-transition: none !important;
|
||||
-moz-transition: none !important;
|
||||
-o-transition: none !important;
|
||||
-ms-transition: none !important;
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
.site-content {
|
||||
max-width: 800px;
|
||||
padding: 0 10px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
background-color: #fff
|
||||
background-color: rgba(255, 255, 255, .8)
|
||||
}
|
||||
|
||||
.post-list {
|
||||
|
@ -1576,22 +1584,6 @@ i.iconfont.hotpost {
|
|||
overflow: hidden
|
||||
}
|
||||
|
||||
.post-list-thumb-left .post-content-wrap {
|
||||
float: left;
|
||||
padding-left: 30px;
|
||||
padding-right: 0;
|
||||
text-align: right;
|
||||
margin: 20px 10px 10px 0
|
||||
}
|
||||
|
||||
.post-list-thumb-left .post-thumb {
|
||||
float: left
|
||||
}
|
||||
|
||||
.post-list-thumb-left .post-thumb a {
|
||||
border-radius: 10px 0 0 10px
|
||||
}
|
||||
|
||||
@media (max-width:768px) {
|
||||
.float-content p {
|
||||
height: auto;
|
||||
|
@ -1611,12 +1603,11 @@ i.iconfont.hotpost {
|
|||
width: 100%;
|
||||
left: 0
|
||||
}
|
||||
.post-content-wrap,
|
||||
.post-list-thumb-left .post-content-wrap {
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
float: none;
|
||||
.post-list-thumb .post-content-wrap {
|
||||
text-align: left !important;
|
||||
margin: 0 !important;
|
||||
padding: 20px !important;
|
||||
float: none !important;
|
||||
box-shadow: none;
|
||||
border-top: 0
|
||||
}
|
||||
|
@ -3648,7 +3639,7 @@ a.page-numbers {
|
|||
font-size: 14px
|
||||
}
|
||||
|
||||
.siren-checkbox-label input {
|
||||
.siren-checkbox-label input,#wp-comment-cookies-consent {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
float: none;
|
||||
|
|
|
@ -11,21 +11,8 @@
|
|||
//}
|
||||
//add_filter('the_excerpt', 'custom_short_excerpt');
|
||||
$i=0; while ( have_posts() ) : the_post(); $i++;
|
||||
switch (akina_option('feature_align')) {
|
||||
case "left":
|
||||
$class = 'post-list-thumb-left';
|
||||
break;
|
||||
case "right":
|
||||
$class = '';
|
||||
break;
|
||||
case "alternate":
|
||||
$class = ($i%2 == 0) ? 'post-list-thumb-left' : ''; // 如果为偶数
|
||||
break;
|
||||
default:
|
||||
$class = ($i%2 == 0) ? 'post-list-thumb-left' : '';
|
||||
}
|
||||
if( $i == 1 ){
|
||||
$class .= ' post-list-show';
|
||||
$class = ' post-list-show';
|
||||
}
|
||||
if(has_post_thumbnail()){
|
||||
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large');
|
||||
|
|
Loading…
Reference in New Issue