PDA

View Full Version : Social Groups request


Unfolded90
11-13-2013, 12:30 AM
Hello,

I've changed the settings so users can only create 1 social group.
but i would like to have it so they can only join 1 until they leave the other that they have joined.

I can tell you that there is no default setting to do this and that you will need to write a plugin. I guess when they click to join a group, the plugin would run a query to see if they are in any other groups and if so, spit out a message saying they can't join that group until they leave the other.

Actually, looking at the code around line 1395 or group.php, there is no plugin, so you will need to add the code directly.

Unfolded90
11-13-2013, 05:33 AM
if ($_REQUEST['do'] == 'create' OR $_REQUEST['do'] == 'docreate')
{
if (!($vbulletin->userinfo['permissions']['socialgrouppermissions'] & $vbulletin->bf_ugp_socialgrouppermissions['cancreategroups']))
{
print_no_permission();
}

if ($vbulletin->userinfo['permissions']['maximumsocialgroups'])
{
// fetch the number of groups the user has already created
$result = $vbulletin->db->query_first(
"SELECT COUNT(groupid) AS total
FROM " . TABLE_PREFIX . "socialgroup
WHERE creatoruserid = " . $vbulletin->userinfo['userid']
);

if ($result['total'] >= $vbulletin->userinfo['permissions']['maximumsocialgroups'])
{
standard_error(fetch_error((fetch_socialgroup_perm ('candeleteowngroups') ? 'you_can_only_create_x_groups_delete' : 'you_can_only_create_x_groups'), $vbulletin->userinfo['permissions']['maximumsocialgroups']));
}
}
}



Something like this but to join instead of create

--------------- Added 1384393622 at 1384393622 ---------------

bump