From d52291c9465b408ba883b75f0e0f3400085451df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90?= Date: Sat, 18 May 2024 09:24:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86=E4=B8=8E?= =?UTF-8?q?=E5=8E=9F=E7=89=88=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 +++++++-- archive.php | 82 +++++++++++++++++++++++++-------------------- comments.php | 50 ++++++++++++++++++++++----- functions.php | 1 + header.php | 1 - page-archives.php | 24 ++++++------- page-categories.php | 24 ++++++------- page-douban.php | 4 +-- post.php | 74 +++++++++++++++++++--------------------- postlist.php | 33 +++++++++--------- 10 files changed, 180 insertions(+), 129 deletions(-) diff --git a/README.md b/README.md index 9adda90..34b7dfc 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,17 @@ https://github.com/bigfa/hugo-theme-farallon ## 进度 -70% +80% + +## 功能 + +### 豆瓣观影 +配合`DoubanBoard`插件使用 +项目地址 +https://github.com/AlanDecode/Typecho-Plugin-DoubanBoard +!!记得重命名文件夹为`DoubanBoard` + +### 友情链接 +基于 `links` 插件实现 +可使用 `寒泥` 大佬制作的版本或者其他版本 -## 待实现 --[] 豆瓣观影 diff --git a/archive.php b/archive.php index 7e112a5..bf9b6b5 100644 --- a/archive.php +++ b/archive.php @@ -1,9 +1,7 @@ need('header.php'); ?> -
-
- have()): ?> -
+
+
have()): ?>

archiveTitle(array( 'category' => _t(' %s '), 'search' => _t('包含关键字 %s 的文章'), @@ -12,29 +10,27 @@ 'author' => _t('作者 %s 发布的文章') ), '', ''); ?>

categorydescription(); ?>

-
next()): ?> - -
+
+ +
-

- title() ?> - - - - +

+ title() ?>

+
+ fields->summary){echo $this->fields->summary;} else {$this->excerpt(180); } + ?> +
- - + @@ -45,26 +41,40 @@ d="M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01zm8.005-6c-3.317 0-6.005 2.69-6.005 6 0 3.37 2.77 6.08 6.138 6.01l.351-.01h1.761v2.3l5.087-2.81c1.951-1.08 3.163-3.13 3.163-5.36 0-3.39-2.744-6.13-6.129-6.13H9.756z"> - - commentsNum('评论', '1 评论', '%d 评论'); ?> -
-
- excerpt(180); ?> -
- - + commentsNum('评论', '1 评论', '%d 评论'); ?> +
+
+ + +
+ pagenav( + '', + '', + 1, + '...', + array( + 'wrapTag' => 'div', + 'wrapClass' => 'cat_pagination_page', + 'itemTag' => '', + 'textTag' => 'a', + 'currentClass' => 'active', + 'prevClass' => 'prev', + 'nextClass' => 'next' + ) + ); + ?> + + +
- - +

Sorry

+

很遗憾,未找到您期待的内容

+ + +
+ - - need('footer.php'); ?> \ No newline at end of file diff --git a/comments.php b/comments.php index f867ac2..5c9f500 100644 --- a/comments.php +++ b/comments.php @@ -1,5 +1,4 @@ -
comments()->to($comments); ?> @@ -22,11 +21,48 @@ commentsNum(_t('暂无评论'), _t('仅有 1 条评论'), _t('已有 %d 条评论')); ?> have()): ?> - - -
listComments(); ?> - + authorId) { + if ($comments->authorId == $comments->ownerId) { + $commentClass .= ' comment-by-author'; + } else { + $commentClass .= ' comment-by-user'; + } + } + + $commentLevelClass = $comments->levels > 0 ? ' comment-child' : ' comment-parent'; +?> +
  • +
    +
    + gravatar('40', ''); ?> + author(); ?> +
    +
    + date('Y-m-d H:i'); ?> + reply(); ?> +
    + content(); ?> + commentStatus(); ?> +
    +children) { ?> +
    + threadedComments($options); ?> +
    + +
  • + pageNav( @@ -74,7 +110,5 @@ -
    -
    -
    \ No newline at end of file + \ No newline at end of file diff --git a/functions.php b/functions.php index 9a887f5..4031f30 100644 --- a/functions.php +++ b/functions.php @@ -31,6 +31,7 @@ function themeConfig($form) { '0', _t('是否在文章页面显示显示作者信息'), _t('选择“是”将在文章页面包含显示作者信息。')); $form->addInput($showProfile); } + function get_post_view($archive) { $cid = $archive->cid; $db = Typecho_Db::get(); diff --git a/header.php b/header.php index d1eace2..f7a6752 100644 --- a/header.php +++ b/header.php @@ -73,7 +73,6 @@ error_reporting(E_ALL);if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> - diff --git a/page-archives.php b/page-archives.php index c1d60e6..98d324e 100644 --- a/page-archives.php +++ b/page-archives.php @@ -7,39 +7,39 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?> need('header.php'); ?>
    -
    +

    title() ?>

    to($quantity); ?>

    共包含 publishedPostsNum(); ?> 篇文章

    - -
    - +
    + publishedPostsNum)->to($archives); $year = 0; $mon = 0; $i = 0; $j = 0; -$output = '
    '; - while ($archives->next()) { + $output = '
    '; + while ($archives->next()) { $year_tmp = date('Y', $archives->created); $mon_tmp = date('m', $archives->created); $y = $year; $m = $mon; if ($year > $year_tmp || $mon > $mon_tmp) { -$output .= ''; + $output .= ''; } - if ($year != $year_tmp || $mon != $mon_tmp) { + if ($year != $year_tmp || $mon != $mon_tmp) { $year = $year_tmp; $mon = $mon_tmp; -$output .= '

    ' . date('Y年', $archives->created) . '

    + $output .= '

    ' . date('Y年', $archives->created) . '

    '. date('m月', $archives->created) .'

    '; + $output .= '
    '; echo $output;?>
    diff --git a/page-categories.php b/page-categories.php index e7dc4b8..f5fb8af 100644 --- a/page-categories.php +++ b/page-categories.php @@ -11,17 +11,17 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>

    title() ?>

    -widget('Widget_Metas_Category_List')->parse(' -
    - -
    - {name} - ({count}) - -
    {description}
    -
    -
    -'); ?> -
    + widget('Widget_Metas_Category_List')->parse(' +
    + +
    + {name} + ({count}) + +
    {description}
    +
    +
    + '); ?> + need('footer.php'); ?> \ No newline at end of file diff --git a/page-douban.php b/page-douban.php index adc6865..a66ebc6 100644 --- a/page-douban.php +++ b/page-douban.php @@ -11,8 +11,8 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>

    title() ?>

    观影数据来源于豆瓣

    -
    +
    -
    + need('footer.php'); ?> \ No newline at end of file diff --git a/post.php b/post.php index 707c2f6..2db247a 100644 --- a/post.php +++ b/post.php @@ -2,14 +2,13 @@ need('header.php'); ?>
    - -
      - +
        +
        + - - + @@ -20,42 +19,38 @@ d="M12 9C10.3431 9 9 10.3431 9 12C9 13.6569 10.3431 15 12 15C13.6569 15 15 13.6569 15 12C15 10.3431 13.6569 9 12 9ZM11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12Z" /> - - 阅读 + 阅读 - commentsNum('评论', '1 评论', '%d 评论'); ?> - + commentsNum('评论', '1 评论', '%d 评论'); ?>
        -

        title() ?>

        -
        - content(); ?> -
        +

        title() ?>

        +
        content(); ?>
        -
        - - - - -
        - +
        + + + + + +
        +
        tags(' ', true, ' '); ?>
        @@ -63,6 +58,12 @@ options->showProfile): ?> need('profile.php'); ?> + + allow('comment')): ?> + need('comments.php'); ?> + + +options->twikoo(); ?>
    - - allow('comment')): ?> - need('comments.php'); ?> - - -options->twikoo(); ?> +
    need('footer.php'); ?> diff --git a/postlist.php b/postlist.php index 749c586..b8567ff 100644 --- a/postlist.php +++ b/postlist.php @@ -1,9 +1,12 @@ next()): ?> -
    +