vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Forum and Server Management (https://vborg.vbsupport.ru/forumdisplay.php?f=232)
-   -   Query to remove signatures that have links in them for vb4 (https://vborg.vbsupport.ru/showthread.php?t=306355)

tpearl5 12-28-2013 01:59 AM

Query to remove signatures that have links in them for vb4
 
I just used this to batch remove signatures that have links in them. 95% of them were spam accounts anyway:

Code:

UPDATE usertextfield SET signature=NULL WHERE signature LIKE '%url%';
The entire signature will be removed, not just the link

This will probably work for vb3 as well, but I haven't tested it.

tpearl5 03-31-2014 06:47 PM

And a slightly more complex query if you want to remove signatures from a specific user group:
Code:

UPDATE usertextfield AS ut
INNER JOIN user AS u ON ut.userid = u.userid SET signature=NULL
WHERE ut.signature LIKE '%url%' AND u.usergroupid = 2;

Replace 2 with the user group you want to remove signatures for.

scottct1 05-01-2014 02:23 AM

How do I just remove ALL signatures from the Registered usergroup?

tpearl5 05-01-2014 05:48 PM

Quote:

Originally Posted by scottct1 (Post 2495587)
How do I just remove ALL signatures from the Registered usergroup?

Code:

UPDATE usertextfield AS ut
INNER JOIN user AS u ON ut.userid = u.userid SET signature=NULL
WHERE u.usergroupid = 2;


I haven't tested this, I would run it as a SELECT statement first to make sure that you are getting the right data, like this:

Code:

SELECT * FROM usertextfield AS ut
INNER JOIN user AS u ON ut.userid = u.userid
WHERE u.usergroupid = 2;

Do a backup! Once it's gone it's gone!

vBNinja 05-01-2014 06:32 PM

Quote:

Originally Posted by scottct1 (Post 2495587)
How do I just remove ALL signatures from the Registered usergroup?

assuming you don't have a table prefix:

PHP Code:

UPDATE usertextfield  
    JOIN user USING 
(userid)
    
SET signature ''
WHERE usergroupid 2

otherwise you'll need to add the prefix before "usertextfield" and "user"

But that should work fine if you're using phpmyadmin

ForceHSS 05-01-2014 06:35 PM

Confirm vBNinja query works tested on navicat

tpearl5 05-01-2014 06:52 PM

Quote:

Originally Posted by vBNinja (Post 2495710)
assuming you don't have a table prefix:

Ah, much cleaner. Is signature supposed to be an empty string vs null?

vBNinja 05-01-2014 07:27 PM

Quote:

Originally Posted by tpearl5 (Post 2495713)
Ah, much cleaner. Is signature supposed to be an empty string vs null?

Doesn't matter


All times are GMT. The time now is 01:57 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.01091 seconds
  • Memory Usage 1,730KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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