The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Update $post['rank']
How could I update a user's $post['rank'] with a file which is outside the /forums directory?
Basically we'd like to have a page where users can change their $post['rank'], but as I said the file is going to be outside of the /forums directory and not in plugins. Thanks. |
#2
|
|||
|
|||
You could update the user's rank field in the usertextfield table, but the rank gets recalculated whenever any user data is updated, so it's not meant to be set to an aribitrary value.
|
#3
|
|||
|
|||
Quote:
--------------- Added [DATE]1365602699[/DATE] at [TIME]1365602699[/TIME] --------------- Quote:
Code:
$ranks = $vbulletin->db->query_first(" SELECT rank FROM ".$schema.".".$db_prefix."usertextfield WHERE username = 'Jake' "); Is their username not stored in this table? |
#4
|
|||
|
|||
You'd have to connect to the database. You can write a script that chdir()s to the forum directory then includes global.php, then you can use $vbulletin->db, or you could use the php mysql functions to go directly to the database (but you need the connection info from config.php).
Quote:
Code:
$ranks = $vbulletin->db->query_first(" SELECT rank FROM ".$schema.".".$db_prefix."usertextfield AS usertextfield LEFT JOIN ".$schema.".".$db_prefix."user AS user ON (user.userid = usertextfield.userid) WHERE username = 'Jake' "); |
#5
|
|||
|
|||
Quote:
Will report back if need be, thanks for your help. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|