MyBB Community Forums

Full Version: Group sort
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I'm using Group sort modification: https://community.mybb.com/mods.php?action=view&pid=753
And I described my issue here:
https://community.mybb.com/thread-206754...pid1256601

I think I can reach my plans by using this modification.

What I mean?

I need to keep a usergroup (primary) as "registered", => this is group "2". Without changing in anytime.
And displayedgroup as "primary" (look strings in the modification). 

I need this to make UserCP's group management more functional. At the moment, if somebody have a primary group, then I (without ACP) and any other group leader can't remove the user from his primary group and downgrade him to "registered".

But the modification "Group sort" is sorting the groups by priority. So... after the downgrading, the user will change his display group to the color, name and rank of the lower group (but the lowest group will be "registered").

Unfortanely, scripting is a black magic for me. Sad

I hope it will be as core functionality in MyBB in the future.

I changed this:

	// update user data
	$primarygroup=array_shift($new_usergroups);
	$usergroups=implode(',', $new_usergroups);
	$new_record=array(
		'usergroup' => $primarygroup,
		'additionalgroups' => $usergroups,
		'displaygroup' => 0

	// update user data
	$primarygroup=array_shift($new_usergroups);
	$usergroups=implode(',', $new_usergroups);
	$new_record=array(
		'displaygroup' => $primarygroup,
		'additionalgroups' => $usergroups,
		'usergroup' => 2

Works and doesn't work...
Kicking the people from the groups, in every time, when I or somebody change group order (or edit the groups).

I think there I should change something more in groupsort.php
But I don't know the PHP, it's a magic for me.