vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Change usergroup? (https://vborg.vbsupport.ru/showthread.php?t=226832)

high6 10-26-2009 07:18 PM

Change usergroup?
 
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 [DATE]1256590480[/DATE] at [TIME]1256590480[/TIME] ---------------

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:

Code:

<if condition="$show['admincplink']">
        <tr><td class="vbmenu_option"
    <a href="moderator.php?$session[sessionurl]do=useroptions&amp;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.


All times are GMT. The time now is 01:32 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01020 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete