mirror of
https://github.com/jkjoy/Typecho-Theme-Puock.git
synced 2026-08-12 23:09:02 +00:00
Compare commits
4 Commits
3bb53afcea
...
1.2.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 8afb1934dd | |||
| b73e465a79 | |||
| ae990a722b | |||
| 35806ea2fb |
+1
-1
@@ -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
@@ -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> 登录
|
||||
</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> 快捷登录
|
||||
</button>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
+26
-26
@@ -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
@@ -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(); ?>">
|
||||
|
||||
Reference in New Issue
Block a user