Skip to content

Commit 0a504ba

Browse files
authored
Update ForumHandler.php
Changes to make sure any links to post include the Topic ID. Otherwise, the notification box will not appear. It only appears when the Topic ID is part of the viewtopic.php URL. So if you are using any of the last post links, or jumping directly to a specific post, without this change, the notification box will not be present.
1 parent 52ece29 commit 0a504ba

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

class/ForumHandler.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public function getAllTopics($forum, $criteria = null)
353353
}
354354
}
355355
// irmtfan - move here for both topics with and without pages
356-
$topic_page_jump_icon = "<a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?post_id=' . $myrow['post_id'] . "'>" . \newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST) . '</a>';
356+
$topic_page_jump_icon = "<a href='" . XOOPS_URL . '/modules/newbb/viewtopic.php?topic_id=' . $myrow['topic_id'] .'&amp;post_id=' . $myrow['post_id'] . '#forumpost'. $myrow['post_id'] ."'>" . \newbbDisplayImage('lastposticon', _MD_NEWBB_GOTOLASTPOST) . '</a>';
357357

358358
// ------------------------------------------------------
359359
// => topic array
@@ -389,12 +389,13 @@ public function getAllTopics($forum, $criteria = null)
389389
if (isset($lastRead)){
390390
if (!empty($lastRead)){
391391
if ($lastRead<$myrow['topic_last_post_id']){
392-
$topicLink = 'viewtopic.php?post_id=' . $lastRead . '#forumpost'.$lastRead;
392+
$topicLink = 'viewtopic.php?topic_id=' . $myrow['topic_id'] .'&amp;post_id=' . $lastRead . '#forumpost'.$lastRead;
393+
393394
//BigKev73 > Adding this code to support jumping to the next post after the LastReadPost, otherwise we could end up on the prior page
394395
// if the lastread post is not on the last page and the next new post. Added getNextPostId to topichandler to support this
395396
$nextPostID = $topicHandler->getNextPostId($myrow['topic_id'],$lastRead);
396397
if(!empty($nextPostID)){
397-
$topicLink = 'viewtopic.php?post_id=' . $nextPostID . '#forumpost'.$nextPostID;
398+
$topicLink = 'viewtopic.php?topic_id=' . $myrow['topic_id'] .'&amp;post_id=' . $nextPostID . '#forumpost'.$nextPostID;
398399
print ('LastRead='.$lastRead. ', NextPostID= ' . $nextPostID);
399400
}
400401
}
@@ -925,6 +926,7 @@ public function &display($forums, $length_title_index = 30, $count_subforum = 1)
925926
if ($post_id) {
926927
$post = &$posts[$post_id];
927928
$_forum_data['forum_lastpost_id'] = $post_id;
929+
$_forum_data['forum_lastpost_topicid'] = $post['topic_id'];
928930
$_forum_data['forum_lastpost_time'] = \newbbFormatTimestamp($post['post_time']);
929931
if (!empty($users_linked[$post['uid']])) {
930932
$_forum_data['forum_lastpost_user'] = $users_linked[$post['uid']];

0 commit comments

Comments
 (0)