Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

How do I create a page or module that would search the forum Memberlist?


Reply


4 Posts   745 Views

Avatar
irisseven

Community Member, 8 Posts

9 April 2010 at 1:54am

I'm still wrapping my head around Silverstripe but LOVE it so far. There are a few conventions that still elude me and I could use some help.

I'm trying to create a search function that will be on most of my pages that allows a site visitor to search the forum member list based on a few criteria ( lets use country and Occupation as an example ).

I've looked through the docs, google'd tutorials, scanned the forum code itself & searched the forums but honestly it's left me more confused & with dead links than anything else.

Any help or code examples in the right direction would be greatly appreciated!

Avatar
irisseven

Community Member, 8 Posts

9 April 2010 at 6:38pm

Edited: 09/04/2010 6:38pm

dbl post...

Avatar
irisseven

Community Member, 8 Posts

9 April 2010 at 6:38pm

anyone?

Avatar
patjnr

Community Member, 101 Posts

9 April 2010 at 8:42pm

Hi

thats very simple

if you can get the get the latest member then certainly you can search all the forum members

      $forumGroupID = (int) DataObject::get_one('Group', "Code = 'forum-members'")->ID;
      return DataObject::get(
         'Member',
         "GroupID = '$forumGroupID'",
         'FirstName, Surname',
         'LEFT JOIN Group_Members ON Member.ID = Group_Members.MemberID'
      );

this should work

ta

PAt