Html or MyCode in Custom Profile Fields
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #1
Html or MyCode in Custom Profile Fields
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!
03-18-2012 10:22 AM
Find all posts by this user Quote this message in a reply
Sama34 Offline
Senior Member
****
Posts: 490
Joined: May 2011
Post: #2
RE: Html or MyCode in Custom Profile Fields
That plugin works fine, I think. At least for profile in 1.6.6

For postbit, you will need another one.

Support PM's will be ignored. Yipi
Plugins: Announcement Bars - Custom Reputation - Mark PM As Unread
03-18-2012 01:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #3
RE: Html or MyCode in Custom Profile Fields
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?
03-18-2012 10:49 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #4
RE: Html or MyCode in Custom Profile Fields
What MyCode you're trying to use with that plugin?

03-24-2012 06:16 AM
Find all posts by this user Quote this message in a reply
lilah Offline
Junior Member
**
Posts: 18
Joined: Mar 2012
Post: #5
RE: Html or MyCode in Custom Profile Fields
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...

03-24-2012 07:11 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #6
RE: Html or MyCode in Custom Profile Fields
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.


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 03-24-2012 07:19 AM by leefish.)
03-24-2012 07:19 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #7
RE: Html or MyCode in Custom Profile Fields
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.

03-25-2012 02:52 PM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #8
RE: Html or MyCode in Custom Profile Fields
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:
1
2
3
4
5
6
7
8
9
<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



[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 03-25-2012 08:38 PM by leefish.)
03-25-2012 08:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #9
RE: Html or MyCode in Custom Profile Fields
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));
?>


03-26-2012 07:51 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #10
RE: Html or MyCode in Custom Profile Fields
Outstanding - thank you very much Biggrin


[Image: leelink.gif]
MYBB1.6 & XThreads
03-26-2012 08:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: