Try these pointers
– Try and use the intended function in the same manner as the stock theme. To make sure everything works.
– Understand that forums and topics must exist to be filtered, much like any of the status filters for widgets such as the latest user/group activities.
– Try using ‘groups_get_by_most_forum_topics()’ function directly in your custom function.
– Start debugging, turn debugging flags on for your environment, start to modify the source and see whats going on.