Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-19-2005, 08:02 PM
mlee mlee is offline
 
Join Date: Nov 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default sql querys to delete a member in vbulletin

Greetings all together.

Im writting a vbulleting integration script for an other cms at the moment and
need to know which sql querys i have to run to delete a user.

i know about

delete from $prefix."_user" where userid = '$id'
delete from $prefix."_userfield" where userid = '$id'

are there any more?

In fact i need to know what happens (sql querys) when i delete a user using the control panel.

Can someone help me out with this please?

With kind regards,

mlee
Reply With Quote
  #2  
Old 12-19-2005, 08:07 PM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mlee
Greetings all together.

Im writting a vbulleting integration script for an other cms at the moment and
need to know which sql querys i have to run to delete a user.

i know about

delete from $prefix."_user" where userid = '$id'
delete from $prefix."_userfield" where userid = '$id'

are there any more?

In fact i need to know what happens (sql querys) when i delete a user using the control panel.

Can someone help me out with this please?

With kind regards,

mlee
It is not $prefix, it is TABLE_PREFIX.
It is not _user/_userfield, it is user/userfield.
Reply With Quote
  #3  
Old 12-19-2005, 08:14 PM
mlee mlee is offline
 
Join Date: Nov 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michelle
It is not $prefix, it is TABLE_PREFIX.
It is not _user/_userfield, it is user/userfield.
Well i quoted that from my script
And yes you are right the underline is not needed there. Thx!

I guess you guys know what i mean.

I need the sql querys which are executed if you delete a member using the controlpanel.

So can anyone help me out?

Regards mlee
Reply With Quote
  #4  
Old 12-19-2005, 08:15 PM
Delphiprogrammi Delphiprogrammi is offline
 
Join Date: Feb 2004
Location: Landen(Belgium)
Posts: 1,335
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hi,

PHP Code:

$db
->query("DELETE FROM " TABLE_PREFIX "user WHERE userid='$vbulletin->userinfo[userid]'"); 
or you could

PHP Code:
$id $vbulletin->userinfo['userid']
$db->qyery("DELETE FROM " TABLE_PREFIX "user WHERE userid=$id"); 
that should work
Reply With Quote
  #5  
Old 12-19-2005, 08:17 PM
mlee mlee is offline
 
Join Date: Nov 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Delphiprogrammi
hi,

that should work
Hello Delphiprogrammi,

no you got me wrong, sorry my english is not the best.

I am not writting an vbulletin script but im modifing an other cms to work together with vbulletin.
I need to be able to delete vbulletin members by using the admin panel of the other cms. Therefore i need to know all sql querys which are executed if an user is deleted by the vbulletin control panel.
I dont want to make useless data stay in the database.
There are a lot of tables using userid as foreign key in vbulletin but i need to know which i i should delete when deleting a member.

Regards mlee
Reply With Quote
  #6  
Old 12-19-2005, 08:22 PM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mlee
Hello Delphiprogrammi,

no you got me wrong, sorry my english is not the best.

I am not writting an vbulletin script but im modifing an other cms to work together with vbulletin.
I need to be able to delete vbulletin members by using the admin panel of the other cms. Therefore i need to know all sql querys which are executed if an user is deleted by the vbulletin control panel.
I dont want to make useless data stay in the database.
There are a lot of tables using userid as foreign key in vbulletin but i need to know which i i should delete when deleting a member.

Regards mlee
Try to look at the code that is executed when vb itself deletes a user
Reply With Quote
  #7  
Old 12-19-2005, 08:28 PM
mlee mlee is offline
 
Join Date: Nov 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michelle
Try to look at the code that is executed when vb itself deletes a user
That was what i tryed first but i was not able to find it.
Reply With Quote
  #8  
Old 12-19-2005, 08:33 PM
Lea Verou Lea Verou is offline
 
Join Date: Jul 2005
Location: Greece
Posts: 1,856
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mlee
That was what i tryed first but i was not able to find it.
Yeah, I know... Those files are huge
I haven't seriously looked at a single vbulletin file for all the hacks I've made... I just can't find my way over there :ermm:
So, the correct answer imho (and more likely to be replied) is "Where can I find the code that vbulletin uses to delete users?"
Reply With Quote
  #9  
Old 12-19-2005, 08:36 PM
mlee mlee is offline
 
Join Date: Nov 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Michelle
I just can't find my way over there...
"Where can I find the code that vbulletin uses to delete users?"
Same here.

I can agree on that one
So my new question is:

Where can I find the code that vbulletin uses to delete users?

Regards mlee
Reply With Quote
  #10  
Old 12-19-2005, 08:41 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vbulletin deletes the user from user, userfield & usertextfield and sets the userid to zero in all posts they have made. It also removes userid based entries from a whole host of other tables.

It's a bit harder to track the code now because it uses the datamanager.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:09 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04429 seconds
  • Memory Usage 2,268KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete