![]() |
conditional in member profile plugin
I created a custom profile field with the ID 44 and entered a string in that field for my account.
Then I wrote a simple "hello world" plugin that looks like this: PHP Code:
The first echo is executed on the member profile, the other echo is not executed. How can I fix this? Or do I have to write a query to get the profile field in the plugin? $post['field44'] does not work and neither does $userinfo['field44'] on that plugin. Later, I want to write a conditional and display some variables in the templates. But I first need to know how to access the custom profile field from the member profile plugin. |
You shouldn't echo directly to the browser. Place the variable in a template.
For the browsing user $bbuserinfo[field44] should work. For the member who's profile you are browsing you may need to use $prepared[field44] or $userinfo[field44] |
Doesn't matter if I echo it directly or use it in a template. It's for testing purposes only.
As I said, once I see that the variable is not empty, I will use it for a condition in the plugin. $bbuserinfo[field44] does not work in the plugin. :( --------------- Added [DATE]1216494701[/DATE] at [TIME]1216494701[/TIME] --------------- Take for example this plugin code: PHP Code:
|
Oh wait, plugin...
My bad I forgot. Try $vbulletin->userinfo instead of $bbuserinfo. Use var_dump() instead of echo() it provides more info. |
Thanks, man. That worked. :)
|
All times are GMT. The time now is 02:42 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|