ElkArte Community

Project Support => Support => Topic started by: Eliana Tamerin on February 07, 2015, 10:22:41 pm

Title: Parsing BBCode in Custom Titles
Post by: Eliana Tamerin on February 07, 2015, 10:22:41 pm
I'm looking to allow BBCode in the Custom Title (or perhaps Personal Text, haven't decided yet) on a new Elk board I'm admining. I thought it would be as simple as just adding parse_bbc() around the output variable, but looking through Profile.subs.php in the loadProfileFields function, it appears to be a bit more complex.

Any suggestions for how to go about this?
Title: Re: Parsing BBCode in Custom Titles
Post by: emanuele on February 08, 2015, 07:44:09 am
I guess it should be parsed "everywhere" (i.e. also in the mini-profile next to the posts), in that case, the best place may be Load.php, in particular loadMemberContext:
Code: [Select]
			'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '',
'blurb' => $profile['personal_text'],
to:
Code: [Select]
			'title' => !empty($modSettings['titlesEnable']) ? parse_ccb($profile['usertitle']) : '',
'blurb' => parse_bbc($profile['personal_text']),

/me is not 100% sure the lines are those, but they look pretty much what I would expect them to look like... ::)
Title: Re: Parsing BBCode in Custom Titles
Post by: Eliana Tamerin on February 08, 2015, 01:36:24 pm
Quote from: emanuele – I guess it should be parsed "everywhere" (i.e. also in the mini-profile next to the posts), in that case, the best place may be Load.php, in particular loadMemberContext:
Code: [Select]
			'title' => !empty($modSettings['titlesEnable']) ? $profile['usertitle'] : '',
'blurb' => $profile['personal_text'],
to:
Code: [Select]
			'title' => !empty($modSettings['titlesEnable']) ? parse_ccb($profile['usertitle']) : '',
'blurb' => parse_bbc($profile['personal_text']),

/me is not 100% sure the lines are those, but they look pretty much what I would expect them to look like... ::)

Worked. Thanks @emanuele.
Title: Re: Parsing BBCode in Custom Titles
Post by: emanuele on February 08, 2015, 02:33:05 pm
YAY! :D
Title: Re: Parsing BBCode in Custom Titles
Post by: Eliana Tamerin on February 08, 2015, 02:45:43 pm

I did have to correct your spelling, though. ;)
Title: Re: Parsing BBCode in Custom Titles
Post by: emanuele on February 08, 2015, 04:36:52 pm
heh...