Skip to main content
Topic: Parsing BBCode in Custom Titles (Read 2409 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Parsing BBCode in Custom Titles

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?

Re: Parsing BBCode in Custom Titles

Reply #1

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']),

 emanuele is not 100% sure the lines are those, but they look pretty much what I would expect them to look like... ::)
Bugs creator.
Features destroyer.
Template killer.

Re: Parsing BBCode in Custom Titles

Reply #2

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']),

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

Worked. Thanks @emanuele.

Re: Parsing BBCode in Custom Titles

Reply #3

YAY! :D
Bugs creator.
Features destroyer.
Template killer.


Re: Parsing BBCode in Custom Titles

Reply #5

heh...
Bugs creator.
Features destroyer.
Template killer.