vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Mini Mods - Quick User Delete In PostBit (https://vborg.vbsupport.ru/showthread.php?t=142681)

Dream 03-23-2007 01:12 AM

But then there's all user attachments, etc, etc info

thincom2000 03-23-2007 03:31 AM

Well if you don't know which tables have `userid` in them, you'll be running a lot of queries depending on your forum, but you can do this (I recommend testing on a backup database first):

PHP Code:

$db->hide_errors();
$all_tables $db->query_read("SHOW TABLES");

$getall $db->fetch_array($all_tables);
$db->free_result($all_tables);

foreach (
$getall AS $get_all)
{
    
$create_query "DELETE FROM $get_all WHERE `userid` = " $vbulletin->GPC['userid'];
    
$getro $db->query_write($create_query);
    echo 
"Deleted User #" $getro['userid'] . " from $get_all.<br />";
    
$db->free_result($getro);
}
unset(
$get_all$getall$create_query);

$db->show_errors(); 

That should delete every database entry associated with a particular userid. (You will end up with orphaned posts if they started any threads).

You could technically do it in ONE query, but I think the whole query might fail and stop if the `userid` field doesn't exist in one of the tables.

HMBeaty 03-23-2007 03:33 AM

Quote:

Originally Posted by cerjam (Post 1209268)
why waste the space in the memberlist for 300 banned spam bots? this is so much cleaner. and if nothing else, someone can learn to make a postbit hack from this

I already did

User Management

cerjam 03-23-2007 06:29 AM

Nice hack redline, my thread and im marking out to you..lol. Nice though.

Atakan KOC 03-25-2007 04:48 PM

Thanks....


All times are GMT. The time now is 08:21 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.03018 seconds
  • Memory Usage 1,725KB
  • 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_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete