SMF, MODx and groups.

When building the new site of Mountain Rescue (England and Wales) I needed to link MODx and Simple Machines Forums (SMF).

Easy enough with the SMF connect plugin, but I needed to synchronise MODx webgroups with SMF groups and this package does not provide that.

The code below is a modified SMF connect plugin to cater for this. Note that it transfers MODx group membership to SMF and not vice versa. Also note that the groups that you wish transfered must be set up manually in SMF - but this does mean that groups that are intended to be kept purely within MODx will not end up cluttering up SMF.

The important part is the function modx_to_smf_groups() which reads in the modx webgroup memberships, and makes an array suitable for the SMF API. The latter requires an item for the ‘ID GROUP’ or main group, and an item called ‘additional groups’ which is a comma delimited list of other groups that the user is a member of. This is different from modx where all groups are created equal. The code below does not try and prioritise any particular group for ‘ID GROUP’.

Download the modified plugin here.

Comments are closed.