We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Show total topic count on group topic list (this is on the forum side) | Forum

dave Leader
dave May 19 '14
This mod is unlike my other mod on groups. This one is after you click on the group name (that is when everything changes hands over to the forum plugin process) 


So you go to groups and you click on a group name..  That takes you to a page with all the topics of that group.   The problem is that there is no pagination or other feature on that page to show you how many topics there are, or if there are more than what is on the page display.   


You wont find out until you click on the "view all" link.   Then you will see pagination.  


Issue:  some members may not know to check for more topics by clicking view all. 


Solution:  Display text at the top of this listing which helps them realize there are more topics than are listed on the page.  


Once you are on the forum side working with the groups its pretty easy for mods.   Its the group side that is a pain (my other mod im working on) lol..


 The image below will show the result of this mod.. 


once you get into the topic list for groups then post the 'view all' text at the top with the total of the topics number in text 


1. Open  /ow_plugins/forum/components/latest_topics_widget.php


AFTER THIS:   
  $topicIds = array();


ADD THIS:


// added to set topic total on view all mod for group topics
$topicTotCount = 0;

$topicTotCount = $forumService->getGroupTopicCount($forumGroup->getId());

$this->assign('topicTotCount', $topicTotCount);
// add end


SAVE THAT FILE


2. Open /ow_plugins/forum/views/components/latest_topics_widget.html


AFTER THIS: 
<div class="ow_forum_entity_forum clearfix ow_smallmargin">

ADD THIS:
<!-- added to show total in group topic list  -->

{if $topicList}  

Click "View All" to see all {$topicTotCount} topics

{/if}

<!-- end add -->


SAVE THE FILE AND REFRESH YOUR SITE CACHE. 


NOTE: one improvement could be to only show this if the number of topics is greater than the topics per page pagination.  Meaning usually there are 10 topics per page, if it is 10 or less then no need to have this show... But you can add that if you want.. up to you just add what you did as a reply here to help others. :)




Here is the result - see image below: 
















enjoy!!  

The Forum post is edited by dave May 19 '14