diff --git a/app/controllers/news.php b/app/controllers/news.php index a6043ba1f245f9daf1b872039ecaed7d5768a51a..a8d5237f1aeea57bf5cebf621d150fbcf6b90d74 100644 --- a/app/controllers/news.php +++ b/app/controllers/news.php @@ -73,6 +73,11 @@ class NewsController extends StudipController return $this->render_nothing(); } + // Store visit if user opened comments + if (Request::bool('comments') && Request::submitted('contentbox_open')) { + object_set_visit(Request::option('contentbox_open'), 'news'); + } + // Check if user wrote a comment if (Request::submitted('accept') && trim(Request::get('comment_content')) && Request::isPost()) { CSRFProtection::verifySecurityToken(); diff --git a/app/views/news/_actions.php b/app/views/news/_actions.php index b3df43c14c9b714b46a677bfe4d835e6c71b2ae9..15daf3c15fd73671b0de123da37c4ac67a5dbfe5 100644 --- a/app/views/news/_actions.php +++ b/app/views/news/_actions.php @@ -18,7 +18,7 @@ <? if ($new['allow_comments']) : $num = StudipComment::NumCommentsForObject($new['news_id']); - $visited = object_get_visit($new['news_id'], 'news', false, false); + $visited = object_get_visit($new['news_id'], 'news'); $isnew = StudipComment::NumCommentsForObjectSinceLastVisit($new['news_id'], $visited, $GLOBALS['user']->id); ?> <? if ($num): ?>