diff --git a/404.php b/404.php index 294885c..549e1a3 100644 --- a/404.php +++ b/404.php @@ -17,7 +17,7 @@ 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 页*/?> - + + diff --git a/footer.php b/footer.php index 558163c..2691a70 100644 --- a/footer.php +++ b/footer.php @@ -23,8 +23,8 @@
- - + +

diff --git a/functions.php b/functions.php index e9a2e2d..013aa55 100644 --- a/functions.php +++ b/functions.php @@ -10,6 +10,8 @@ define('SAKURA_VERSION', wp_get_theme()->get('Version')); define('BUILD_VERSION', '3'); + + //ini_set('display_errors', true); //error_reporting(E_ALL); error_reporting(E_ALL ^ E_NOTICE); @@ -174,21 +176,40 @@ add_action('after_setup_theme', 'akina_content_width', 0); /** * Enqueue scripts and styles. */ +function sakura_static_host() +{ + define('SAKURA_STATIC_ASSETS_HOST','https://cdn.jsdelivr.net/'); + if (akina_option('statics_source') == 'jsd'){ + define('SAKURA_STATIC_ASSETS_HOST','https://cdn.jsdelivr.net/'); + //echo(''); + } elseif (akina_option('statics_source') == 'own'){ + $staticurl = akina_option('self_source'); + if (!$staticurl){ + echo(''); + } else { + define('SAKURA_STATIC_ASSETS_HOST',$staticurl); + //echo(''); + + } + } +} +sakura_static_host(); + function sakura_scripts() { if (akina_option('jsdelivr_cdn_test')) { wp_enqueue_script('js_lib', get_template_directory_uri() . '/cdn/js/lib.js', array(), SAKURA_VERSION . akina_option('cookie_version', ''), true); } else { - wp_enqueue_script('js_lib', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/cdn/js/lib.min.js', array(), SAKURA_VERSION, true); + wp_enqueue_script('js_lib', SAKURA_STATIC_ASSETS_HOST .'gh/mashirozx/Sakura@'. SAKURA_VERSION . '/cdn/js/lib.min.js', array(), SAKURA_VERSION, true); } if (akina_option('app_no_jsdelivr_cdn')) { wp_enqueue_style('saukra_css', get_stylesheet_uri(), array(), SAKURA_VERSION); wp_enqueue_script('app', get_template_directory_uri() . '/js/sakura-app.js', array(), SAKURA_VERSION, true); } else { - wp_enqueue_style('saukra_css', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/style.min.css', array(), SAKURA_VERSION); - wp_enqueue_script('app', 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@' . SAKURA_VERSION . '/js/sakura-app.min.js', array(), SAKURA_VERSION, true); + wp_enqueue_style('saukra_css', SAKURA_STATIC_ASSETS_HOST.'gh/mashirozx/Sakura@' . SAKURA_VERSION . '/style.min.css', array(), SAKURA_VERSION); + wp_enqueue_script('app', SAKURA_STATIC_ASSETS_HOST.'gh/mashirozx/Sakura@' . SAKURA_VERSION . '/js/sakura-app.min.js', array(), SAKURA_VERSION, true); } - //wp_enqueue_script('github_card', 'https://cdn.jsdelivr.net/github-cards/latest/widget.js', array(), SAKURA_VERSION, true); + //wp_enqueue_script('github_card', 'https://jsd.yatserver.com/github-cards/latest/widget.js', array(), SAKURA_VERSION, true); if (is_singular() && comments_open() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); @@ -410,7 +431,7 @@ function convertip($ip) * COMMENT FORMATTING * * 标准的 lazyload 输出头像 - * comment_author_email, '80', '', get_comment_author(), array( 'class' => array( 'lazyload' ) ) ) ); ?> + * comment_author_email, '80', '', get_comment_author(), array( 'class' => array( 'lazyload' ) ) ) ); ?> * * 如果不延时是这样的 * comment_author_email, '80', '', get_comment_author() ); ?> @@ -426,7 +447,7 @@ if (!function_exists('akina_comment_format')) {
@@ -475,19 +496,19 @@ function get_author_class($comment_author_email, $user_id) "SELECT comment_ID as author_count FROM $wpdb->comments WHERE comment_author_email = '$comment_author_email' ")); if ($author_count >= 1 && $author_count < 5) //数字可自行修改,代表评论次数。 { - echo ''; + echo ''; } else if ($author_count >= 6 && $author_count < 10) { - echo ''; + echo ''; } else if ($author_count >= 10 && $author_count < 20) { - echo ''; + echo ''; } else if ($author_count >= 20 && $author_count < 40) { - echo ''; + echo ''; } else if ($author_count >= 40 && $author_count < 80) { - echo ''; + echo ''; } else if ($author_count >= 80 && $author_count < 160) { - echo ''; + echo ''; } else if ($author_count >= 160) { - echo ''; + echo ''; } } @@ -593,7 +614,7 @@ function get_the_link_items($id = null) $bookmark->link_image = 'https://view.moezx.cc/images/2017/12/30/Transparent_Akkarin.th.jpg'; } - $output .= ''; + $output .= ''; } $output .= ''; } @@ -813,7 +834,7 @@ function custom_login() //echo ''."\n"; echo '' . "\n"; //echo ''."\n"; - echo '' . "\n"; + echo '' . "\n"; } add_action('login_head', 'custom_login'); @@ -838,11 +859,11 @@ function custom_html() if (akina_option('login_bg')) { $loginbg = akina_option('login_bg'); } else { - $loginbg = 'https://cdn.jsdelivr.net/gh/mashirozx/Sakura@3.2.7/images/hd.png'; + $loginbg = SAKURA_STATIC_ASSETS_HOST.'gh/mashirozx/Sakura@3.2.7/images/hd.png'; } echo '' . "\n"; echo '