The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Delete users and their threads/posts extra
I want to completely delete (not ban) an array of users (submitted by a checkboxs form) from the database, ie. deleting the users and automatically delete all their associated data eg. threads, posts ...
I've tried this code from 'user.php' but it only deletes users in the 'user' table not their associated data in other tables: Code:
if(isset($_REQUEST['do']) && $_REQUEST['do'] == 'doDelete') { $vbulletin->input->clean_array_gpc('p', array('userid' => TYPE_ARRAY)); $user_ids = $vbulletin->GPC['userid']; // check user is not set in the $undeletable users string $nodelete = explode(',', $vbulletin->config['SpecialUsers']['undeletableusers']); foreach($user_ids as $user_id) { if (!in_array($user_id, $nodelete)) { $info = fetch_userinfo($user_id); if ($info['userid'] == $user_id) { //delete user $userdm =& datamanager_init('User', $vbulletin, ERRTYPE_CP); $userdm->set_existing($info); $userdm->delete(); unset($userdm); } } } // print_cp_message('<center>Successfully deleted selected user(s)!</center>', NULL, 0, NULL); // } Thank you. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|