From 8f8b2e405fc87fab42eab48bd3f16d19d247a739 Mon Sep 17 00:00:00 2001 From: Kraity Date: Wed, 18 Aug 2021 17:08:45 +0800 Subject: [PATCH] fixed comment issues in pjax --- comments.php | 36 ++++++++++++++++- footer.php | 2 +- functions.php | 91 ++++++++--------------------------------- header.php | 6 +-- index.php | 4 +- script.js | 109 +++++++++++++++++++++++++++++++++++++++++++++++++- style.css | 27 ++++++++----- 7 files changed, 179 insertions(+), 96 deletions(-) diff --git a/comments.php b/comments.php index 8acc2a0..f096226 100644 --- a/comments.php +++ b/comments.php @@ -1,6 +1,5 @@
- comments()->to($comments); ?> allow('comment')): ?>
@@ -43,11 +42,44 @@
+ have()): ?>
- listComments(); ?> + listComments([ + 'avatarSize' => 64 + ]); ?>
pageNav('« 前一页', '后一页 »'); ?> + options->plugins['activated']['Links'])) : + $links = $this->db->fetchAll($this->db->select()->from('table.links')); + $friends = array(); + $relations = array(); + foreach ($links as $link) { + if (!empty($link['mail'])) { + $friends[] = md5($link['mail']); + } + } + foreach (explode("\n", $this->options->plugin('Links')->relations) as $mail) { + if (!empty($mail = trim($mail))) { + $relations[] = md5($mail); + } + } + unset($links); ?> + +
diff --git a/footer.php b/footer.php index 2ef3e23..32b7b6a 100644 --- a/footer.php +++ b/footer.php @@ -1,7 +1,7 @@ - + diff --git a/functions.php b/functions.php index afef5b3..ceede76 100644 --- a/functions.php +++ b/functions.php @@ -142,81 +142,22 @@ function lazyload_filter($html) } /** - * @param $archive + * @param $requestUri + * @return string */ -function fixPjaxComment($archive) +function pjax_url_filter($requestUri) { - echo " - "; + $parts = parse_url($requestUri); + + if (isset($parts['query'])) { + parse_str($parts['query'], $args); + + if (isset($args['_pjax'])) { + unset($args['_pjax']); + $parts['query'] = $args ? http_build_query($args) : NULL; + return Typecho_Common::buildUrl($parts); + } + } + + return $requestUri; } \ No newline at end of file diff --git a/header.php b/header.php index 5114182..417ee50 100644 --- a/header.php +++ b/header.php @@ -13,7 +13,7 @@ 'tag' => _t('标签 %s 下的文章'), 'author' => _t('%s 发布的文章') ), '', ' - '); ?>options->title(); ?> - + @@ -22,7 +22,7 @@ - + - header("pingback=&wlw=&xmlrpc=&rss2=&atom=&rss1=&template=&generator="); ?> + header("pingback=&wlw=&xmlrpc=&rss2=&atom=&rss1=&template=&generator=&antiSpam=&commentReply="); ?>