The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hi folks. Is there a way to use the vBulletin API to find a user based on their username, or must I search the "users" database table? If there is, would you mind pointing me at some docs, or including a code snippit?
Thanks, Nick |
#2
|
||||
|
||||
![]()
Did you look at the API - http://members.vbulletin.com/api/ ? There is a function called fetch_userid_from_username listed on there.
|
#3
|
|||
|
|||
![]()
You can use the function above in conjunction with fetch_userinfo get the the full info
|
#4
|
||||
|
||||
![]()
Ack, I worded my question incorrectly.
I did indeed see fetch_userid_from_username() and fetch_userinfo(). However, those can only be used to get a user's info. Once you have that info, it's not possible to update it. Correct? Using the vB API, is it possible to get a "user object", through which the user's data can be updated? For example: PHP Code:
Nick |
#5
|
||||
|
||||
![]()
You can pass it onto the user data manager. (See the manual about data managers.)
|
#6
|
||||
|
||||
![]() Quote:
Quote:
Other than querying the users database table, is there any other way to get a user's ID via their username? Thanks, Nick |
#7
|
||||
|
||||
![]()
fetch_userinfo is in functions.php.
You can always copy functions to your plugins if you need them. |
#8
|
||||
|
||||
![]()
Right, but fetch_userinfo() is only useful if one has the user's ID.
For many reasons, copying functions is not a good idea. Doing so violates the DRY principle, makes your code brittle with respect to vBulletin updates, etc. Also, it negates the whole point of having an API. |
#9
|
||||
|
||||
![]()
Then all I can suggest is a quick query. I know that's what I do in some of my customized site code.
|
#10
|
||||
|
||||
![]()
Thanks for your insight, Lynne. It's helpful to hear what others have done in the past.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|