![]() |
Getting User Input in Profile
Hello,
I have created a custom field for the users profile. I need to get that value when they save their changes so I created a plugin that gets executed on the profileupdate event. However I cannot work out how to get the value that was entered in the custom field - which is field6 I have tried: PHP Code:
PHP Code:
Can someone please tell me what object or var I need to access to get the posted field value. Cheers Marc |
erm,
if you want it in your postbit, you can use the existing code $post[fieldx] in your postbit template if you want it in the profile or members list then use the existing code $userinfo[fieldx] in the template. No need to write your own plugin to pull info that is already available at the touch of a few keys |
The best to do this would be to use hook location 'userdata_presave' ('userdata_postsave' is probably also possible). You will be hooking directly into the Data Manager, so it will even work if you change the field from the AdminCP.
New value: $this->userfield['fieldX'] Old value: $this->existing['fieldX'] |
Hello MarcoH64,
Than you very much for responding - your solution worked 100% ! Cheers Marc Hello peterska2, Thank you for responding. Could you please tell me where I can get information on what is a postbit. Cheers Marc |
'postbit' or 'postbit_legacy' is the template used to display a post. She misunderstood your question i think.
|
I did. I thought you meant getting it to display. It's what I get for replying when I'm awake instead of asleep!
|
All times are GMT. The time now is 10:09 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:
|