4 Commits

Author SHA1 Message Date
浪子 8afb1934dd 1.2.1 2025-07-19 11:11:55 +08:00
浪子 b73e465a79 1.2.0 2025-07-19 10:09:34 +08:00
浪子 ae990a722b 1.2.1 2025-07-12 08:24:51 +08:00
浪子 35806ea2fb 1.2.0 2025-07-11 19:16:34 +08:00
4 changed files with 31 additions and 31 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ $coverImage = getPostCover($this->content, $this->cid);
'wrapClass' => 'pagination comment-ajax-load',
'itemTag' => 'li',
'textTag' => 'span',
'currentClass' => 'active',
'currentClass' => 'cur',
'prevClass' => 'prev',
'nextClass' => 'next'
)); ?>
+3 -3
View File
@@ -43,9 +43,9 @@
<div>
<?php if(!$this->user->hasLogin()): ?>
<div class="d-inline-block">
<a class="btn btn-primary btn-ssm" href="<?php $this->options->loginUrl(); ?>" title="登录" target="_blank">
<i class="fa fa-right-to-bracket"></i>&nbsp;登录
</a>
<button class="btn btn-primary btn-ssm pk-modal-toggle" type="button" data-once-load="true" data-id="front-login" title="快捷登录" data-url="<?php echo get_correct_url('/login/'); ?>">
<i class="fa fa-right-to-bracket"></i>&nbsp;快捷登录
</button>
</div>
<?php endif; ?>
</div>
+26 -26
View File
@@ -997,10 +997,10 @@ function get_article_info($atts) {
return '未找到文章';
}
// 获取文章对象,避免permalink警告
$widget = Typecho_Widget::widget('Widget_Archive@article_quote_' . $post['cid'], 'cid=' . $post['cid'], null, false);
$permalink = $widget->permalink;
$title = htmlspecialchars($widget->title);
$summary = get_article_summary($widget);
$post = Typecho_Widget::widget('Widget_Abstract_Contents')->push($post);
$permalink = $post['permalink'];
$title = htmlspecialchars($post['title']);
$summary = get_article_summary($post);
$output = '<blockquote class="article-quote">';
$output .= '<div class="t-lg t-line-1">';
@@ -1374,25 +1374,25 @@ function get_site_statistics() {
}
// Typecho AJAX 登录接口,支持前端 AJAX 提交并返回 JSON
if (!empty($_GET['ajaxLogin']) && $_GET['ajaxLogin'] == 1) {
header('Content-Type: application/json; charset=utf-8');
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
echo json_encode(['success' => false, 'msg' => '请求方式错误']);
exit;
}
$name = isset($_POST['name']) ? trim($_POST['name']) : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$referer = isset($_POST['referer']) ? $_POST['referer'] : '/';
if (!$name || !$password) {
echo json_encode(['success' => false, 'msg' => '用户名或密码不能为空']);
exit;
}
$user = Typecho_Widget::widget('Widget_User');
try {
$user->login($name, $password, isset($_POST['remember']) ? 1 : 0);
echo json_encode(['success' => true, 'msg' => '登录成功', 'redirect' => $referer]);
} catch (Typecho_Exception $e) {
echo json_encode(['success' => false, 'msg' => $e->getMessage()]);
}
exit;
}
//if (!empty($_GET['ajaxLogin']) && $_GET['ajaxLogin'] == 1) {
// header('Content-Type: application/json; charset=utf-8');
// if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
// echo json_encode(['success' => false, 'msg' => '请求方式错误']);
// exit;
// }
// $name = isset($_POST['name']) ? trim($_POST['name']) : '';
// $password = isset($_POST['password']) ? $_POST['password'] : '';
// $referer = isset($_POST['referer']) ? $_POST['referer'] : '/';
// if (!$name || !$password) {
// echo json_encode(['success' => false, 'msg' => '用户名或密码不能为空']);
// exit;
// }
// $user = Typecho_Widget::widget('Widget_User');
// try {
// $user->login($name, $password, isset($_POST['remember']) ? 1 : 0);
// echo json_encode(['success' => true, 'msg' => '登录成功', 'redirect' => $referer]);
// } catch (Typecho_Exception $e) {
// echo json_encode(['success' => false, 'msg' => $e->getMessage()]);
// }
// exit;
//}
+1 -1
View File
@@ -75,7 +75,7 @@
</li>
<?php \Widget\Contents\Page\Rows::alloc()->to($pages); ?>
<?php while ($pages->next()): ?>
<li <?php if ($this->is('page', $pages->slug)): ?> class='current-menu-item current_page_item menu-current<?php endif; ?> menu-item menu-item-type-post_type menu-item-object-page '>
<li class="menu-item menu-item-type-post_type menu-item-object-page<?php if ($this->is('page', $pages->slug)) echo ' current-menu-item current_page_item menu-current'; ?>">
<a class='ww'
href="<?php $pages->permalink(); ?>"
title="<?php $pages->title(); ?>">