vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Splitting up banned users. (https://vborg.vbsupport.ru/showthread.php?t=298745)

MagicPID 06-05-2013 02:47 AM

Splitting up banned users.
 
My forum has been private for a very long time and we are going to open registration back up soon. We used too ban people if they were inactive, so we would do a mass move into an inactive usergroup.

We ran into some forum trouble and in the end it has resulted in our inactive users and our actually banned users being in the same usergroup; Banned. The banned people have ban reasons if you click on their profiles but the inactive do not, is there a way maybe with an sql query to move everyone with a ban reason into another group?

Thanks

betterthanyours 06-06-2013 07:48 AM

I don't know the table structure off the top of my head but yes, it would be possible. If you can post your table structure we could help further.

John Lester 06-06-2013 05:12 PM

The code below is untested so make sure you have a backup of your database.

I'm not sure you could mass move those without a "reason", I think you could use "NULL" as the "reason" in the code below. What the code below does is move all users matching the "reason" so you'd have to repeat the code for each "reason" you have used in banning people.

Since the code uses the wildcard % you can use a partial "reason" if you wanted.

You'll have to create another banned user group if you haven't already, and make note of it's usergroupid #.

Also if you're using a prefix you will have to add that (IE vB_userban instead of just userban)

Code:

UPDATE userban SET usergroupid = newusergroupid#here WHERE reason LIKE %reasonhere%

MagicPID 06-06-2013 07:02 PM

Quote:

Originally Posted by John Lester (Post 2426195)
The code below is untested so make sure you have a backup of your database.

I'm not sure you could mass move those without a "reason", I think you could use "NULL" as the "reason" in the code below. What the code below does is move all users matching the "reason" so you'd have to repeat the code for each "reason" you have used in banning people.

Since the code uses the wildcard % you can use a partial "reason" if you wanted.

You'll have to create another banned user group if you haven't already, and make note of it's usergroupid #.

Also if you're using a prefix you will have to add that (IE vB_userban instead of just userban)

Code:

UPDATE userban SET usergroupid = newusergroupid#here WHERE reason LIKE %reasonhere%

Great! Thank you, I'll give it a shot tonight and see if it works.


All times are GMT. The time now is 11:14 PM.

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.02486 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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