Jump to:

1036 Posts in 810 Topics by 315 members

Forum Module

SilverStripe Forums » Forum Module » Forum module in SilverStripe 3.1 beta

Discuss the Forum Module.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1466 Views
  • Josua
    Avatar
    Community Member
    86 Posts

    Forum module in SilverStripe 3.1 beta Link to this post

    Hi all!

    The forum module work with Silverstripe 3.1 beta?
    It produces errors:
    Fatal error: Class declarations may not be nested in C:\wamp\www\forum\code\ForumHolder.php on line 227 (SilverStripe 3.1 beta from github)
    [User Error] Couldn't find field GroupID in any of Member's tables (SS 3.1 beta from github)

    Somebody has tried it with SS 3.1?

    Is there any fix?

    Thanks,
    Regards,
    Jose A.

  • Tony Air
    Avatar
    Community Member
    13 Posts

    Re: Forum module in SilverStripe 3.1 beta Link to this post

    The same issue
    fast and dirty solution is to replace 2 functions in ForumHolder.php

    CurrentlyOnline()

    function CurrentlyOnline() {
          $groupIDs = array();
          $where = '';
          if($forumGroup = Group::get()->filter('Code', 'forum-members')->first()) {
             //$groupIDs[] = $forumGroup->ID;
             $where .= ' "GroupID" = \''.$forumGroup->ID.'\'';
          }

          if($adminGroup = Group::get()->filter('Code', array('administrators', 'Administrators'))->first()) {
             //$groupIDs[] = $adminGroup->ID;
             if($where!=='') {$where .= ' OR';}
             $where .= ' "GroupID" = \''.$adminGroup->ID.'\'';
          }

          return Member::get()
             ->leftJoin('Group_Members', 'Member.ID = Group_Members.MemberID')
             ->where($where)
             //->filter('GroupID', $groupIDs)
             ->filter("LastViewed:GreaterThan", DB::getConn()->datetimeIntervalClause('NOW', '-15 MINUTE'))
             ->sort('Member.FirstName, Member.Surname');
       }

    and getLatestMembers()

    function getLatestMembers($limit = 1) {
          $groupIDs = array();
          $where = '';
          if($forumGroup = Group::get()->filter('Code', 'forum-members')->first()) {
             //$groupIDs[] = $forumGroup->ID;
             $where .= ' "GroupID" = \''.$forumGroup->ID.'\'';
          }
          if($adminGroup = Group::get()->filter('Code', array('administrators','Administrators'))->first()) {      
             //$groupIDs[] = $adminGroup->ID;
             if($where!=='') {$where .= ' OR';}
             $where .= ' "GroupID" = \''.$adminGroup->ID.'\'';
          }
          
          $latestMembers = Member::get()
             ->leftJoin('Group_Members', 'Member.ID = Group_Members.MemberID')
             ->where($where)
             //->filter('GroupID', $groupIDs)
             ->sort('Member.ID DESC')
             ->limit($limit);

          return $latestMembers;
       }

  • Platypus
    Avatar
    Community Member
    43 Posts

    Re: Forum module in SilverStripe 3.1 beta Link to this post

    Thanks for this hint, it helped me very much with SS 3.1 and the forums module.

    1466 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.