Support Forum
Hi,
I need some help in changing the way my sidebar displays the latest forum replies. At the moment it displays one comment per thread (if a thread gets one reply, then another straight after, the first one is removed from the sidebar rather than being moved down).
For example, the image below shows my testing forum with the only two comments on the forum, however only the latest update is shown when I want 5 regardless of topic.
This is the code I'm using, which is a custom version of the forum post widget.
function latest_forum_comments($limit) { sp_forum_ahah_support(); global $spListView, $spThisListTopic; $spListView = new spTopicList($topicIds, $limit, $orderByGroup, $forumIds); if(sp_has_list()) : while(sp_loop_list()) : sp_the_list(); # user $out='<li class="sidebar-comments"><strong>'.$spThisListTopic->display_name.'</strong> on '; #link $out.="<a href='".$spThisListTopic->post_permalink."'>".$spThisListTopic->topic_name."</a>:"; # extract $out.="<br><em>".$spThisListTopic->post_tip."</em></li>"; endwhile; endif; echo $out; }
I've tried to look around the web to a solution, but I can't seem to find one, all I can presume is that it's something to do with the "global..." and $spListView..." lines.
Thanks in advance,
Jason
What you can do is use the sp_RecentPostsTag in the Templates-tags/library.
php sp_RecentPostsTag() The options are shown in the file and then maybe if not sufficient edit it instead of creating a new one.
For example I use this on one of my pages php sp_RecentPostsTag('showAvatar=1&limit=10&afterDate=<hr/>')
1 Guest(s)