Support Forum

Recent Forum Topics Widget – Template Tags Plugin

CH Chris Hustad
Chris Hustad
Member

I just updated the SP software and plugins, and we’re now seeing a problem with the Recent Forum Topics widget on our sidebar.  It displays the post multiple times, depending on the amount of replies.

http://www.werejustparents.com/ (See Sidebar)

Here is the code we’re using (as a text widget ):

[ sp_newest_topics itemorder=’T’ beforetopic=” ]

Thanks

5 Answers

New Answer

MP Mr Papa
Mr Papa
Member

ah sorry… missed the link…  so same topic…  odd, they really are different posts – look at the excerpt from hover…  but the link is topic – surprising, but makes sense by name…

nothing to limit it per topic – and not sure anything changed recently…

will have to research…

MP Mr Papa
Mr Papa
Member

so maybe you can try a change for me…  in the sp-NewestTopics-tag.php file, find this line:

    $where = (!empty($forumIds)) ? SFPOSTS.'.forum_id IN ('.$forumIds.')' : '1=1';

right after that line, add this code:

    add_filter('sph_post_list_query', 'sp_ttags_list_post_query', 10, 2);
     function sp_ttags_list_post_query($spdb, $x) {
         $spdb->groupby = SFTOPICS.'.topic_id';
         return $spdb;
     }

technically, should have one more line of code changed too though only for fringe cases…  after:

    $spPostList = new spPostList($where, SFTOPICS.'.topic_id DESC', $limit);

add this line:

    remove_filter('sph_post_list_query', 'sp_ttags_list_post_query', 10);

think that will fix it up for you…

CH Chris Hustad
Chris Hustad
Member

Looks like it did the trick.

Thanks for the help.

YS Yellow Swordfish
Yellow Swordfish
Member

Glad we got it  sorted and apologies for the issue – fixed in the next update of course.