mirror of
https://github.com/jkjoy/typecho-theme-farallon.git
synced 2026-06-28 05:34:26 +00:00
Compare commits
10 Commits
0.7.0
..
16e91b835e
| Author | SHA1 | Date | |
|---|---|---|---|
| 16e91b835e | |||
| 9671712412 | |||
| 4df85ae062 | |||
| a6883c5ce7 | |||
| 4dce3365b6 | |||
| 26e2c5b40c | |||
| c5eb0aa112 | |||
| cd3933ea53 | |||
| 482e9a1e93 | |||
| 13c3587762 |
@@ -6,6 +6,14 @@
|
||||
|
||||
|
||||
## 更新日志 & 预览
|
||||
### 0.7.2
|
||||
- 优化页面加载速度,自动裁切封面,并压缩为`webp`格式,并保存在主题目录`assets`-`images`-`covers`下,使用前必须开启`php`的`GD拓展`和主题目录的写入权限
|
||||
|
||||
### 0.7.1
|
||||
|
||||
- 调整了赞赏的样式,同时填写支付宝和微信收款码的图片地址即可显示
|
||||
- 调整文章列表的加载方式
|
||||
- 调整了文件的结构
|
||||
|
||||
### 0.7.0
|
||||
|
||||
|
||||
+3
-18
@@ -1,5 +1,5 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<header class="archive--header">
|
||||
<h2 class="post--single__title">
|
||||
<?php $this->archiveTitle(array(
|
||||
@@ -37,25 +37,10 @@ $memosId = is_numeric($memosId) ? intval($memosId) : null;
|
||||
<?php $this->need('module/postlist.php'); ?>
|
||||
<?php endif; ?>
|
||||
<!-- 分页导航 -->
|
||||
<?php $this->pageNav(
|
||||
' ',
|
||||
' ',
|
||||
1,
|
||||
'...',
|
||||
array(
|
||||
'wrapTag' => 'nav',
|
||||
'wrapClass' => 'nav-links nav-links__comment',
|
||||
'itemTag' => '',
|
||||
'textTag' => 'span',
|
||||
'itemClass' => 'page-numbers',
|
||||
'currentClass' => 'page-numbers current',
|
||||
'prevClass' => 'hidden',
|
||||
'nextClass' => 'hidden'
|
||||
)
|
||||
); ?>
|
||||
<?php $this->need('module/paging.php'); ?>
|
||||
<?php else: ?>
|
||||
<!-- 无结果 -->
|
||||
<?php $this->need('module/notfound.php'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php $this->need('module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
@@ -1,146 +0,0 @@
|
||||
.donate-panel {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.button--like {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
cursor: pointer;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.button--like:hover {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
.icon--default {
|
||||
fill: #666;
|
||||
transition: fill 0.3s ease;
|
||||
}
|
||||
|
||||
.button--like:hover .icon--default {
|
||||
fill: #ff4081;
|
||||
}
|
||||
|
||||
#qrcode-panel {
|
||||
position: absolute;
|
||||
bottom: 100%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
display: none;
|
||||
animation: fadeIn 0.3s ease;
|
||||
min-width: 240px;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translate(-50%, 10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
|
||||
.qrcode-body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.donate-memo {
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#donate-close {
|
||||
position: absolute;
|
||||
right: -5px;
|
||||
top: -5px;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
padding: 2px 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#donate-close:hover {
|
||||
color: #ff4081;
|
||||
}
|
||||
|
||||
.donate-qrpay img {
|
||||
max-width: 240px;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
/* 支付方式切换按钮样式 */
|
||||
.donate-methods {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 15px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.donate-method-btn {
|
||||
padding: 5px 15px;
|
||||
border: none;
|
||||
border-radius: 15px;
|
||||
cursor: pointer;
|
||||
background: #f5f5f5;
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.donate-method-btn.active {
|
||||
background: #ff4081;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.donate-method-btn:hover {
|
||||
background: #ff4081;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* QR码容器样式 */
|
||||
.qr-container {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.qr-image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.3s ease, visibility 0.3s ease;
|
||||
}
|
||||
|
||||
.qr-image.active {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* 小三角形 */
|
||||
#qrcode-panel:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -8px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
border-left: 8px solid transparent;
|
||||
border-right: 8px solid transparent;
|
||||
border-top: 8px solid white;
|
||||
}
|
||||
+2
-2
@@ -17,7 +17,7 @@
|
||||
is_single = false;
|
||||
post_id = 0;
|
||||
is_archive = false;
|
||||
VERSION = "0.7.0";
|
||||
VERSION = "0.7.2";
|
||||
constructor() {
|
||||
super();
|
||||
this.initCopyright();
|
||||
@@ -46,7 +46,7 @@
|
||||
}
|
||||
initCopyright() {
|
||||
const copyright = `<div class="site--footer__info">由<a href="https://www.typecho.org" target="_blank">Typecho</a> 驱动 <br>
|
||||
Theme <a href="https://fatesinger.com/101971" target="_blank">farallon</a> by bigfa <br>Made with<a href="https://www.imsun.org" target="_blank"> Sun</a> / version ${this.VERSION}
|
||||
Theme <a href="https://fatesinger.com/101971" target="_blank">farallon</a> by bigfa <br>Made with <a href="https://www.imsun.org" target="_blank">老孙博客</a> / version ${this.VERSION}
|
||||
</div>`;
|
||||
document.querySelector(".site--footer__content").insertAdjacentHTML("afterend", copyright);
|
||||
document.querySelector(".icon--copryrights").addEventListener("click", () => {
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const donateBtn = document.getElementById('donate-btn');
|
||||
const qrcodePanel = document.getElementById('qrcode-panel');
|
||||
const donateClose = document.getElementById('donate-close');
|
||||
const methodBtns = document.querySelectorAll('.donate-method-btn');
|
||||
const qrImages = document.querySelectorAll('.qr-image');
|
||||
let isVisible = false;
|
||||
|
||||
// 切换支付方式
|
||||
function switchPayMethod(method) {
|
||||
// 更新按钮状态
|
||||
methodBtns.forEach(btn => {
|
||||
btn.classList.remove('active');
|
||||
if (btn.dataset.method === method) {
|
||||
btn.classList.add('active');
|
||||
}
|
||||
});
|
||||
|
||||
// 更新二维码显示
|
||||
qrImages.forEach(img => {
|
||||
img.classList.remove('active');
|
||||
if (img.dataset.method === method) {
|
||||
img.classList.add('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 点击打赏按钮切换二维码显示状态
|
||||
function toggleQRCode(event) {
|
||||
event.stopPropagation();
|
||||
isVisible = !isVisible;
|
||||
qrcodePanel.style.display = isVisible ? 'block' : 'none';
|
||||
}
|
||||
|
||||
// 点击关闭按钮隐藏二维码
|
||||
function hideQRCode(event) {
|
||||
event.stopPropagation();
|
||||
isVisible = false;
|
||||
qrcodePanel.style.display = 'none';
|
||||
}
|
||||
|
||||
// 点击二维码面板之外的地方隐藏二维码
|
||||
function handleDocumentClick(event) {
|
||||
if (isVisible && !qrcodePanel.contains(event.target) && !donateBtn.contains(event.target)) {
|
||||
isVisible = false;
|
||||
qrcodePanel.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// 绑定事件监听器
|
||||
donateBtn.addEventListener('click', toggleQRCode);
|
||||
donateClose.addEventListener('click', hideQRCode);
|
||||
document.addEventListener('click', handleDocumentClick);
|
||||
|
||||
// 绑定支付方式切换按钮事件
|
||||
methodBtns.forEach(btn => {
|
||||
btn.addEventListener('click', (e) => {
|
||||
const method = e.target.dataset.method;
|
||||
switchPayMethod(method);
|
||||
});
|
||||
});
|
||||
|
||||
// 初始化显示第一个支付方式
|
||||
switchPayMethod('wechat');
|
||||
});
|
||||
+19
-14
@@ -1,13 +1,13 @@
|
||||
document.addEventListener('click', function (e) {
|
||||
// 检查点击的元素是否是 .post-read-more a
|
||||
// 检查点击的元素是否是 .loadmore a
|
||||
if (e.target.closest('.loadmore a')) {
|
||||
e.preventDefault();
|
||||
var btn = e.target.closest('.loadmore a');
|
||||
var nextPage = btn.getAttribute('href');
|
||||
var nextPage = btn.getAttribute('href');
|
||||
// 防止重复点击
|
||||
if (btn.classList.contains('loading')) return false;
|
||||
btn.classList.add('loading');
|
||||
btn.textContent = '加载中...';
|
||||
btn.textContent = '加载中...';
|
||||
// 发起 AJAX 请求
|
||||
fetch(nextPage)
|
||||
.then(response => {
|
||||
@@ -19,18 +19,23 @@ document.addEventListener('click', function (e) {
|
||||
.then(data => {
|
||||
// 创建一个临时的 DOM 元素来解析返回的 HTML
|
||||
var parser = new DOMParser();
|
||||
var htmlDoc = parser.parseFromString(data, 'text/html');
|
||||
// 找到新的文章
|
||||
var newPosts = htmlDoc.querySelectorAll('.post--item');
|
||||
// 找到新的"加载更多"按钮
|
||||
var newBtn = htmlDoc.querySelector('.nav-links a');
|
||||
// 获取文章列表容器和加载更多按钮
|
||||
var postReadMore = document.querySelector('.nav-links');
|
||||
var articleList = document.querySelector('.articleList');
|
||||
var htmlDoc = parser.parseFromString(data, 'text/html');
|
||||
// 调试代码:检查选择器
|
||||
console.log('Searching for #loadpost:', htmlDoc.querySelectorAll('#loadpost'));
|
||||
console.log('Searching for .nav-links:', htmlDoc.querySelector('.nav-links'));
|
||||
// 找到新的文章和按钮
|
||||
var newPosts = htmlDoc.querySelectorAll('#loadpost');
|
||||
var newBtn = htmlDoc.querySelector('.nav-links a');
|
||||
// 更健壮的元素选择
|
||||
var articleList = document.querySelector('#loadposts') ||
|
||||
document.querySelector('.posts-container') ||
|
||||
document.body;
|
||||
var postReadMore = document.querySelector('.nav-links');
|
||||
if (newPosts.length > 0) {
|
||||
newPosts.forEach(post => {
|
||||
articleList.insertBefore(post, postReadMore);
|
||||
});
|
||||
// 使用 appendChild 替代 insertBefore
|
||||
articleList.appendChild(post);
|
||||
});
|
||||
// 新文章淡入效果
|
||||
Array.from(newPosts).forEach(post => {
|
||||
post.style.opacity = 0;
|
||||
@@ -39,7 +44,7 @@ document.addEventListener('click', function (e) {
|
||||
post.style.opacity = 1;
|
||||
}, 10);
|
||||
});
|
||||
}
|
||||
}
|
||||
// 更新"加载更多"按钮或移除它
|
||||
if (newBtn) {
|
||||
btn.setAttribute('href', newBtn.getAttribute('href'));
|
||||
|
||||
+229
-27
@@ -24,23 +24,23 @@ function themeConfig($form) {
|
||||
$form->addInput($mastodonurl);
|
||||
$showProfile = new Typecho_Widget_Helper_Form_Element_Radio('showProfile',
|
||||
array('0'=> _t('否'), '1'=> _t('是')),
|
||||
'0', _t('是否在文章页面显示作者信息'), _t('选择“是”将在文章页面包含显示作者信息。'));
|
||||
'0', _t('是否在文章页面显示作者信息'), _t('选择"是"将在文章页面包含显示作者信息。'));
|
||||
$form->addInput($showProfile);
|
||||
$showcate = new Typecho_Widget_Helper_Form_Element_Radio('showcate',
|
||||
array('0'=> _t('否'), '1'=> _t('是')),
|
||||
'0', _t('是否在文章页面显示文章分类'), _t('选择“是”将在文章页面显示文章的分类信息。'));
|
||||
'0', _t('是否在文章页面显示文章分类'), _t('选择"是"将在文章页面显示文章的分类信息。'));
|
||||
$form->addInput($showcate);
|
||||
$showrelated = new Typecho_Widget_Helper_Form_Element_Radio('showrelated',
|
||||
array('0'=> _t('否'), '1'=> _t('是')),
|
||||
'0', _t('是否显示相关文章'), _t('选择“是”将在文章页面显示相关文章。'));
|
||||
'0', _t('是否显示相关文章'), _t('选择"是"将在文章页面显示相关文章。'));
|
||||
$form->addInput($showrelated);
|
||||
$showshare = new Typecho_Widget_Helper_Form_Element_Radio('showshare',
|
||||
array('0'=> _t('否'), '1'=> _t('是')),
|
||||
'0', _t('是否显示复制链接'), _t('选择“是”将在文章页面显示复制链接。'));
|
||||
'0', _t('是否显示复制链接'), _t('选择"是"将在文章页面显示复制链接。'));
|
||||
$form->addInput($showshare);
|
||||
$showtime = new Typecho_Widget_Helper_Form_Element_Radio('showtime',
|
||||
array('0'=> _t('否'), '1'=> _t('是')),
|
||||
'0', _t('是否显示页面加载时间'), _t('选择“是”将在页脚显示加载时间。'));
|
||||
'0', _t('是否显示页面加载时间'), _t('选择"是"将在页脚显示加载时间。'));
|
||||
$form->addInput($showtime);
|
||||
$loadmore = new Typecho_Widget_Helper_Form_Element_Radio('loadmore',
|
||||
array('0'=> _t('加载更多'), '1'=> _t('页码模式')),
|
||||
@@ -52,8 +52,10 @@ function themeConfig($form) {
|
||||
$form->addInput($cnavatar);
|
||||
$midimg = new Typecho_Widget_Helper_Form_Element_Text('midimg', NULL, '/img/', _t('填写分类图片路径,以"/"结尾'), _t('默认使用网站根目录下的img文件夹,也可以填写绝对或者CDN地址,自动匹配目录下以分类ID为文件名的mid.jpg格式的图片'));
|
||||
$form->addInput($midimg);
|
||||
$donate = new Typecho_Widget_Helper_Form_Element_Text('donate', NULL, NULL, _t('赞赏二维码'), _t('不填写则不显示'));
|
||||
$form->addInput($donate);
|
||||
$wxpay = new Typecho_Widget_Helper_Form_Element_Text('wxpay', NULL, 'https://blog.loliko.cn/images/wechatpay.png', _t('微信收款码'), _t('赞赏二维码'));
|
||||
$form->addInput($wxpay);
|
||||
$alipay= new Typecho_Widget_Helper_Form_Element_Text('alipay', NULL, 'https://blog.loliko.cn/images/alipay.png', _t('支付宝收款码'), _t('赞赏二维码'));
|
||||
$form->addInput($alipay);
|
||||
$addhead = new Typecho_Widget_Helper_Form_Element_Textarea('addhead', NULL, NULL, _t('Head内代码用于网站验证等'), _t('支持HTML'));
|
||||
$form->addInput($addhead);
|
||||
$tongji = new Typecho_Widget_Helper_Form_Element_Textarea('tongji', NULL, NULL, _t('统计代码'), _t('支持HTML'));
|
||||
@@ -71,18 +73,6 @@ function themeFields($layout) {
|
||||
$layout->addItem($summary);
|
||||
$cover= new Typecho_Widget_Helper_Form_Element_Text('cover', NULL, NULL, _t('文章封面'), _t('自定义文章封面'));
|
||||
$layout->addItem($cover);
|
||||
// $douban= new Typecho_Widget_Helper_Form_Element_Text('douban', NULL, NULL, _t('豆瓣API'), _t('自定义页面豆瓣API'));
|
||||
// $layout->addItem($douban);
|
||||
//$neodb= new Typecho_Widget_Helper_Form_Element_Text('neodb', NULL, NULL, _t('NeoDB API'), _t('自定义页面NeoDB API'));
|
||||
//$layout->addItem($neodb);
|
||||
// $tooot= new Typecho_Widget_Helper_Form_Element_Text('tooot', NULL, NULL, _t('Mastodon API'), _t('自定义页面Mastodon API'));
|
||||
// $layout->addItem($tooot);
|
||||
// $memos= new Typecho_Widget_Helper_Form_Element_Text('memos', NULL, NULL, _t('Memos地址'), _t(' 自定义页面Memos地址'));
|
||||
// $layout->addItem($memos);
|
||||
// $memosID= new Typecho_Widget_Helper_Form_Element_Text('memosID', NULL, NULL, _t('Memos ID'), _t('自定义页面Memos ID'));
|
||||
// $layout->addItem($memosID);
|
||||
// $memosnum= new Typecho_Widget_Helper_Form_Element_Text('memosnum', NULL, NULL, _t('Memos数量'), _t('自定义页面Memos数量'));
|
||||
// $layout->addItem($memosnum);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -121,6 +111,17 @@ $options = Typecho_Widget::widget('Widget_Options');
|
||||
$gravatarPrefix = empty($options->cnavatar) ? 'https://cravatar.cn/avatar/' : $options->cnavatar;
|
||||
define('__TYPECHO_GRAVATAR_PREFIX__', $gravatarPrefix);
|
||||
|
||||
// 初始化主题
|
||||
function init_theme() {
|
||||
// 检查并创建封面图片目录
|
||||
$coversDir = dirname(__FILE__) . '/assets/images/covers';
|
||||
if (!is_dir($coversDir)) {
|
||||
@mkdir($coversDir, 0755, true);
|
||||
}
|
||||
}
|
||||
// 在主题加载时执行初始化
|
||||
init_theme();
|
||||
|
||||
/**
|
||||
* 页面加载时间
|
||||
*/
|
||||
@@ -148,6 +149,19 @@ function timer_start() {
|
||||
*/
|
||||
function img_postthumb($cid) {
|
||||
$db = Typecho_Db::get();
|
||||
|
||||
// 首先检查是否设置了自定义封面
|
||||
$cover = $db->fetchRow($db->select('str_value')
|
||||
->from('table.fields')
|
||||
->where('cid = ?', $cid)
|
||||
->where('name = ?', 'cover'));
|
||||
|
||||
// 如果找到自定义封面,直接返回
|
||||
if ($cover && !empty($cover['str_value'])) {
|
||||
return $cover['str_value'];
|
||||
}
|
||||
|
||||
// 否则尝试从文章内容中获取第一张图片
|
||||
$rs = $db->fetchRow($db->select('table.contents.text')
|
||||
->from('table.contents')
|
||||
->where('table.contents.cid=?', $cid)
|
||||
@@ -178,8 +192,11 @@ function getPermalinkFromCoid($coid) {
|
||||
* 图片灯箱
|
||||
*/
|
||||
class ImageStructureProcessor {
|
||||
public static function processContent($content, $widget) {
|
||||
// 首先检查内容是否为空
|
||||
public static function processContent($content, $widget, $lastResult = null) {
|
||||
// 首先应用之前的过滤器结果
|
||||
$content = empty($lastResult) ? $content : $lastResult;
|
||||
|
||||
// 检查内容是否为空
|
||||
if (empty($content) || !is_string($content)) {
|
||||
return $content;
|
||||
}
|
||||
@@ -246,15 +263,130 @@ class ImageStructureProcessor {
|
||||
} catch (Exception $e) {
|
||||
// 记录错误但返回原始内容
|
||||
error_log('Image processing error: ' . $e->getMessage());
|
||||
return $content;
|
||||
// 如果发生错误,返回上一个过滤器结果或原始内容
|
||||
return empty($lastResult) ? $content : $lastResult;
|
||||
}
|
||||
}
|
||||
return $content;
|
||||
}
|
||||
}
|
||||
Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = function($content, $widget) {
|
||||
return ImageStructureProcessor::processContent($content, $widget);
|
||||
};
|
||||
// u6ce8u91cau6389u8fd9u884cuff0cu9632u6b62u8986u76d6u8fd9u4e2au94a9u5b50u7684u5176u4ed6u6ce8u518c
|
||||
// Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = function($content, $widget) {
|
||||
// return ImageStructureProcessor::processContent($content, $widget);
|
||||
// };
|
||||
|
||||
/**
|
||||
* 处理图片为封面图(裁剪为5:3,最大宽度500px,转换为webp)
|
||||
*
|
||||
* @param string $imageUrl 原始图片URL
|
||||
* @return string 处理后的图片URL
|
||||
*/
|
||||
function process_cover_image($imageUrl) {
|
||||
// 检查GD库是否可用
|
||||
if (!function_exists('imagecreatetruecolor')) {
|
||||
return $imageUrl; // 如果GD库不可用,返回原图
|
||||
}
|
||||
|
||||
// 分析URL
|
||||
$parsed = parse_url($imageUrl);
|
||||
|
||||
// 如果图片是外部链接,需要下载
|
||||
$isExternalUrl = !empty($parsed['host']) && $parsed['host'] !== $_SERVER['HTTP_HOST'];
|
||||
|
||||
// 生成唯一的文件名(使用MD5哈希)
|
||||
$filename = md5($imageUrl) . '.webp';
|
||||
|
||||
// 处理后图片的保存路径
|
||||
$themeDir = dirname(__FILE__);
|
||||
$savePath = $themeDir . '/assets/images/covers/' . $filename;
|
||||
$webPath = Helper::options()->themeUrl . '/assets/images/covers/' . $filename;
|
||||
|
||||
// 如果缓存文件已存在,直接返回
|
||||
if (file_exists($savePath)) {
|
||||
return $webPath;
|
||||
}
|
||||
|
||||
// 获取原始图片内容
|
||||
if ($isExternalUrl) {
|
||||
// 外部图片,需要下载
|
||||
$imageContent = @file_get_contents($imageUrl);
|
||||
if (!$imageContent) {
|
||||
return $imageUrl; // 无法下载,返回原图
|
||||
}
|
||||
} else {
|
||||
// 本地图片
|
||||
$localPath = $_SERVER['DOCUMENT_ROOT'] . $parsed['path'];
|
||||
if (!file_exists($localPath)) {
|
||||
return $imageUrl; // 无法找到本地文件,返回原图
|
||||
}
|
||||
$imageContent = @file_get_contents($localPath);
|
||||
}
|
||||
|
||||
// 创建图像资源
|
||||
$originalImage = @imagecreatefromstring($imageContent);
|
||||
if (!$originalImage) {
|
||||
return $imageUrl; // 无法创建图像资源,返回原图
|
||||
}
|
||||
|
||||
// 获取原始图片尺寸
|
||||
$originalWidth = imagesx($originalImage);
|
||||
$originalHeight = imagesy($originalImage);
|
||||
|
||||
// 计算目标尺寸(5:3比例,最大宽度500px)
|
||||
$targetWidth = min(500, $originalWidth);
|
||||
$targetHeight = intval($targetWidth * 3 / 5);
|
||||
|
||||
// 计算裁剪坐标(居中裁剪)
|
||||
$cropX = 0;
|
||||
$cropY = 0;
|
||||
$cropWidth = $originalWidth;
|
||||
$cropHeight = $originalHeight;
|
||||
|
||||
// 计算比例
|
||||
$originalRatio = $originalWidth / $originalHeight;
|
||||
$targetRatio = 5 / 3;
|
||||
|
||||
if ($originalRatio > $targetRatio) {
|
||||
// 原图过宽,需要裁剪宽度
|
||||
$cropWidth = intval($originalHeight * $targetRatio);
|
||||
$cropX = intval(($originalWidth - $cropWidth) / 2);
|
||||
} else {
|
||||
// 原图过高,需要裁剪高度
|
||||
$cropHeight = intval($originalWidth / $targetRatio);
|
||||
$cropY = intval(($originalHeight - $cropHeight) / 2);
|
||||
}
|
||||
|
||||
// 创建目标图像
|
||||
$targetImage = imagecreatetruecolor($targetWidth, $targetHeight);
|
||||
|
||||
// 裁剪并调整大小
|
||||
imagecopyresampled(
|
||||
$targetImage,
|
||||
$originalImage,
|
||||
0, 0,
|
||||
$cropX, $cropY,
|
||||
$targetWidth, $targetHeight,
|
||||
$cropWidth, $cropHeight
|
||||
);
|
||||
|
||||
// 保存为webp格式
|
||||
if (!function_exists('imagewebp')) {
|
||||
// 如果不支持webp,保存为png
|
||||
$filename = md5($imageUrl) . '.png';
|
||||
$savePath = $themeDir . '/assets/images/covers/' . $filename;
|
||||
$webPath = Helper::options()->themeUrl . '/assets/images/covers/' . $filename;
|
||||
imagepng($targetImage, $savePath, 9); // 9是最高压缩质量
|
||||
} else {
|
||||
// 保存为webp
|
||||
imagewebp($targetImage, $savePath, 80); // 80是质量参数
|
||||
}
|
||||
|
||||
// 释放资源
|
||||
imagedestroy($originalImage);
|
||||
imagedestroy($targetImage);
|
||||
|
||||
return $webPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* *获取文章卡片
|
||||
@@ -307,6 +439,9 @@ function get_article_info($atts) {
|
||||
$imageToDisplay = img_postthumb($post['cid']);
|
||||
if (empty($imageToDisplay)) {
|
||||
$imageToDisplay = $default_thumbnail;
|
||||
} else {
|
||||
// 处理封面图片
|
||||
$imageToDisplay = process_cover_image($imageToDisplay);
|
||||
}
|
||||
// 构建输出
|
||||
$output = '<div class="graph--mixtapeEmbed">';
|
||||
@@ -325,11 +460,16 @@ class ContentFilter
|
||||
{
|
||||
// 首先运行之前的过滤器结果
|
||||
$content = empty($lastResult) ? $content : $lastResult;
|
||||
|
||||
// 处理图片灯箱
|
||||
$content = ImageStructureProcessor::processContent($content, $widget, $content);
|
||||
|
||||
// 然后处理我们的文章短代码
|
||||
$content = preg_replace_callback('/\[article\s+([^\]]+)\]/', function($matches) {
|
||||
$atts = self::parse_atts($matches[1]);
|
||||
return get_article_info($atts);
|
||||
}, $content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
// 解析短代码属性
|
||||
@@ -387,8 +527,11 @@ EOF;
|
||||
}
|
||||
}
|
||||
// 注册编辑器按钮钩子
|
||||
Typecho_Plugin::factory('admin/write-post.php')->bottom = array('EditorButton', 'render');
|
||||
Typecho_Plugin::factory('admin/write-page.php')->bottom = array('EditorButton', 'render');
|
||||
// 避免重复注册,在最后执行
|
||||
if (!Typecho_Plugin::exists('Widget_Abstract_Contents', 'editor')) {
|
||||
Typecho_Plugin::factory('admin/write-post.php')->bottom = array('EditorButton', 'render');
|
||||
Typecho_Plugin::factory('admin/write-page.php')->bottom = array('EditorButton', 'render');
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论者认证等级 + 身份
|
||||
@@ -459,4 +602,63 @@ function commentApprove($widget, $email = NULL)
|
||||
$result['commentNum'] = $commentNum;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改附件插入功能
|
||||
*/
|
||||
// 添加批量插入按钮的JavaScript
|
||||
// 避免重复注册,使用条件判断
|
||||
if (!Typecho_Plugin::exists('admin/write-post.php', 'bottom')) {
|
||||
Typecho_Plugin::factory('admin/write-post.php')->bottom = array('MyHelper', 'addBatchInsertButton');
|
||||
Typecho_Plugin::factory('admin/write-page.php')->bottom = array('MyHelper', 'addBatchInsertButton');
|
||||
}
|
||||
|
||||
class MyHelper {
|
||||
public static function addBatchInsertButton() {
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// 添加批量插入按钮
|
||||
var batchButton = $('<button type="button" class="btn primary" id="batch-insert">批量插入所有附件</button>');
|
||||
$('#file-list').before(batchButton);
|
||||
|
||||
// 修改单个附件的插入格式
|
||||
Typecho.insertFileToEditor = function(title, url, isImage) {
|
||||
var textarea = $('#text'), sel = textarea.getSelection(),
|
||||
insertContent = isImage ? '' :
|
||||
'[' + title + '](' + url + ')';
|
||||
|
||||
textarea.replaceSelection(insertContent);
|
||||
textarea.focus();
|
||||
};
|
||||
|
||||
// 批量插入功能
|
||||
$('#batch-insert').click(function() {
|
||||
var content = '';
|
||||
$('#file-list li').each(function() {
|
||||
var $this = $(this),
|
||||
title = $this.find('.insert').text(),
|
||||
url = $this.data('url'),
|
||||
isImage = $this.data('image') == 1;
|
||||
|
||||
content += isImage ? '\n' :
|
||||
'[' + title + '](' + url + ')\n';
|
||||
});
|
||||
|
||||
var textarea = $('#text');
|
||||
var pos = textarea.getSelection();
|
||||
var newContent = textarea.val();
|
||||
if (pos.start === pos.end) {
|
||||
newContent = newContent.substring(0, pos.start) + content + newContent.substring(pos.start);
|
||||
} else {
|
||||
newContent = newContent.substring(0, pos.start) + content + newContent.substring(pos.end);
|
||||
}
|
||||
textarea.val(newContent);
|
||||
textarea.focus();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -55,10 +55,10 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div class="inner">
|
||||
<nav>
|
||||
<ul>
|
||||
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
|
||||
<?php while($pages->next()): ?>
|
||||
<li><a <?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a></li>
|
||||
<?php endwhile; ?>
|
||||
<?php $this->widget('Widget_Contents_Page_List')->to($pages); ?>
|
||||
<?php while($pages->next()): ?>
|
||||
<li><a <?php if($this->is('page', $pages->slug)): ?> class="current"<?php endif; ?> href="<?php $pages->permalink(); ?>" title="<?php $pages->title(); ?>"><?php $pages->title(); ?></a></li>
|
||||
<?php endwhile; ?>
|
||||
</ul>
|
||||
</nav>
|
||||
<!-- 这年头谁会用站内的搜索啊 -->
|
||||
@@ -77,4 +77,4 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
d="M20.067 18.933l-4.157-4.157a6 6 0 1 0-.884.884l4.157 4.157a.624.624 0 1 0 .884-.884zM6.5 11c0-2.62 2.13-4.75 4.75-4.75S16 8.38 16 11s-2.13 4.75-4.75 4.75S6.5 13.62 6.5 11z">
|
||||
</path>
|
||||
</svg>
|
||||
</header>
|
||||
</header>
|
||||
@@ -3,128 +3,16 @@
|
||||
* 一款单栏主题. 移植自HUGO主题 Farallon 原作者 bigfa
|
||||
* @package Farallon
|
||||
* @author 老孙
|
||||
* @version 0.7.0
|
||||
* @version 0.7.2
|
||||
* @link https://www.imsun.org
|
||||
*/
|
||||
// 确保退出安全
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
/** 文章置顶 */
|
||||
$sticky = $this->options->sticky; // 置顶的文章id,多个用|隔开
|
||||
$db = Typecho_Db::get();
|
||||
$pageSize = $this->options->pageSize;
|
||||
if ($sticky && !empty(trim($sticky))) {
|
||||
$sticky_cids = array_filter(explode('|', $sticky)); // 分割文本并过滤空值
|
||||
if (!empty($sticky_cids)) {
|
||||
$sticky_html = " <span class='sticky--post'> 置顶 </span> "; // 置顶标题的 html
|
||||
// 清空原有文章的队列
|
||||
$this->row = [];
|
||||
$this->stack = [];
|
||||
$this->length = 0;
|
||||
// 获取总数,并排除置顶文章数量
|
||||
if (isset($this->currentPage) && $this->currentPage == 1) {
|
||||
$totalOriginal = $this->getTotal();
|
||||
$stickyCount = count($sticky_cids);
|
||||
$this->setTotal(max($totalOriginal - $stickyCount, 0));
|
||||
// 构建置顶文章的查询
|
||||
$selectSticky = $this->select()->where('type = ?', 'post');
|
||||
foreach ($sticky_cids as $i => $cid) {
|
||||
if ($i == 0)
|
||||
$selectSticky->where('cid = ?', $cid);
|
||||
else
|
||||
$selectSticky->orWhere('cid = ?', $cid);
|
||||
}
|
||||
// 获取置顶文章
|
||||
$stickyPosts = $db->fetchAll($selectSticky);
|
||||
// 压入置顶文章到文章队列
|
||||
foreach ($stickyPosts as &$stickyPost) {
|
||||
$stickyPost['title'] .= $sticky_html;
|
||||
$this->push($stickyPost);
|
||||
}
|
||||
$standardPageSize = $pageSize - count($stickyPosts);
|
||||
} else {
|
||||
$standardPageSize = $pageSize;
|
||||
}
|
||||
// 构建正常文章查询,排除置顶文章
|
||||
$selectNormal = $this->select()
|
||||
->where('type = ?', 'post')
|
||||
->where('status = ?', 'publish')
|
||||
->where('created < ?', time())
|
||||
->order('created', Typecho_Db::SORT_DESC)
|
||||
->page(isset($this->currentPage) ? $this->currentPage : 1, $standardPageSize);
|
||||
foreach ($sticky_cids as $cid) {
|
||||
$selectNormal->where('table.contents.cid != ?', $cid);
|
||||
}
|
||||
} else {
|
||||
// 如果sticky_cids为空,使用默认查询
|
||||
$selectNormal = $this->select()
|
||||
->where('type = ?', 'post')
|
||||
->where('status = ?', 'publish')
|
||||
->where('created < ?', time())
|
||||
->order('created', Typecho_Db::SORT_DESC)
|
||||
->page(isset($this->currentPage) ? $this->currentPage : 1, $pageSize);
|
||||
}
|
||||
} else {
|
||||
// 如果没有置顶文章,使用默认查询
|
||||
$selectNormal = $this->select()
|
||||
->where('type = ?', 'post')
|
||||
->where('status = ?', 'publish')
|
||||
->where('created < ?', time())
|
||||
->order('created', Typecho_Db::SORT_DESC)
|
||||
->page(isset($this->currentPage) ? $this->currentPage : 1, $pageSize);
|
||||
}
|
||||
// 登录用户显示私密文章
|
||||
if ($this->user->hasLogin()) {
|
||||
$uid = $this->user->uid;
|
||||
if ($uid) {
|
||||
$selectNormal->orWhere('authorId = ? AND status = ?', $uid, 'private');
|
||||
}
|
||||
}
|
||||
$normalPosts = $db->fetchAll($selectNormal);
|
||||
// 如果之前没有清空队列(没有置顶文章的情况),现在清空
|
||||
if (empty($sticky) || empty(trim($sticky)) || empty($sticky_cids)) {
|
||||
$this->row = [];
|
||||
$this->stack = [];
|
||||
$this->length = 0;
|
||||
}
|
||||
// 压入正常文章到文章队列
|
||||
foreach ($normalPosts as $normalPost) {
|
||||
$this->push($normalPost);
|
||||
}
|
||||
?>
|
||||
<?php $this->need('module/header.php');?>
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('module/sticky.php'); ?>
|
||||
<?php $this->need('header.php');?>
|
||||
<main class="site--main">
|
||||
<div class="articleList">
|
||||
<?php $this->need('module/postlist.php'); ?>
|
||||
<?php if ($this->options->loadmore): ?>
|
||||
<?php
|
||||
$this->pageNav(
|
||||
' ',
|
||||
' ',
|
||||
1,
|
||||
'...',
|
||||
array(
|
||||
'wrapTag' => 'nav',
|
||||
'wrapClass' => 'nav-links nav-links__comment',
|
||||
'itemTag' => '',
|
||||
'textTag' => 'span',
|
||||
'itemClass' => 'page-numbers',
|
||||
'currentClass' => 'page-numbers current',
|
||||
'prevClass' => 'hidden',
|
||||
'nextClass' => 'hidden'
|
||||
)
|
||||
);
|
||||
?>
|
||||
<?php else:?>
|
||||
<?php
|
||||
$nextPage = $this->_currentPage + 1;
|
||||
$totalPages = ceil($this->getTotal() / $this->parameter->pageSize);
|
||||
if ($this->_currentPage < $totalPages): ?>
|
||||
<div class="nav-links">
|
||||
<span class="loadmore"><?php $this->pageLink('加载更多', 'next'); ?></span>
|
||||
<div class="articleList">
|
||||
<?php $this->need('module/postlist.php'); ?>
|
||||
<?php $this->need('module/paging.php'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/loadmore.js'); ?>"></script>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
<?php $this->need('module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
+4
-2
@@ -1,6 +1,7 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div id="loadposts">
|
||||
<?php while($this->next()): ?>
|
||||
<article class="post--item post--item__status" itemtype="http://schema.org/Article" itemscope="itemscope">
|
||||
<article id="loadpost" class="post--item post--item__status" itemtype="http://schema.org/Article" itemscope="itemscope">
|
||||
<div class="content">
|
||||
<header>
|
||||
<img src="<?php $this->options->logoUrl() ?>" class="avatar" width="48" height="48" />
|
||||
@@ -14,4 +15,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php if ($this->options->loadmore): ?>
|
||||
<?php
|
||||
$this->pageNav(
|
||||
' ',
|
||||
' ',
|
||||
1,
|
||||
'...',
|
||||
array(
|
||||
'wrapTag' => 'nav',
|
||||
'wrapClass' => 'nav-links nav-links__comment',
|
||||
'itemTag' => '',
|
||||
'textTag' => 'span',
|
||||
'itemClass' => 'page-numbers',
|
||||
'currentClass' => 'page-numbers current',
|
||||
'prevClass' => 'hidden',
|
||||
'nextClass' => 'hidden'
|
||||
)
|
||||
);
|
||||
?>
|
||||
<?php else:?>
|
||||
<?php
|
||||
$nextPage = $this->_currentPage + 1;
|
||||
$totalPages = ceil($this->getTotal() / $this->parameter->pageSize);
|
||||
if ($this->_currentPage < $totalPages):
|
||||
?>
|
||||
<div class="nav-links">
|
||||
<span class="loadmore"><?php $this->pageLink('加载更多', 'next'); ?></span>
|
||||
</div>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/loadmore.js'); ?>"></script>
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
+11
-6
@@ -1,10 +1,10 @@
|
||||
<div id="loadposts">
|
||||
<?php while($this->next()): ?>
|
||||
<?php
|
||||
// 获取当前文章的分类
|
||||
$categories = $this->categories;
|
||||
$memosMid = $this->options->memos; // 获取主题设置中的说说分类 mid
|
||||
$isMemos = false;
|
||||
|
||||
// 检查当前文章是否属于说说分类
|
||||
foreach ($categories as $category) {
|
||||
if ($category['mid'] == $memosMid) {
|
||||
@@ -12,26 +12,28 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 根据是否为说说分类使用不同的显示模板
|
||||
if ($isMemos):
|
||||
?>
|
||||
<div id="loadpost">
|
||||
<article class="post--item post--item__status" itemtype="http://schema.org/Article" itemscope="itemscope">
|
||||
<div class="content">
|
||||
<header>
|
||||
<img src="<?php $this->options->logoUrl() ?>" class="avatar" width="48" height="48" />
|
||||
<a datetime='<?php $this->date('Y-m-d'); ?>' class="humane--time" href="<?php $this->permalink() ?>"
|
||||
itemprop="datePublished">
|
||||
<?php $this->date('Y-m-d'); ?>
|
||||
<?php $this->date('Y-m-d H:i'); ?>
|
||||
</a>
|
||||
</header>
|
||||
<div class="description" itemprop="about">
|
||||
<?php $this->excerpt(200, '...'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</article>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<article class="post--item">
|
||||
<div id="loadpost">
|
||||
<article class="post--item" id="loadpost">
|
||||
<div class="content">
|
||||
<h2 class="post--title">
|
||||
<a href="<?php $this->permalink() ?>">
|
||||
@@ -73,11 +75,14 @@
|
||||
$cover = $this->fields->cover;
|
||||
$imageToDisplay = !empty($cover) ? $cover : $firstImage;
|
||||
if($imageToDisplay):
|
||||
$imageToDisplay = process_cover_image($imageToDisplay);
|
||||
?>
|
||||
<a href="<?php $this->permalink() ?>" class="cover--link">
|
||||
<img src="<?php echo $imageToDisplay; ?>" alt="<?php $this->title() ?>" class="cover" itemprop="image"/>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endwhile; ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
+3
-1
@@ -1,8 +1,9 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div class="related--content">
|
||||
<?php $this->related(6)->to($relatedPosts); ?>
|
||||
<?php if ($relatedPosts->have()): ?>
|
||||
<h3 class="related--posts__title">相关文章</h3>
|
||||
<div class="post--single__related">
|
||||
<?php $this->related(6)->to($relatedPosts); ?>
|
||||
<?php while ($relatedPosts->next()): ?>
|
||||
<div class="post--single__related__item">
|
||||
<a href="<?php $relatedPosts->permalink(); ?>">
|
||||
@@ -18,4 +19,5 @@
|
||||
</div>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php
|
||||
/** 文章置顶 */
|
||||
$sticky = $this->options->sticky; // 置顶的文章id,多个用|隔开
|
||||
$db = Typecho_Db::get();
|
||||
$pageSize = $this->options->pageSize;
|
||||
if ($sticky && !empty(trim($sticky))) {
|
||||
$sticky_cids = array_filter(explode('|', $sticky)); // 分割文本并过滤空值
|
||||
if (!empty($sticky_cids)) {
|
||||
$sticky_html = " <span class='sticky--post'> 置顶 </span> "; // 置顶标题的 html
|
||||
// 清空原有文章的队列
|
||||
$this->row = [];
|
||||
$this->stack = [];
|
||||
$this->length = 0;
|
||||
// 获取总数,并排除置顶文章数量
|
||||
if (isset($this->currentPage) && $this->currentPage == 1) {
|
||||
$totalOriginal = $this->getTotal();
|
||||
$stickyCount = count($sticky_cids);
|
||||
$this->setTotal(max($totalOriginal - $stickyCount, 0));
|
||||
// 构建置顶文章的查询
|
||||
$selectSticky = $this->select()->where('type = ?', 'post');
|
||||
foreach ($sticky_cids as $i => $cid) {
|
||||
if ($i == 0)
|
||||
$selectSticky->where('cid = ?', $cid);
|
||||
else
|
||||
$selectSticky->orWhere('cid = ?', $cid);
|
||||
}
|
||||
// 获取置顶文章
|
||||
$stickyPosts = $db->fetchAll($selectSticky);
|
||||
// 压入置顶文章到文章队列
|
||||
foreach ($stickyPosts as &$stickyPost) {
|
||||
$stickyPost['title'] .= $sticky_html;
|
||||
$this->push($stickyPost);
|
||||
}
|
||||
$standardPageSize = $pageSize - count($stickyPosts);
|
||||
} else {
|
||||
$standardPageSize = $pageSize;
|
||||
}
|
||||
// 构建正常文章查询,排除置顶文章
|
||||
$selectNormal = $this->select()
|
||||
->where('type = ?', 'post')
|
||||
->where('status = ?', 'publish')
|
||||
->where('created < ?', time())
|
||||
->order('created', Typecho_Db::SORT_DESC)
|
||||
->page(isset($this->currentPage) ? $this->currentPage : 1, $standardPageSize);
|
||||
foreach ($sticky_cids as $cid) {
|
||||
$selectNormal->where('table.contents.cid != ?', $cid);
|
||||
}
|
||||
} else {
|
||||
// 如果sticky_cids为空,使用默认查询
|
||||
$selectNormal = $this->select()
|
||||
->where('type = ?', 'post')
|
||||
->where('status = ?', 'publish')
|
||||
->where('created < ?', time())
|
||||
->order('created', Typecho_Db::SORT_DESC)
|
||||
->page(isset($this->currentPage) ? $this->currentPage : 1, $pageSize);
|
||||
}
|
||||
} else {
|
||||
// 如果没有置顶文章,使用默认查询
|
||||
$selectNormal = $this->select()
|
||||
->where('type = ?', 'post')
|
||||
->where('status = ?', 'publish')
|
||||
->where('created < ?', time())
|
||||
->order('created', Typecho_Db::SORT_DESC)
|
||||
->page(isset($this->currentPage) ? $this->currentPage : 1, $pageSize);
|
||||
}
|
||||
// 登录用户显示私密文章
|
||||
if ($this->user->hasLogin()) {
|
||||
$uid = $this->user->uid;
|
||||
if ($uid) {
|
||||
$selectNormal->orWhere('authorId = ? AND status = ?', $uid, 'private');
|
||||
}
|
||||
}
|
||||
$normalPosts = $db->fetchAll($selectNormal);
|
||||
// 如果之前没有清空队列(没有置顶文章的情况),现在清空
|
||||
if (empty($sticky) || empty(trim($sticky)) || empty($sticky_cids)) {
|
||||
$this->row = [];
|
||||
$this->stack = [];
|
||||
$this->length = 0;
|
||||
}
|
||||
// 压入正常文章到文章队列
|
||||
foreach ($normalPosts as $normalPost) {
|
||||
$this->push($normalPost);
|
||||
}
|
||||
?>
|
||||
+7
-3
@@ -1,5 +1,5 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<div class="post--cards">
|
||||
<div class="post--cards" id="loadposts">
|
||||
<?php while($this->next()): ?>
|
||||
<?php // 获取文章图片
|
||||
$default_thumbnail = Helper::options()->themeUrl . '/assets/images/nopic.svg';
|
||||
@@ -12,8 +12,11 @@
|
||||
if (empty($imageToDisplay)) {
|
||||
$imageToDisplay = $firstImage;
|
||||
}
|
||||
if (!empty($imageToDisplay) && $imageToDisplay != $default_thumbnail) {
|
||||
$imageToDisplay = process_cover_image($imageToDisplay);
|
||||
}
|
||||
?>
|
||||
<article class="post--card">
|
||||
<article class="post--card" id="loadpost" itemscope itemtype="http://schema.org/Article">
|
||||
<img src="<?php echo $imageToDisplay; ?>" alt="<?php $this->title() ?>" class="cover" itemprop="image"/>
|
||||
<div class="content">
|
||||
<h2 class="post--title">
|
||||
@@ -34,4 +37,5 @@
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<?php endwhile; ?>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<section class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -57,4 +57,4 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
?>
|
||||
</div>
|
||||
</section>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<div class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -33,4 +33,4 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php endwhile; ?>
|
||||
</section>
|
||||
</div>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<script src="<?php $this->options->themeUrl('assets/js/db.js'); ?>"></script>
|
||||
<section class="site--main">
|
||||
<header class="archive--header">
|
||||
@@ -28,4 +28,4 @@ new Douban({
|
||||
</script>
|
||||
</div>
|
||||
</section>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
+5
-39
@@ -5,20 +5,17 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
|
||||
$this->need('./module/header.php');
|
||||
$this->need('header.php');
|
||||
?>
|
||||
|
||||
<div class="site--main site--main__gears">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
</header>
|
||||
|
||||
<div id="goods" class="good--list">
|
||||
<?php
|
||||
// 获取内容并解析
|
||||
$content = $this->content;
|
||||
$goods = parseGoodsTable($content);
|
||||
|
||||
if (!empty($goods)) {
|
||||
foreach ($goods as $item): ?>
|
||||
<div class="good--item">
|
||||
@@ -44,31 +41,7 @@ $this->need('./module/header.php');
|
||||
<?php $this->need('./module/comments.php'); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.img40 {
|
||||
height: 137px;
|
||||
width: auto;
|
||||
object-fit: cover;
|
||||
}
|
||||
.img-spacer {
|
||||
width: 100%;
|
||||
aspect-ratio: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
.brand {
|
||||
font-weight: 500;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.no-goods {
|
||||
grid-column: 1 / -1;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>.img40{height:137px;width:auto;object-fit:cover;}.img-spacer{width:100%;aspect-ratio:1;overflow:hidden;}.brand{font-weight:500;margin-bottom:5px;}.no-goods{grid-column:1 / -1;text-align:center;padding:20px;background:#f5f5f5;border-radius:8px;}</style>
|
||||
<?php
|
||||
/**
|
||||
* 解析商品表格数据
|
||||
@@ -77,25 +50,20 @@ $this->need('./module/header.php');
|
||||
*/
|
||||
function parseGoodsTable($content) {
|
||||
$goods = array();
|
||||
|
||||
// 创建DOM对象
|
||||
$dom = new DOMDocument();
|
||||
libxml_use_internal_errors(true); // 禁用libxml错误
|
||||
$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
|
||||
libxml_clear_errors();
|
||||
|
||||
// 查找表格
|
||||
$tables = $dom->getElementsByTagName('table');
|
||||
|
||||
if ($tables->length > 0) {
|
||||
$table = $tables->item(0); // 获取第一个表格
|
||||
$rows = $table->getElementsByTagName('tr');
|
||||
|
||||
$rows = $table->getElementsByTagName('tr');
|
||||
// 跳过表头行
|
||||
for ($i = 1; $i < $rows->length; $i++) {
|
||||
$row = $rows->item($i);
|
||||
$cells = $row->getElementsByTagName('td');
|
||||
|
||||
$cells = $row->getElementsByTagName('td');
|
||||
// 确保有足够的单元格
|
||||
if ($cells->length >= 5) {
|
||||
$item = array(
|
||||
@@ -113,9 +81,7 @@ function parseGoodsTable($content) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $goods;
|
||||
}
|
||||
|
||||
$this->need('./module/footer.php');
|
||||
$this->need('footer.php');
|
||||
?>
|
||||
+4
-8
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<section class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -13,17 +13,13 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
</header>
|
||||
<div class="template--linksWrap">
|
||||
<ul class="link-items">
|
||||
<?php
|
||||
Links_Plugin::output('<li class="link-item"><a class="link-item-inner effect-apollo" href="{url}" target="_blank">
|
||||
<span class="sitename"><strong>{name}</strong>{title}</span>
|
||||
</a></li>');
|
||||
?>
|
||||
<?php Links_Plugin::output('<li class="link-item"><a class="link-item-inner effect-apollo" href="{url}" target="_blank"><span class="sitename"><strong>{name}</strong>{title}</span></a></li>'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<article class="post--single">
|
||||
<?php if ($this->allow('comment')): ?>
|
||||
<?php $this->need('./module/comments.php'); ?>
|
||||
<?php $this->need('module/comments.php'); ?>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
</section>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<div class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -148,4 +148,4 @@ img {
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
|
||||
+3
-9
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<div class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -16,7 +16,7 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
$memos = $this->fields->memos ? $this->fields->memos : 'https://memos.imsun.org';
|
||||
$memosID = $this->fields->memosID ? $this->fields->memosID : '1';
|
||||
$memosnum = $this->fields->memosnum ? $this->fields->memosnum : '20';
|
||||
?>
|
||||
?>
|
||||
<article class="post--single">
|
||||
<script src="<?php $this->options->themeUrl('assets/js/marked.min.js'); ?>"></script>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/lightbox.min.css'); ?>">
|
||||
@@ -32,7 +32,6 @@ const limit = 10; // 每页条数
|
||||
let url = '<?php echo $memos; ?>';
|
||||
let memosID = '<?php echo $memosID; ?>';
|
||||
let memosnum = '<?php echo $memosnum; ?>';
|
||||
|
||||
function loadMemos(page) {
|
||||
fetch(`${url}/api/v1/memo?creatorId=${memosID}&rowStatus=NORMAL&limit=${limit}&offset=${(page - 1) * limit}`)
|
||||
.then(res => res.json())
|
||||
@@ -64,7 +63,6 @@ function loadMemos(page) {
|
||||
// 这里可以添加一些用户提示错误发生的 HTML 更新
|
||||
});
|
||||
}
|
||||
|
||||
function Format(item) {
|
||||
let date = getTime(new Date(item.createdTs * 1000).toString()),
|
||||
content = item.content,
|
||||
@@ -94,7 +92,6 @@ function Format(item) {
|
||||
text: text.replace(/\[(.*?)\]\((.*?)\)/g, '[链接]' + `${imgs?'[图片]':''}`)
|
||||
}
|
||||
}
|
||||
|
||||
// 页面时间格式化
|
||||
function getTime(time) {
|
||||
let d = new Date(time),
|
||||
@@ -105,16 +102,13 @@ function getTime(time) {
|
||||
if (new Date().getFullYear() == ls[0]) return ls[1] + '月' + ls[2] + '日 ' + ls[3] +':'+ ls[4]
|
||||
else return ls[0] + '年' + ls[1] + '月' + ls[2] + '日 ' + ls[3] +':'+ ls[4]
|
||||
}
|
||||
|
||||
// 初始加载第一页
|
||||
loadMemos(currentPage);
|
||||
|
||||
// 点击“加载更多”按钮时加载下一页
|
||||
document.getElementById('loadmore').addEventListener('click', function() {
|
||||
currentPage++;
|
||||
loadMemos(currentPage);
|
||||
});
|
||||
|
||||
</script>
|
||||
<style>
|
||||
div pre code {
|
||||
@@ -169,4 +163,4 @@ img {
|
||||
}
|
||||
</style>
|
||||
</div>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
|
||||
+11
-11
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/neodb.css'); ?>">
|
||||
<script src="<?php $this->options->themeUrl('assets/js/neodb.js'); ?>"></script>
|
||||
<section class="site--main">
|
||||
@@ -15,14 +15,14 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
</header>
|
||||
<div class="site--main">
|
||||
<div class="neodb-container"></div>
|
||||
<?php $neodb = $this->fields->neodb ? $this->fields->neodb : 'https://neodb.imsun.org'; ?>
|
||||
<script>
|
||||
const neodb = new NeoDB({
|
||||
container: ".neodb-container",
|
||||
baseAPI: "<?php echo $neodb; ?>/api",
|
||||
types: ["book", "movie", "tv", "music", "game"],
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<?php $neodb = $this->fields->neodb ? $this->fields->neodb : 'https://neodb.imsun.org'; ?>
|
||||
<script>
|
||||
const neodb = new NeoDB({
|
||||
container: ".neodb-container",
|
||||
baseAPI: "<?php echo $neodb; ?>/api",
|
||||
types: ["book", "movie", "tv", "music", "game"],
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</section>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
* @package custom
|
||||
*/
|
||||
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<section class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -30,4 +30,4 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
<?php $this->need('./module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
@@ -1,5 +1,5 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('./module/header.php'); ?>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<section class="site--main">
|
||||
<header class="archive--header">
|
||||
<h1 class="post--single__title"><?php $this->title() ?></h1>
|
||||
@@ -14,5 +14,5 @@
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
</section>
|
||||
<?php $this->need('module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
|
||||
<?php $this->need('module/header.php'); ?>
|
||||
<style>
|
||||
#toc {font-size:14px;padding:10px 15px;background-color:var(--farallon-background-gray);border-radius:10px;margin-bottom:20px}
|
||||
#toc summary{cursor:pointer}
|
||||
#toc toc-title{font-weight:600}
|
||||
#toc ul{padding-left:10px;margin-bottom:10px}
|
||||
#toc ul li::before{content:"·";margin-right:5px}
|
||||
#toc ul li>ul{margin-left:10px;font-size:12px}
|
||||
</style>
|
||||
<?php $this->need('header.php'); ?>
|
||||
<style>#toc{font-size:14px;padding:10px 15px;background-color:var(--farallon-background-gray);border-radius:10px;margin-bottom:20px}#toc summary{cursor:pointer}#toc toc-title{font-weight:600}#toc ul{padding-left:10px;margin-bottom:10px}#toc ul li::before{content:"·";margin-right:5px}#toc ul li>ul{margin-left:10px;font-size:12px}</style>
|
||||
<main class="site--main">
|
||||
<article class="post--single">
|
||||
<ul class="meta">
|
||||
@@ -45,33 +38,24 @@
|
||||
</div>
|
||||
<h2 class="post--single__title"><?php $this->title() ?></h2>
|
||||
<div class="post--single__content graph" ><?php $this->content(); ?></div>
|
||||
<?php if($this->options->donate): ?>
|
||||
<?php if($this->options->wxpay): ?>
|
||||
<!--打赏 -->
|
||||
<div class="post--single__action">
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/donate.css'); ?>">
|
||||
<script type="text/javascript" src="<?php $this->options->themeUrl('assets/js/donate.js'); ?>"></script>
|
||||
<div class="donate-panel">
|
||||
<div id="donate-btn">
|
||||
<button class="button--like">
|
||||
<svg class="icon--default" viewBox="0 0 1024 1024" width="32" height="32">
|
||||
<path
|
||||
d="M332.8 249.6c38.4 0 83.2 19.2 108.8 44.8L467.2 320 512 364.8 556.8 320l25.6-25.6c32-32 70.4-44.8 108.8-44.8 19.2 0 38.4 6.4 57.6 12.8 44.8 25.6 70.4 57.6 76.8 108.8 6.4 44.8-6.4 89.6-38.4 121.6L512 774.4 236.8 492.8C204.8 460.8 185.6 416 192 371.2c6.4-44.8 38.4-83.2 76.8-108.8C288 256 313.6 249.6 332.8 249.6L332.8 249.6M332.8 185.6C300.8 185.6 268.8 192 243.2 204.8 108.8 275.2 89.6 441.6 185.6 537.6l281.6 281.6C480 832 499.2 838.4 512 838.4s32-6.4 38.4-19.2l281.6-281.6c96-96 76.8-262.4-57.6-332.8-25.6-12.8-57.6-19.2-89.6-19.2-57.6 0-115.2 25.6-153.6 64L512 275.2 486.4 249.6C448 211.2 390.4 185.6 332.8 185.6L332.8 185.6z">
|
||||
</path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div id="qrcode-panel" style="display: none;">
|
||||
<div class="qrcode-body">
|
||||
<div class="hidden">
|
||||
<span id="donate-close">关闭</span>
|
||||
</div>
|
||||
<div class="donate-qrpay">
|
||||
<img id="wxqr" src="<?php $this->options->donate() ?>" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="button--like" onclick="openModal()">
|
||||
<svg class="icon--default" viewBox="0 0 1024 1024" width="32" height="32"><path d="M332.8 249.6c38.4 0 83.2 19.2 108.8 44.8L467.2 320 512 364.8 556.8 320l25.6-25.6c32-32 70.4-44.8 108.8-44.8 19.2 0 38.4 6.4 57.6 12.8 44.8 25.6 70.4 57.6 76.8 108.8 6.4 44.8-6.4 89.6-38.4 121.6L512 774.4 236.8 492.8C204.8 460.8 185.6 416 192 371.2c6.4-44.8 38.4-83.2 76.8-108.8C288 256 313.6 249.6 332.8 249.6L332.8 249.6M332.8 185.6C300.8 185.6 268.8 192 243.2 204.8 108.8 275.2 89.6 441.6 185.6 537.6l281.6 281.6C480 832 499.2 838.4 512 838.4s32-6.4 38.4-19.2l281.6-281.6c96-96 76.8-262.4-57.6-332.8-25.6-12.8-57.6-19.2-89.6-19.2-57.6 0-115.2 25.6-153.6 64L512 275.2 486.4 249.6C448 211.2 390.4 185.6 332.8 185.6L332.8 185.6z"></path></svg>
|
||||
</button>
|
||||
</div>
|
||||
<!-- 弹窗 -->
|
||||
<div class="modal" id="modal" onclick="closeModal()">
|
||||
<div class="modal-content" onclick="event.stopPropagation()">
|
||||
<span class="close-btn" onclick="closeModal()">×</span>
|
||||
<p>如果觉得文章对你有帮助,可以请作者喝杯咖啡 ☕️</p>
|
||||
<img src="<?php $this->options->wxpay() ?>" alt="微信二维码">
|
||||
<img src="<?php $this->options->alipay() ?>" alt="支付宝二维码">
|
||||
</div>
|
||||
</div>
|
||||
<script>function openModal(){document.getElementById('modal').style.display='flex'}function closeModal(){document.getElementById('modal').style.display='none'}</script>
|
||||
<style>.button--like{background:none;border:none;padding:0;cursor:pointer;transition:transform 0.3s ease;}.button--like:hover{transform:scale(1.1);}.icon--default{fill:#666;transition:fill 0.3s ease;}.button--like:hover .icon--default{fill:#ff4081;}.modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0,0,0,0.1);justify-content:center;align-items:center;z-index:1000;}.modal-content{background-color:white;padding:20px;border-radius:10px;text-align:center;position:relative;}.modal-content img{width:200px;height:200px;margin-top:10px;}.close-btn{position:absolute;top:10px;right:10px;cursor:pointer;font-size:20px;color:#888;}</style>
|
||||
<?php endif; ?>
|
||||
<!-- 复制链接 -->
|
||||
<?php if($this->options->showshare): ?>
|
||||
@@ -126,7 +110,7 @@
|
||||
<?php $this->need('module/related.php'); ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($this->allow('comment')): ?>
|
||||
<?php $this->need('./module/comments.php'); ?>
|
||||
<?php $this->need('module/comments.php'); ?>
|
||||
<?php endif; ?>
|
||||
<!--翻页-->
|
||||
<nav class="navigation post-navigation is-active">
|
||||
@@ -145,4 +129,4 @@
|
||||
<script src="<?php $this->options->themeUrl('assets/js/post.js'); ?>"></script>
|
||||
<link rel="stylesheet" href="<?php $this->options->themeUrl('assets/css/lightbox.min.css'); ?>">
|
||||
<script src="<?php $this->options->themeUrl('assets/js/lightbox-plus-jquery.min.js'); ?>"></script>
|
||||
<?php $this->need('module/footer.php'); ?>
|
||||
<?php $this->need('footer.php'); ?>
|
||||
Reference in New Issue
Block a user