Skip to content

Commit

Permalink
1.4.3-rc1
Browse files Browse the repository at this point in the history
1.4.3-rc1
  • Loading branch information
wehaox authored Mar 5, 2022
1 parent ee09999 commit 523909d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 13 deletions.
38 changes: 35 additions & 3 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ function themeConfig($form) {
$sticky_cids->setAttribute('id', 'cids');
$form->addInput($sticky_cids);

$StaticFile = new Typecho_Widget_Helper_Form_Element_Select('StaticFile',
array(
'CDN' => '关闭(CDN加载)',
'local' => '开启(本地加载)',
),
'CDN',
'博客静态资源加载方式',
'介绍:无网络服务器或者CDN炸了可开启此项<br>
将博客静态资源,如js、css、图片从服务器加载(会稍微增加服务器流量消耗)<br>
注意:你需要额外<a href="#">下载</a>静态资源放进主题根目录'
);
$form->addInput($StaticFile->multiMode());

$NewTabLink = new Typecho_Widget_Helper_Form_Element_Select('NewTabLink',
array(
'on' => '开启(默认)',
Expand Down Expand Up @@ -946,6 +959,7 @@ function PostImage($text)
return $text;
}
function themeInit($archive) {
Helper::options()->commentsAntiSpam = false;
if ($archive->is('single')) {
$archive->content = createCatalog($archive->content);
$archive->content = ParseCode($archive->content);
Expand Down Expand Up @@ -999,11 +1013,29 @@ function getGravatar($email, $s = 96, $d = 'mp', $r = 'g', $img = false, $atts =
$url .= ' />';
}
}else{
$url = 'https://q1.qlogo.cn/headimg_dl?dst_uin='.$vai['1']['0'].'&spec=100';
$qquser = $vai['1']['0'];

$db=Typecho_Db::get();
if (!array_key_exists('qqk', $db->fetchRow($db->select()->from('table.comments')))) {
$db->query('ALTER TABLE `'.$db->getPrefix().'comments` ADD `qqk` varchar(64) DEFAULT NULL;');
}

$dbk = $db->fetchRow($db->select('qqk')->from('table.comments')->where('mail=?',$email))['qqk'];
if($dbk == NULL){
$geturl = 'https://ptlogin2.qq.com/getface?&imgtype=1&uin='.$qquser;
$qqurl = file_get_contents($geturl);
$str1 = explode('sdk&k=', $qqurl);
$str2 = explode('&t=', $str1[1]);
$k = $str2[0];
$db->query($db->update('table.comments')->rows(array('qqk'=>$k))->where('mail=?',$email));
$url = 'https://q1.qlogo.cn/headimg_dl?dst_uin='.$qquser.'&spec=100';
}else{
$url = 'https://q1.qlogo.cn/g?b=qq&k='.$dbk.'&s=100';
}

}
return $url;
}

}

// 获取浏览器信息
function getBrowser($agent)
Expand Down
25 changes: 18 additions & 7 deletions header_com.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@
'author' => _t('%s 发布的文章')
), '', ' - '); ?><?php $this->options->title(); ?></title>
<!-- 使用url函数转换相关路径 -->
<link rel="preconnect" href="//cdn.jsdelivr.net" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css">
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/GrayMac.css'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('index.css?v1.4.0'); ?>">
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/style.css?v1.4.2'); ?>">
<?php if (!empty($this->options->beautifyBlock) && in_array('ShowBeautifyChange',$this->options->beautifyBlock)): ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('css/custom.css?v1.4.0'); ?>">
<?php endif; ?>
<link rel="preconnect" href="//cdn.jsdelivr.net" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css">
<link href="https://at.alicdn.com/t/font_3159629_ym9tau0j4d.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css">
<?php if($this->options->StaticFile == 'CDN'): ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css" />
<?php else: ?>
<link rel="stylesheet" href="<?php $this->options->themeUrl('static/css/jquery.fancybox.min.css'); ?>" />
<?php endif; ?>
<?php if (!empty($this->options->beautifyBlock) && in_array('showSnackbar',$this->options->beautifyBlock)): ?>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'">
<script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script>
<?php endif; ?>
<?php if (!empty($this->options->beautifyBlock) && in_array('showLazyloadBlur',$this->options->beautifyBlock)): ?>
<style>
Expand Down Expand Up @@ -302,18 +305,26 @@
<?php endif ?>
<?php $this->header(); ?>
<?php $this->options->CustomHead() ?>
<link rel="stylesheet" href="https://cdn.staticfile.org/fancybox/3.5.2/jquery.fancybox.min.css">
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script>
<script src="<?php $this->options->themeUrl('/js/local-search.js'); ?>"> </script>
<script src="<?php $this->options->themeUrl('/js/tw_cn.js'); ?>"> </script>
<script src="<?php $this->options->themeUrl('/js/main.js?v1.4.0'); ?>"> </script>
<script src="<?php $this->options->themeUrl('/js/utils.js?v1.4.0'); ?>"> </script>
<?php if($this->options->StaticFile == 'CDN'): ?>
<script src="https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"> </script>
<script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"> </script>
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script>
<script src="https://cdn.staticfile.org/fancybox/3.5.2/jquery.fancybox.min.js"></script>
<script src="https://cdn.staticfile.org/fancybox/3.5.2/jquery.fancybox.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script>
<?php else: ?>
<script src="<?php $this->options->themeUrl('static/js/jquery.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/instantpage.min.js'); ?>" type="module"> </script>
<script src="<?php $this->options->themeUrl('static/js/medium-zoom.min.js'); ?>"> </script>
<script src="<?php $this->options->themeUrl('static/js/lazyload.iife.min.js'); ?>"></script>
<script src="<?php $this->options->themeUrl('static/js/jquery.fancybox.min.js'); ?>"></script>
<?php endif; ?>
<!--[if lt IE 8]>
<div class="browsehappy" role="dialog"><?php _e('当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>'); ?>.</div>
<![endif]-->
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* <a href="https://blog.wehaox.com/archives/blogtheme.html#cl-9">主题更新日志</a>
* @package Typecho-Butterfly
* @author b站:wehao-
* @version 1.4.2
* @version 1.4.3-rc1
* @link https://space.bilibili.com/34174433
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
Expand Down Expand Up @@ -116,7 +116,7 @@ function ver() {console.log(`
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #

1.4.2
1.4.3
===================================================================
`);}
</script>
2 changes: 1 addition & 1 deletion link.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@
<?php endif; ?>
</main>
<!-- end #main-->
<?php $this->need('footer.php'); ?>
<?php $this->need('footer.php'); ?>

0 comments on commit 523909d

Please sign in to comment.