The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to call a Profile field in a php file?
I'm trying to create a webcam script, and would like to use a hidden profile field where the member can enter his/her address to the webcam and it will automatically add to the page.
How could one accomplish this smartly, and what would be the query to select from a certain field? i know how to call from a field in a template, but don't know how to accomplish this in a php file. thanks. |
#2
|
||||
|
||||
Just run a query... Off the top of my head:
PHP Code:
I'm not sure what mroe you want, but this should do the main part. |
#3
|
||||
|
||||
Quote:
So i would drop the WHERE userid=X and it would scan for all? Ohh, and thanks. |
#4
|
||||
|
||||
Pretty much, yes.
You actually need to run a while. Try this: PHP Code:
PHP Code:
Edit: by the way, if your php file isn't associated with vBulletin (doesn't include global.php) you have to use mysql_query instead of $DB_site->query and mysql_fetch_array instead of DB_site->fetch_array. Also, if this is the case, you can't use templates, obviously. |
#5
|
||||
|
||||
Quote:
Yerah it's going to include global.php. so it will work, but thanks for the info. |
#6
|
|||
|
|||
If the user is logged in, just use $bbuserinfo['fieldn'] in your PHP, just as you woul d in a template.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|