The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Rank / Display Group
Ok so basically, I made a custom script outside the admincp so I can have certain people with certain usergroups be able to edit peoples usergroups upto a certain level.
The problem is, the rank images (from display group) aren't being updated up until I manually run the "Update User Titles and Ranks" maintenance script. I noticed there isnt anywhere in the database that shows what rank a person is in, and it bases it on the display group... What exactly do I need to do, to make the "Update User Titles and Ranks" maintenance run for that specific userid only, so I can have it automatically run upon running the custom script. |
#2
|
|||
|
|||
The rank is calculated in includes/class_dm_user.php, if any information has been set that could affect the rank. The code that does it when you run "Update User Titles and Ranks" in the admincp is in admincp/misc.php. It creates a user datamanger and sets (among other things) the user posts to the same value it already has. That seems like it wouldn't do anything, but the user datamanager code detects that the posts have been set and recalculates rank. I think setting the usergroup should also trigger it to be recalculated, but of course that only would happen if you're using the datamanager to set it (which I'm guessing your script doesn't?). In any case you should just be able to do something like:
Code:
$userdm =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT); $userdm->set_existing($user); $userdm->set('posts', $user['posts']); // This will activate the rank update $userdm->save(); |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|