Register Members List Search Today's Posts Mark Forums Read

Article Options
[How-To] Deal with User deletion/pruning and Username Changes
Join Date: Jan 2004
Posts: 6,863

by Andreas Andreas is offline 29 Sep 2005

If your Hack keeps user dependant Data (in it's own tables), you should code Plugins for the following Hooks to react on Events where this Data does change, eg. when Users get deleted or their Username changed.
Otherwise you might end up with invalid data or data for users that don't even exist anymore

Hook userdata_delete
This Hook will be called when a single Users gets deleted.
The Userid is $this->existing['userid']

Hook useradmin_prune
This Hook will be called when Users are being mass-pruned
The affected Userids are $userids, which is a comma-separated string of User-IDs.

Hook userdata_update_username
This Hook is called when the Username of a User is being changed.
$userid is the UserID, $username the new Username and $this->existing['username'] is the old Username.

Please note that the two userdata Hooks are within the User Data Manager, whichj means that $vbulletin and $db as well as all other global variables are not within the scope and you have to use $this->registry and $this->dbobject (or $this->registry->db) instead.
Views: 3127
Reply With Quote

Similar Article
Article Author Type Replies Last Post
Moderators Functions PM User on Thread Deletion toonysnn Modification Graveyard 29 02 Oct 2008 12:08
Restrict Pruning And Forum Deletion By Userid N9ne vBulletin 2.x Full Releases 9 10 Mar 2003 08:27

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Article Options

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

New To Site? Need Help?

All times are GMT. The time now is 17:13.

Layout Options | Width: Wide Color: