MyBB Community Forums

Full Version: Parse HTML in Custom Profile Field?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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?
Well, use this plugin: http://mybbhacks.zingaburga.com/showthre...271&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.
(2014-03-19, 09:27 PM)Destroy666 Wrote: [ -> ]Well, use this plugin: http://mybbhacks.zingaburga.com/showthre...271&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!
You said postbit in OP and now you are showing profile.. Also I can't see any "CUSTOM USER IMAGE" there.
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
(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?
I told you the correct variable above.....
(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.
Simply use RateU's plugin, then read:
http://mybbhacks.zingaburga.com/showthre...3#pid10603
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.
Pages: 1 2