Skip to content

Commit

Permalink
update1.7.10
Browse files Browse the repository at this point in the history
  • Loading branch information
wehaox committed Jun 9, 2024
1 parent 8257105 commit 0b0956a
Show file tree
Hide file tree
Showing 18 changed files with 907 additions and 879 deletions.
1 change: 1 addition & 0 deletions archive_header.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header_com.php'); ?>
<style>#body-wrap {min-height: 0;}</style>
<div id="web_bg"></div>
Expand Down
12 changes: 7 additions & 5 deletions articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<div class="article-sort-item year">'. $year .' 年</div>'; //输出年份
}
$output .= '<div class="article-sort-item">';
if(noCover($archives)){
$output .= '<a class="article-sort-item-img" href="'.$archives->permalink .'">
<img onerror="this.onerror=null;this.src='.$erro.'" src="'.get_ArticleThumbnail($archives).'" alt="'. $archives->title .'">
</a>';
}
$output .=
'<div class="article-sort-item">'.
'<a class="article-sort-item-img" href="'.$archives->permalink .'">
<img onerror="this.onerror=null;this.src='.$erro.'" src="'.get_ArticleThumbnail($archives).'" alt="'. $archives->title .'">
</a>
$output .= '
<div class="article-sort-item-info">
<div class="article-sort-item-time">
<i class="far fa-calendar-alt"></i>
Expand Down
1 change: 1 addition & 0 deletions category-list.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
/**
* 分类
Expand Down
3 changes: 2 additions & 1 deletion config/custom_config.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
function themeConfig($form)
{
Expand Down Expand Up @@ -595,7 +596,7 @@ class="btn btn-s" value="还原主题数据" />&nbsp;&nbsp;<input type="submit"
$form->addInput($darkModeSelect->multiMode());

$darkTime = new Typecho_Widget_Helper_Form_Element_Text('darkTime', NULL,
_t('7-20'), _t('自动暗色时间段'), _t('默认为7-20,24小时格式,按照格式(7-20)填写'));
_t('7-20'), _t('自动暗色时间段'), _t('24小时格式,按照格式默认(20-7)填写,开始时间-结束时间(包含)'));
$form->addInput($darkTime);

//自定义颜色
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function butterfly_swiper_injector_config() {
"object" == typeof _hmt && _hmt.push(["_trackPageview", window.location.pathname]),
"function" == typeof loadMeting && document.getElementsByClassName("aplayer").length && loadMeting(),
"object" == typeof Prism && Prism.highlightAll(), "object" == typeof preloader && preloader.endLoading()
coverShow()
// coverShow()
})),
document.addEventListener("pjax:error", e => {
// 404 === e.request.status && pjax.loadUrl("/404");
Expand Down
30 changes: 20 additions & 10 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,13 @@ function getGravatar($email, $name, $comments_a, $s = 96, $d = 'mp', $r = 'g')
}
$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);
// if (isset($str1[1])) {
// $str2 = explode('&t=', $str1[1]);
// $k = $str2[0];
// $db->query($db->update('table.comments')->rows(array('qqk' => $k))->where('mail=?', $email));
// }
$geturl = 'http://qqk.wehao.org/?uin=' . $qquser;
$qqurl = file_get_contents($geturl);
$json = json_decode($qqurl, true);
if (isset($json['code']) && $json['code'] == 200) {
$k = $json['k'].'&kti='.$json['kti'];
$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';
Expand Down Expand Up @@ -835,6 +834,17 @@ function get_post_view($archive)
}
echo $exist == 0 ? '0' : ' ' . $exist;
}

function only_get_post_view($archive)
{
$db = Typecho_Db::get();
$cid = $archive->cid;
if (!array_key_exists('views', $db->fetchRow($db->select()->from('table.contents')))) {
$db->query('ALTER TABLE `' . $db->getPrefix() . 'contents` ADD `views` INT(10) DEFAULT 0;');
}
$exist = $db->fetchRow($db->select('views')->from('table.contents')->where('cid = ?', $cid))['views'];
echo $exist == 0 ? '0' : ' ' . $exist;
}
//总访问量
function theAllViews()
{
Expand Down Expand Up @@ -1180,8 +1190,8 @@ function cdnBaseUrl(){
function darkTimeFunc(){
$time = Helper::options()->darkTime;
if(empty($time)){
$time = "7-20";
$time = "20-7";
}
$timeSlot = explode('-', $time);
echo "e <= $timeSlot[0] || e >= $timeSlot[1]";
echo "e >= $timeSlot[0] || e <= $timeSlot[1]";
}
3 changes: 2 additions & 1 deletion header.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php $this->need('header_com.php'); ?>
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('header_com.php'); ?>
<body style="zoom: 1;">
<div id="web_bg"></div>
<div class="page" id="body-wrap">
Expand Down
9 changes: 7 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* <a href="https://www.wehaox.com">个人网站</a> | <a href="https://blog.wehaox.com/archives/typecho-butterfly.html">主题使用文档</a>
* @package Typecho-Butterfly
* @author b站:wehao-
* @version 1.7.9
* @version 1.7.10
* @link https://space.bilibili.com/34174433
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
Expand Down Expand Up @@ -115,6 +115,11 @@
<i class="fas fa-comments"></i>
<a class="twikoo-count" href="<?php $this->permalink() ?>#comments"><?php $this->commentsNum('0条评论', '1 条评论', '%d 条评论'); ?></a>
</span>
<span class="article-meta">
<span class="article-meta-separator">|</span>
<i class="far fa-eye fa-fw post-meta-icon"></i>
<span class="post-meta-label">阅读量:<?php only_get_post_view($this) ?></span>
</span>
</div>
<div class="content">
<?php summaryContent($this);
Expand Down Expand Up @@ -142,7 +147,7 @@ function ver() {console.log(`
# # # # # # # # # # # #
##### #### # # ###### # # # ###### #
1.7.9
1.7.10
===================================================================
`);}
</script>
Loading

0 comments on commit 0b0956a

Please sign in to comment.