JFBConnect - Profiles - Add To Group
SourceCoast | www.sourcecoast.com
2012/01/02
Copyright (C) 2010-2011 SourceCoast, LLC
http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
[email protected]
www.sourcecoast.com
4.1.0
Profile integration for JFBConnect with Community Builder.
addtogroup.php
settings = array('profiles_addtogroup_field_map' => '',);
$this->_componentFolder = JPATH_SITE; // No component check necessary
$this->_componentFile = '';
parent::__construct($subject, $params);
}
function jfbcProfilesOnShowRegisterForm()
{
$groups = array();
$groups[] = array('id' => 123, 'name' => "Group 1"); // UPDATE THIS
$groups[] = array('id' => 456, 'name' => "Group 2"); // UPDATE THIS
$groups[] = array('id' => 789, 'name' => "Group 3"); // UPDATE THIS
$html = JHTML::_('select.genericlist', $groups, 'group_id', null, 'id', 'name', null);
return $html;
}
function jfbcProfilesOnRegister($jUserId)
{
jimport('joomla.user.helper');
$groupId = JRequest::getInt('group_id', 0);
if ($groupId == '123' || $groupId == '456' || $groupId == '789') // UPDATE THIS
JUserHelper::addUserToGroup($jUserId, $groupId);
}
}Join our newsletter to get alerts for Joomla releases, tips and tricks and extension updates.
