I have a community website, that covers several villages, each village has a whats on, when people post the same event in more than one village or I copy to other villages each one shows up in the "recent toics block", so the recent topics could consist of the same thing 6 times. Is there a way to only show unique topics in the topic block.
Thanks
Clive
Duplicates in "Recent topics" block
Forum rules
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
Before creating a new support thread, please take a look at the board3 Portal FAQ and use the search!
Many questions have already been answered.
-
Topic author - Active Member
- Posts: 26
- Joined: 19. November 2011 11:25
- phpBB.de User: cwjs
- phpBB.com User: cwjs
Re: Duplicates in "Recent topics" block
I have done it !!
I added a "GROUP BY" in the section below in the /portal/modules/portal_recent.php, I think maybe this should be added to the mod
// Recent topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_status <> ' . ITEM_MOVED . '
AND topic_approved = 1
AND topic_type = ' . POST_NORMAL . '
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
GROUP BY topic_title
ORDER BY topic_time DESC';
I added a "GROUP BY" in the section below in the /portal/modules/portal_recent.php, I think maybe this should be added to the mod
// Recent topic (only show normal topic)
//
$sql = 'SELECT topic_title, forum_id, topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE topic_status <> ' . ITEM_MOVED . '
AND topic_approved = 1
AND topic_type = ' . POST_NORMAL . '
AND topic_moved_id = 0
' . $sql_where . '' . $forum_sql . '
GROUP BY topic_title
ORDER BY topic_time DESC';