commit
ccb0b6f5da
1847
functions.php
1847
functions.php
File diff suppressed because it is too large
Load Diff
|
@ -78,8 +78,7 @@ window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments)}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</head>
|
</head>
|
||||||
<body <?php body_class(); ?>>
|
<body <?php body_class(); ?>>
|
||||||
<?php if(get_template_directory_uri() != get_site_url().'/wp-content/themes/Sakura') echo '<div style="position:fixed;height:100%;width:100%;top:0;left:0;font-size:20px;z-index:999999;background-color: #fff;">Plz rename the theme folder name as <span style="color:red">Sakura</span>!<br>请将主题文件夹名改为 <span style="color:red">Sakura</span>!</div>'; ?>
|
<div class="scrollbar" id="bar"></div>
|
||||||
<div class="scrollbar" id="bar"></div>
|
|
||||||
<section id="main-container">
|
<section id="main-container">
|
||||||
<?php
|
<?php
|
||||||
if(!akina_option('head_focus')){
|
if(!akina_option('head_focus')){
|
||||||
|
|
88
inc/api.php
88
inc/api.php
|
@ -325,14 +325,23 @@ EOS;
|
||||||
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/cover
|
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/cover
|
||||||
*/
|
*/
|
||||||
function cover_gallery() {
|
function cover_gallery() {
|
||||||
global $wpdb,$sakura_image_array;
|
if(akina_option('cover_cdn_options')=="type_2"){
|
||||||
$img_array = json_decode($sakura_image_array, true);
|
$img_array = glob(get_template_directory() . "/manifest/gallary/*.{gif,jpg,png}",GLOB_BRACE);
|
||||||
$img = array_rand($img_array);
|
$img = array_rand($img_array);
|
||||||
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
|
$imgurl = trim($img_array[$img]);
|
||||||
if(strpos($_SERVER['HTTP_ACCEPT'], 'image/webp')) {
|
$imgurl = str_replace(get_template_directory(), get_template_directory_uri(), $imgurl);
|
||||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
|
}elseif(akina_option('cover_cdn_options')=="type_3"){
|
||||||
} else {
|
$imgurl = akina_option('cover_cdn');
|
||||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
|
}else{
|
||||||
|
global $sakura_image_array;
|
||||||
|
$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')) {
|
||||||
|
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
|
||||||
|
} else {
|
||||||
|
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$data = array('cover image');
|
$data = array('cover image');
|
||||||
$response = new WP_REST_Response($data);
|
$response = new WP_REST_Response($data);
|
||||||
|
@ -346,20 +355,7 @@ function cover_gallery() {
|
||||||
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/feature
|
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/feature
|
||||||
*/
|
*/
|
||||||
function feature_gallery() {
|
function feature_gallery() {
|
||||||
global $wpdb,$sakura_image_array;
|
return cover_gallery();
|
||||||
$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')) {
|
|
||||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["webp"][0];
|
|
||||||
} else {
|
|
||||||
$imgurl = $img_domain . "/manifest/" . $img_array[$img]["jpeg"][0];
|
|
||||||
}
|
|
||||||
$data = array('cover image');
|
|
||||||
$response = new WP_REST_Response($data);
|
|
||||||
$response->set_status(302);
|
|
||||||
$response->header('Location', $imgurl);
|
|
||||||
return $response;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -367,30 +363,34 @@ function feature_gallery() {
|
||||||
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/database/update
|
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/database/update
|
||||||
*/
|
*/
|
||||||
function update_database() {
|
function update_database() {
|
||||||
global $wpdb;
|
if(akina_option('cover_cdn_options')=="type_1"){
|
||||||
$sakura_table_name = $wpdb->base_prefix.'sakura';
|
global $wpdb;
|
||||||
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory_uri();
|
$sakura_table_name = $wpdb->base_prefix.'sakura';
|
||||||
$manifest = file_get_contents($img_domain . "/manifest/manifest.json");
|
$img_domain = akina_option('cover_cdn') ? akina_option('cover_cdn') : get_template_directory();
|
||||||
if($manifest) {
|
$manifest = file_get_contents($img_domain . "/manifest/manifest.json");
|
||||||
$manifest = array(
|
if($manifest) {
|
||||||
"mate_key" => "manifest_json",
|
$manifest = array(
|
||||||
"mate_value" => $manifest
|
"mate_key" => "manifest_json",
|
||||||
);
|
"mate_value" => $manifest
|
||||||
$time = array(
|
);
|
||||||
"mate_key" => "json_time",
|
$time = array(
|
||||||
"mate_value" => date("Y-m-d H:i:s",time())
|
"mate_key" => "json_time",
|
||||||
);
|
"mate_value" => date("Y-m-d H:i:s",time())
|
||||||
|
);
|
||||||
$wpdb->query("DELETE FROM `wp_sakura` WHERE `mate_key` ='manifest_json'");
|
|
||||||
$wpdb->query("DELETE FROM `wp_sakura` WHERE `mate_key` ='json_time'");
|
$wpdb->query("DELETE FROM $sakura_table_name WHERE `mate_key` ='manifest_json'");
|
||||||
$wpdb->insert($sakura_table_name,$manifest);
|
$wpdb->query("DELETE FROM $sakura_table_name WHERE `mate_key` ='json_time'");
|
||||||
$wpdb->insert($sakura_table_name,$time);
|
$wpdb->insert($sakura_table_name,$manifest);
|
||||||
$output = "manifest.json has been stored into database.";
|
$wpdb->insert($sakura_table_name,$time);
|
||||||
|
$output = "manifest.json has been stored into database.";
|
||||||
|
}else{
|
||||||
|
$output = "manifest.json not found, please ensure your url ($img_domain) is corrent.";
|
||||||
|
}
|
||||||
|
$result = new WP_REST_Response($output, 200);
|
||||||
|
return $result;
|
||||||
}else{
|
}else{
|
||||||
$output = "manifest.json not found, please ensure your url is corrent.";
|
return new WP_REST_Response("Invalid access", 200);
|
||||||
}
|
}
|
||||||
$result = new WP_REST_Response($output, 200);
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -753,7 +753,7 @@ if (mashiro_option.float_player_on) {
|
||||||
autoplay: !1,
|
autoplay: !1,
|
||||||
mutex: !0,
|
mutex: !0,
|
||||||
lrcType: 3,
|
lrcType: 3,
|
||||||
listFolded: !1,
|
listFolded: 1,
|
||||||
preload: 'auto',
|
preload: 'auto',
|
||||||
theme: '#2980b9',
|
theme: '#2980b9',
|
||||||
loop: 'all',
|
loop: 'all',
|
||||||
|
@ -789,23 +789,13 @@ if (mashiro_option.float_player_on) {
|
||||||
lrcTag = 2;
|
lrcTag = 2;
|
||||||
});
|
});
|
||||||
var apSwitchTag = 0;
|
var apSwitchTag = 0;
|
||||||
var aplayerlist = $(".aplayer-list");
|
|
||||||
aplayerlist.removeClass("aplayer-list-hide").css({
|
|
||||||
maxHeight: '0px'
|
|
||||||
});
|
|
||||||
$(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover");
|
$(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover");
|
||||||
$(".aplayer-miniswitcher").click(function () {
|
$(".aplayer-miniswitcher").click(function () {
|
||||||
if (apSwitchTag == 0) {
|
if (apSwitchTag == 0) {
|
||||||
aplayerlist.removeClass("aplayer-list-hide").animate({
|
|
||||||
maxHeight: '250px'
|
|
||||||
});
|
|
||||||
$(".aplayer.aplayer-fixed .aplayer-body").removeClass("ap-hover");
|
$(".aplayer.aplayer-fixed .aplayer-body").removeClass("ap-hover");
|
||||||
$("#secondary").addClass("active");
|
$("#secondary").addClass("active");
|
||||||
apSwitchTag = 1;
|
apSwitchTag = 1;
|
||||||
} else {
|
} else {
|
||||||
aplayerlist.css({
|
|
||||||
maxHeight: '0px'
|
|
||||||
});
|
|
||||||
$(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover");
|
$(".aplayer.aplayer-fixed .aplayer-body").addClass("ap-hover");
|
||||||
$("#secondary").removeClass("active");
|
$("#secondary").removeClass("active");
|
||||||
apSwitchTag = 0;
|
apSwitchTag = 0;
|
||||||
|
@ -999,7 +989,9 @@ function activate_widget(){
|
||||||
$("#secondary").remove();
|
$("#secondary").remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
activate_widget();
|
setTimeout(function () {
|
||||||
|
activate_widget();
|
||||||
|
}, 100);
|
||||||
|
|
||||||
mashiro_global.ini.normalize();
|
mashiro_global.ini.normalize();
|
||||||
loadCSS(mashiro_option.jsdelivr_css_src);
|
loadCSS(mashiro_option.jsdelivr_css_src);
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -117,9 +117,6 @@
|
||||||
<?php if (akina_option('facebook')){ ?>
|
<?php if (akina_option('facebook')){ ?>
|
||||||
<li><a href="<?php echo akina_option('facebook', ''); ?>" target="_blank" class="social-wangyiyun" title="Facebook"><img src="https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/images/sns/facebook.png"/></a></li>
|
<li><a href="<?php echo akina_option('facebook', ''); ?>" target="_blank" class="social-wangyiyun" title="Facebook"><img src="https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/images/sns/facebook.png"/></a></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php if (akina_option('googleplus')){ ?>
|
|
||||||
<li><a href="<?php echo akina_option('googleplus', ''); ?>" target="_blank" class="social-wangyiyun" title="Google+"><img src="https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/images/sns/googleplus.png"/></a></li>
|
|
||||||
<?php } ?>
|
|
||||||
<?php if (akina_option('jianshu')){ ?>
|
<?php if (akina_option('jianshu')){ ?>
|
||||||
<li><a href="<?php echo akina_option('jianshu', ''); ?>" target="_blank" class="social-wangyiyun" title="Jianshu"><img src="https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/images/sns/jianshu.png"/></a></li>
|
<li><a href="<?php echo akina_option('jianshu', ''); ?>" target="_blank" class="social-wangyiyun" title="Jianshu"><img src="https://cdn.jsdelivr.net/gh/moezx/cdn@3.1.9/img/Sakura/images/sns/jianshu.png"/></a></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
2135
options.php
2135
options.php
File diff suppressed because it is too large
Load Diff
|
@ -5,7 +5,7 @@ Theme URI: https://github.com/mashirozx/Sakura/
|
||||||
Author: Mashiro, Spirit, Louie, Fuzzz
|
Author: Mashiro, Spirit, Louie, Fuzzz
|
||||||
Author URI: http://2heng.xin
|
Author URI: http://2heng.xin
|
||||||
Description: A wonderful branch of theme Akina
|
Description: A wonderful branch of theme Akina
|
||||||
Version: 3.3.5
|
Version: 3.3.6
|
||||||
License: GNU General Public License v2 or later
|
License: GNU General Public License v2 or later
|
||||||
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
||||||
Text Domain: sakura
|
Text Domain: sakura
|
||||||
|
|
Loading…
Reference in New Issue