Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Recent Forum Replies
Avatar
Jas-n
Guest
Guests
Feb 22, 2012 - 6:46 pm

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.

Image Enlarger

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

Avatar
Brandon
U.S.
SP Wrangler
Free Members
sp_UserOfflineSmall Offline
Feb 22, 2012 - 7:08 pm

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/>')

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17362
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625