Page 1 of 1

Duplicates in "Recent topics" block

Posted: 31. March 2012 19:22
by cwjs
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

Re: Duplicates in "Recent topics" block

Posted: 7. April 2012 16:54
by cwjs
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';