Geeklog-Core / geeklog

Geeklog - The Secure CMS.
https://www.geeklog.net
24 stars 19 forks source link

Comment Page Navigation does not work with Articles with Multiple Pages #1022

Closed eSilverStrike closed 4 years ago

eSilverStrike commented 4 years ago

If there are comments that span multiple pages on articles that have multiple pages and the comments appear on the last page (and not the first) the article page number gets lost if you use the comment page navigation.

This is because in lib-comment.php the base url for the comment page navigation is determined by (in several spots):

    // Link to plugin defined link or lacking that a generic link
    // that the plugin should support (hopefully)
    list($plgurl, $plgid) = CMT_getCommentUrlId($type);
    $articleUrl = "$plgurl?$plgid=$sid";

$articleUrl is missing &mode=pagenum

We should also consider other plugins which may not create a link to its item in exactly that way...

eSilverStrike commented 4 years ago

Should be fixed now.

Checked for both comments editor on page and not, with URL Rewrite enabled and not, with articles with multiple pages and not.

Please note that if comments are displayed on every page of articles with multiple pages, if $_CONF['comment_on_same_page'] = false any comment posting done by the user will result in the user to be taken back to the first page of the article. This is a limitation of the Geeklog comment library as the page of the article being displayed is not tracked.