View Full Version : Change usergroup?
high6
10-26-2009, 07:18 PM
Anyone have some php code for changing a users group? Is there a simple way to do it that I can add to a template or am I going to have to add a php file to do it and have the template "post" to it?
Lautaro
10-26-2009, 07:21 PM
I didn't understand your question very well, If you could make it a but more clear it would be good.
You want to change one of your user's usergroup?? OR you want to give permissions to X usergroup to use a specific style ??
high6
10-26-2009, 07:28 PM
You know when you click the users name on their post it shows "View public profile" etc. I want to add an option to change the user's group to a specific group.
Lautaro
10-26-2009, 07:34 PM
oh... i get it..
ok let me check that, I guess its not hard to add an option. I'll edit my post if i find a way to do it.
--------------- Added 1256590480 at 1256590480 ---------------
Ok i found a way to do this.
1- go to your Admin CP > styles & templates > Search in templates.
look for postbit_legacy or postbit. if your forum posts looks like here then edit "postbit" but if you use the vertical mode then edit "postbit_legacy", of course you can edit both if you wish.
2- Search for "$template_hook[postbit_user_popup]"
above add:
<if condition="$show['admincplink']">
<tr><td class="vbmenu_option"
<a href="moderator.php?$session[sessionurl]do=useroptions&u=$post[userid]">Edit User Profile</a></td></tr></if>
That will show add the link "Edit user profile" in the list and only users with admin CP access will see it.
3- save.
done !
high6
10-26-2009, 08:20 PM
Thanks, but I am more interested in having it change the user's usergroup to specific one when clicked. Also I want to allow moderators to do this.
Lautaro
10-26-2009, 08:36 PM
oh.. ok then you'll need someone with more experience in coding. I design vb styles but i dont know much about coding. this is all i can help with.
good luck.
James Birkett
10-26-2009, 11:44 PM
Changing the usergroup involves executing SQL queries which means running a query every time it is clicked. I'm also pretty sure it's not possible to run queries in templates which means you'd have to hook it to a plugin in order to run the query.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.