The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Write to $vbulletin->userinfo
Hey,
I can use $vbulletin->userinfo in a PHP script to read/return a specific value of a field. But what's the command for writing to a specific field? |
#2
|
||||
|
||||
Writing to it how?
|
#3
|
||||
|
||||
just add a column to the user database table
then you can access that column with the $vbulletin->userinfo array |
#4
|
|||
|
|||
I dont want to access/read from it. I want to write to it through the PHP script and I need to know which vB command should be used for that.
Example (reading): if (is_member_of($vbulletin->userinfo, 6)) checks if the user is in user group ID of 6. Let's say I want to set the ID for this user instead of reading it, how can this be done? |
#5
|
||||
|
||||
You want to update the users usergroupid? in the database, or on the page load?
|
#6
|
|||
|
|||
The groupID was just an example. I want to edit an entry in the user database in a PHP script I'm calling outside of the forum itself (through a program).
|
#7
|
||||
|
||||
If you want to edit and entry *in the database*, then you need to do a query like this (example to set userid to 10 for a user who's username is JoeBlow:
PHP Code:
http://www.vbulletin.com/docs/html/c...ards_sql_query (I would NOT change the userids via a query. If you accidentally set the userid to the same as another user, you can really mess things up!) |
Благодарность от: | ||
kehindelawal |
#8
|
|||
|
|||
Of course, the userID was just an example. I've added a custom column for all users which I want edit so the original vB entries stay untouched.
//edit: I've tried your script and it gives me this error: PHP Code:
Quick Setup Your current site " site of the forum instead of executing the script. Somehow the query does not work. --------------- Added [DATE]1400020894[/DATE] at [TIME]1400020894[/TIME] --------------- Okay got it. The problem was that the command "ALTER TABLE" is wrong. |
#9
|
||||
|
||||
Whoops! UPDATE for updating the table. ALTER for changing the table itself.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|