MyBB Hacks

Full Version: Html or MyCode in Custom Profile Fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello,
is there a way to allow my users zu use html and/or MyCode in the custom profile fields? I know there is this plugin but it does not fully work in MyBB 1.6 and it only displays html on the profile page. I would like it if the html was also displayed on the postbit. How can I achieve that?

I hope someone can help me with that. thanks in advance!
That plugin works fine, I think. At least for profile in 1.6.6

For postbit, you will need another one.
thanks a lot for the answer, I already tried the plugin and it's not completely working (you can not use MyCode even if its activated). Only being able to allow html is fine with me as long as it is displayed in the postbit too. is there maybe a way to modify the code so that the plugin also affects the postbit?
What MyCode you're trying to use with that plugin?
I'm sorry, I got it a little mixed up. You can allow MyCode and it does work on the profile page, Html is the one that does not work, tried it with

Code:
[b]text[/b] <b>text</b>


but like I said, only being able to allow Html or MyBB would be totally fine with me, I just really really want it to work on the postbits too...

Yes, I have a similar thing here - I also rather wanted the plugin in question to work with the BB code in the post bit - as an extra field outside the message area.

I can easily set it so that a user can add data in a thread field which is then shown on the post, but in my specific case I want a TOU to show on each upload. I have the profile field showing fine, but as it is not parsed it looks rather rubbish.
It is because (I think) there is a htmlspecialchars_uni() there. Maybe you can remove it (by using the plugin, the customfields use the parser options).
Do that (use the parser options) in your function_post too for postbit.
As usual, just be careful for allowing HTML there.
I think (only my personal opinion) it is better to do that per Custom Profile Fields rather than general settings.
Hmm, I am not sure what you mean exactly RateU, so I will give a bit more info:

I have a Custom Profile Field, fid6. It is a textarea field. As far as I know, without this plugin, then it is not possible to use BBCode in Profile fields.

I have a template conditional in my postbit:

Code:
<if ($post['fid6'] !="") then>

<div class="buttons" title="user policy">
<a href="javascript:;" onclick="Element.toggle('policy'); 
($('policy').visible() == false) ? $('policy2').update('Show Uploader Sharing Policy') : $('policy2').update('Hide Uploader Sharing Policy');" 
id="policy2">Show Uploader Sharing Policy</a>
</div>
<div id="policy" style="display: none;"><func nl2br>{$post['fid6']}</func></div>
</if>


The text from the profile field does display only if there is a value, and it was all on one line, no new lines. So I added the <func nl2br> in the postbit conditional. However, if there is a mycode in the text then it does not display formatted. Eg

Code:
[b]My Policy[/b] Bla bla bla

If you are using PHP In Template plugin, maybe there is a chance for that.
Something like this:

PHP Code:
<?php
echo $parser->parse_message(htmlspecialchars_decode($post['fid6']),array('allow_mycode'=>1));
?>

Outstanding - thank you very much Biggrin
Pages: 1 2
Reference URL's