MyBB Community Forums
Access parsed profile fields from template? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Development (https://community.mybb.com/forum-68.html)
+---- Thread: Access parsed profile fields from template? (/thread-205560.html)



Access parsed profile fields from template? - chain - 2016-11-01

Hi there!

I am developing a plugin using the parse_message hook. So far, so good. However I am including some profile fields using $post['fidXX'] etc. And here the problem starts. Afforementioned variable always shows the "raw" (e.g. non-parsed) profile fields straight from the database. I have ticked to allow MyCode and HTML, but the field is raw, as I already confirmed by reading the source.

So, how do I get around this? I would like to show a given profile field after being parsed in postbit and memberprofile. I cannot use "show in profile/postbit" because of theming (the fields are split in the theme).


RE: Access parsed profile fields from template? - Shade - 2016-11-01

I guess instantiating the parser within parse_message should produce a recursive loop. There's really nothing you can do in this case other than choosing another suitable hook.


RE: Access parsed profile fields from template? - dragonexpert - 2016-11-01

If you are trying to do something for each post, I'd actually say to use the hook postbit. The old version of Social Groups I created a hook like that and it worked perfectly.


RE: Access parsed profile fields from template? - chain - 2016-11-01

Yeah, I was already thinking about that for the posts. But what to do with the user profiles? Is there any suitable hook at all?


RE: Access parsed profile fields from template? - dragonexpert - 2016-11-01

member_profile_end maybe?


RE: Access parsed profile fields from template? - chain - 2016-11-02

I'll try that, thanks.