MyBB Community Forums
Variable inside settings? - 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: Variable inside settings? (/thread-208375.html)



Variable inside settings? - Sazze - 2017-02-17

Question.
Is it possible to use, for example, $mybb->user['theme_hexcolor'] in the settings?

[Image: ocrjyq.png]

This will turn into:

<style>
.forum_on {
   color: #$mybb->user['theme_hexcolor'];
}
</style>

(I've tried with brackets and it doesn't make a difference).

Thanks.


RE: Variable inside settings? - dragonexpert - 2017-02-17

Its parsed as text from what I remember. What you can do is put some kind of placeholder there. Then have a plugin hook to preoutput_page and then use a string replacement function.


RE: Variable inside settings? - Sazze - 2017-02-17

(2017-02-17, 03:02 PM)dragonexpert Wrote: Its parsed as text from what I remember. What you can do is put some kind of placeholder there. Then have a plugin hook to preoutput_page and then use a string replacement function.

Alright, thanks! Smile

Edit: fixed it now, again, thank you!