MyBB Community Forums

Full Version: Parse HTML in Custom Profile Fields
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know there's a general advisement against this, but regardless, I would like to allow my users to be able to use html in custom profile fields.

I'd like it to parse both on their profiles and in postbits.

And, I'd also like html I use in field descriptions and in options (i.e., using images/links in descriptions and as options for checkboxes) to parse on the editing profile pages for users/mods/etc.

How do I go about this?
Are you sure you would not rather allow MyCode?

There are plugins that make that possible.
Positive. I've already installed the MyBB bits. Particularly for the fields that are only editable by mods/admins I need the html to parse
I haven't tested this, but you might want to give this a go.

In functions_post.php, remove the following chunk of code.
	// Sanatize our custom profile fields for use in templates, if people choose to use them
	foreach($post as $post_field => $field_value)
	{
	    if(substr($post_field, 0, 3) != 'fid')
	    {
	        continue;
	    }
	    $post[$post_field] = htmlspecialchars_uni($field_value);
	}
I'm not sure if there will be an repercussions though, and you'll definitely want to think about using some sort of filter.