sakura/inc/swicher.php

57 lines
2.1 KiB
PHP
Raw Normal View History

2018-05-26 18:59:29 +08:00
<?php
function font_end_js_control() { ?>
<script>
/*Initial Variables*/
var mashiro_option = new Object();
var mashiro_global = new Object();
mashiro_option.NProgressON = <?php if ( akina_option('nprogress_on') ){ echo 'true'; } else { echo 'false'; } ?>;
mashiro_option.email_domain = "<?php echo akina_option('email_domain', ''); ?>";
mashiro_option.email_name = "<?php echo akina_option('email_name', ''); ?>";
mashiro_option.cookie_version_control = "<?php echo akina_option('cookie_version', ''); ?>";
mashiro_option.qzone_autocomplete = false;
mashiro_option.site_name = "<?php echo akina_option('site_name', ''); ?>";
mashiro_option.author_name = "<?php echo akina_option('author_name', ''); ?>";
mashiro_option.template_url = "<?php echo get_template_directory_uri(); ?>";
mashiro_option.site_url = "<?php echo site_url(); ?>";
2019-01-24 17:01:27 +08:00
mashiro_option.qq_api_url = "https://api.2heng.xin/qqinfo/";
mashiro_option.qq_avatar_api_url = "https://api.2heng.xin/qqinfo/";
<?php if( is_home() ){ ?>
mashiro_option.land_at_home = true;
<?php }else {?>
mashiro_option.land_at_home = false;
<?php } ?>
<?php if(akina_option('image_viewer') == 0){ ?>
mashiro_option.baguetteBoxON = false;
<?php }else {?>
mashiro_option.baguetteBoxON = true;
<?php } ?>
<?php if(akina_option('clipboard_copyright') == 0){ ?>
mashiro_option.clipboardCopyright = false;
<?php }else {?>
mashiro_option.clipboardCopyright = true;
<?php } ?>
2018-05-26 18:59:29 +08:00
<?php if(akina_option('jsdelivr_cdn_test')){ ?>
2019-01-24 17:01:27 +08:00
mashiro_option.jsdelivr_css_src = "<?php echo get_template_directory_uri() ?>/cdn/css/lib.css?<?php echo SAKURA_VERSION.akina_option('cookie_version', ''); ?>";
2018-05-26 18:59:29 +08:00
<?php } else { ?>
2019-01-24 17:01:27 +08:00
mashiro_option.jsdelivr_css_src = "https://cdn.jsdelivr.net/gh/moezx/cdn@<?php echo JSDELIVR_VERSION; ?>/sakura/css/lib.min.css";
2018-05-26 18:59:29 +08:00
<?php } ?>
2018-11-04 19:20:10 +08:00
<?php if (akina_option('playlist_id', '')): ?>
mashiro_option.float_player_on = true;
<?php endif; ?>
2018-05-26 18:59:29 +08:00
2019-01-24 17:01:27 +08:00
<?php
if (akina_option('cover_img')) {
$imgurl = akina_option('cover_img');
} else {
$imgurl = get_site_url()."/wp-content/themes/Sakura/cover/index.php";
} ?>
mashiro_option.cover_api = "<?php echo $imgurl; ?>";
2018-05-26 18:59:29 +08:00
/*End of Initial Variables*/
</script>
<?php }
add_action('wp_head', 'font_end_js_control');