2006-02-04, 07:10 PM
My first plugin. I would like to implement the following inside a plugin:
I would also like to make it so in the options when you set a certain number of posts to change from usergroup, you can chose what group to change to, and what group they must be in for this change to take affect. Also, I would like to be able to automatically switch current users to this group using a checkbox.
So example:
Add new Changer: http://www.louhabs.com/mybbmods/usergrou.../index.htm
Manage Current Changers: http://www.louhabs.com/mybbmods/usergrou...groups.htm
[Manage Changers is just so you know what I want there. There is no example]
Anyone willing to help me make this?
Michael83 Wrote:A nicer solution (far less queries): Insert into global.phpWhen you use this method, you have to run the following query via phpmyadmin to update all users that already have more than x posts:## Update Usergroup ## // Usergroup-ID Group 1 (old group) $gid1 = "2"; // Usergroup-ID Group 2 (new group) $gid2 = "4"; // Minimal number of posts $minposts = "5"; // Update user if ($mybb->user['postnum'] == $minposts) { // Update usergroup $update_group = $db->query("UPDATE ".TABLE_PREFIX."users SET usergroup = '".$gid2."', displaygroup = '".$gid2."' WHERE uid = '".$mybb->user['uid']."' AND usergroup = '".$gid1."'"); } ## Update Usergroup ##
x = new goup idUPDATE mybb_users SET usergroup = 'x', displaygroup = 'x' WHERE postnum >= 'y' AND usergroup = 'z'
y = minimal post number
z = old group id
I would also like to make it so in the options when you set a certain number of posts to change from usergroup, you can chose what group to change to, and what group they must be in for this change to take affect. Also, I would like to be able to automatically switch current users to this group using a checkbox.
So example:
Add new Changer: http://www.louhabs.com/mybbmods/usergrou.../index.htm
Manage Current Changers: http://www.louhabs.com/mybbmods/usergrou...groups.htm
[Manage Changers is just so you know what I want there. There is no example]
Anyone willing to help me make this?