MyBB Community Forums

Full Version: Fix HTML UserTitle in profile
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello MyBB and good evening.
I had a problem with the usertitle that it was shown as text instead of working html
for example: the user titlte was <font color="blue"><b>Moderator</b></font>
instead of showing it like this: Moderator
It was shown like <font color="blue"><b>Moderator</b></font> .
I succeed to fix it in postbits and PM's
but in profile its still bugged and Idk what is the problem in fucntion usertitle.

Anybody knows how to fix it?
I'm using MyBB 1.8.12

Thanks a lot.

?.....
You could use this:
https://community.mybb.com/thread-226960.html

<if $mybb->user['usergroup'] == "6" then>
<font color="blue"><b>{$post['usertitle']}</b></font>
<else>
{$post['usertitle']}
</if>
(2020-05-17, 12:57 PM)Alexander L. Wrote: [ -> ]You could use this:
https://community.mybb.com/thread-226960.html

<if $mybb->user['usergroup'] == "6" then>
<font color="blue"><b>{$post['usertitle']}</b></font>
<else>
{$post['usertitle']}
</if>
in user profile you don't use {$[post['usertitle']} function you use: {$usertitle}
i need to make it run as html and not only as text because it shows me (and its important to mention- only in user profile) the html tags
and not the real usertitle
(2020-05-17, 01:40 PM)UniqueMU Wrote: [ -> ]
(2020-05-17, 12:57 PM)Alexander L. Wrote: [ -> ]You could use this:
https://community.mybb.com/thread-226960.html

<if $mybb->user['usergroup'] == "6" then>
<font color="blue"><b>{$post['usertitle']}</b></font>
<else>
{$post['usertitle']}
</if>
in user profile you don't use {$[post['usertitle']} function you use: {$usertitle}
i need to make it run as html and not only as text because it shows me (and its important to mention- only in user profile) the html tags
and not the real usertitle

I used postbit, my bad. Simple fix though, it should work if you installed the plugin template conditionals.
@UniqueMU how did you fix it for postbit? You can apply the same if in profile.
(2020-05-17, 01:48 PM)chack1172 Wrote: [ -> ]@UniqueMU how did you fix it for postbit? You can apply the same if in profile.
The fix is disabling a function called htmlspecialchar_uni. but in usertitle you don't have that function
I tried to read a bit in php functions how I force the variable to run in browser run (that the tag will be included in html) but didn't success..
any suggestions?
In file member.php try disabling the htmlspecialchars at line 2512. It's not safe to remove it because users can set their own custom user title.
it would be better to modify the relevant templates & add required style like this => Link