MyBB Community Forums
Parse HTML in Custom Profile Field? - 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 Support (https://community.mybb.com/forum-72.html)
+---- Thread: Parse HTML in Custom Profile Field? (/thread-152038.html)

Pages: 1 2


Parse HTML in Custom Profile Field? - RocketFoot - 2014-03-19

I need to allow HTML to parse in a custom profile field in order to display a custom user image in the postbit for individual members. (It would be hidden and only editable by admin)

Any one know how to accomplish this? Or is there a better way to add custom user images in postbit?


RE: Parse HTML in Custom Profile Field? - Destroy666 - 2014-03-19

Well, use this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=1271&page=1

As I see you responded there - you need to add profile field variable to postbit to display it, of course. It is: {$xtpf['fidX']} where X is the field number.


RE: Parse HTML in Custom Profile Field? - RocketFoot - 2014-03-19

(2014-03-19, 09:27 PM)Destroy666 Wrote: Well, use this plugin: http://mybbhacks.zingaburga.com/showthread.php?tid=1271&page=1

As I see you responded there - you need to add profile field variable to postbit to display it, of course. It is: {$xtpf['fidX']} where X is the field number.

I've tried this but It doesn't work...I am just getting raw html in the profile page view...see "CUSTOM USER IMAGE" here:

http://www.7173mustangs.com/user-don65stang

I've checked and rechecked everything and I am baffled!


RE: Parse HTML in Custom Profile Field? - Destroy666 - 2014-03-19

You said postbit in OP and now you are showing profile.. Also I can't see any "CUSTOM USER IMAGE" there.


RE: Parse HTML in Custom Profile Field? - cafeína - 2014-03-19

My bad, you are talking about postbit , not CP
EDITED--------------------

In my forum, I have to show a link in the custom fields, like so:

[Image: 12Kyt3w.jpg]

The configuration in control panel is as follows:

Nombre: Aviso Legal
Descripción corta: <a href="http://www.URL.com/foro/misc.php?page=lopd" target="_blank">Política de Protección de Datos</a>
Tipo: caja de validación
Opciones seleccionables: Acepto
Requerido: si
Editable: si
Oculto:si

the problem is that if you don't do anything, what it will show the description is not the URL but <a href="http://www.URL.com/foro/misc.php?page=lopd" target="_blank">Política de Protección de Datos</a>

To "fix that", I modified usercp.php with this (line 443)

if (strcmp($profilefield['name'], "Aviso Legal")==0) {
$url_legal="http://www.URL.com/foro/misc.php?page=lopd";
$profilefield['description'] = "<a href=$url_legal target=_blank>Pol&iacute;tica de protecci&oacute;n de datos</a>";
}


I think you can adapt it for showing image.
regards


RE: Parse HTML in Custom Profile Field? - RocketFoot - 2014-03-20

(2014-03-19, 10:39 PM)Destroy666 Wrote: You said postbit in OP and now you are showing profile.. Also I can't see any "CUSTOM USER IMAGE" there.

Sorry, I have the custom field set to be hidden so guests cant see it...(See Screen Cap below)

I did get the image to show in the profile page but when I ad {$post['fid13']} into the post bit, it shows the raw URL! I basically half fixed it, LOL!

How can I get the image to show in the postbit now?


RE: Parse HTML in Custom Profile Field? - Destroy666 - 2014-03-20

I told you the correct variable above.....


RE: Parse HTML in Custom Profile Field? - RocketFoot - 2014-03-20

(2014-03-20, 01:18 AM)Destroy666 Wrote: I told you the correct variable above.....
Sorry, I thought I mentioned this...
I couldn't get that plugin to work so I switched to Mybbcode in Custom Fields plugin. That is the only way I could get the image to even display in the profile page. I just need to get it into the postbit now.


RE: Parse HTML in Custom Profile Field? - Omar G. - 2014-03-20

Simply use RateU's plugin, then read:
http://mybbhacks.zingaburga.com/showthread.php?tid=1271&pid=10603#pid10603


RE: Parse HTML in Custom Profile Field? - Leefish - 2014-03-20

what you could do is use php in templates -
<if !empty($post['fidX']) then>
<?php
echo $parser->parse_message(htmlspecialchars_decode($post['fid4']),array('allow_imgcode'=>1));
?></if>

Code not tested.