From f01ab50e09ace036bd3d3d82a02690bd847fc372 Mon Sep 17 00:00:00 2001 From: Jean-Christian Denis Date: Thu, 5 Jan 2023 01:13:55 +0100 Subject: [PATCH] fix comment number from all coments --- _public.php | 11 +++++++++++ default-templates/dotty/comListe.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/_public.php b/_public.php index 9461b9b..f8d0d52 100644 --- a/_public.php +++ b/_public.php @@ -27,6 +27,7 @@ dcCore::app()->tpl->addValue('ComListeNbCommentsPerPage', [tplComListe::class,'c dcCore::app()->tpl->addBlock('ComListeCommentsEntries', [tplComListe::class,'comListeCommentsEntries']); dcCore::app()->tpl->addValue('ComListePaginationLinks', [tplComListe::class,'comListePaginationLinks']); dcCore::app()->tpl->addValue('ComListeOpenPostTitle', [tplComListe::class,'comListeOpenPostTitle']); +dcCore::app()->tpl->addValue('ComListeCommentOrderNumber', [tplComListe::class,'comListeCommentOrderNumber']); dcCore::app()->tpl->addBlock('ComListePagination', [tplComListe::class,'comListePagination']); dcCore::app()->tpl->addValue('ComListePaginationCounter', [tplComListe::class,'comListePaginationCounter']); @@ -236,6 +237,16 @@ class tplComListe return __('open post'); } + public static function comListeCommentOrderNumber(ArrayObject $attr): string + { + return + 'ctx->comments->index() + 1 +' . + '(dcCore::app()->public->getPageNumber() - 1) * ' . + 'abs((integer) dcCore::app()->blog->settings->get("' . basename(__DIR__) . '")->get("nb_comments_per_page"));' . + '?>'; + } + public static function comListePagination(ArrayObject $attr, string $content): string { $params = "
  • -

    {{tpl:lang Source:}} {{tpl:CommentEntryTitle}} - {{tpl:CommentOrderNumber}} {{tpl:lang From}} {{tpl:CommentAuthorLink}} - +

    {{tpl:lang Source:}} {{tpl:CommentEntryTitle}} - {{tpl:ComListeCommentOrderNumber}} {{tpl:lang From}} {{tpl:CommentAuthorLink}} -