BBC code in the "Subject:"

Started by Srinib, July 06, 2012, 01:40:52 AM

Previous topic - Next topic

Srinib

Can't we use BBC code in the Subject line?

I may want to use the subject line for this topic as,


BBC code in the Subject:
or
BBC code in the Subject:
or
BBC code in the Subject:


I think it is not a standard feature. Do we have any MOD for that?

nend

I don't know about a mod but you can find all instances of the subject in your template and edit them like so.

Say you have
context['subject']

Change it to this
parse_bbc($context['subject'], false, false, array('b','i','u'))

Now you have BBC in your title.

However this may break your page title, you can use strip_tags for this though.

In your template index.template.php find

Find
', $context['page_title_html_safe'], '

'. strip_tags(parse_bbc($context['page_title_html_safe'], false, false, array('b','i','u'))). '

There is allot more to do on it though, mainly finding all the subject areas in the template and editing them. This is the simple way though, you can also do it within the source which might be a little advance.

Sorry though I don't have enough time to explain in more detail right now, search though the modifications there might be a mod already that does this.

Arantor

The biggest reason not to do it is performance. The bbc parser is an absolute monster of code and running it many many more times than necessary is a really bad idea.

(There's a reason it takes up 40% of Subs.php)
Holder of controversial views, all of which my own.


Srinib

Quote from: Arantor on July 06, 2012, 10:32:50 AM
The biggest reason not to do it is performance. The bbc parser is an absolute monster of code and running it many many more times than necessary is a really bad idea.

(There's a reason it takes up 40% of Subs.php)

If performance is the reason behind that, then i really don't want to incorporate this feature for my forums.
Arantor, can you please tell me what MOD(or an existing SMF feature) you have used to get that small Facebook icon beneath your avatar?


Srinib

Quote from: live627 on July 06, 2012, 02:53:42 PM
http://www.simplemachines.org/community/index.php?topic=475020.0

Thanks for the quick response. But how come i can't find those details in the Forum profile in my forum? My forum runs on 2.0.2. And so is SMF. But i see those details in my SMF account.

BTW, i have gone to your MOD section. There is a long list of some really usefull MODs. Great job.

Arantor

Your question was answered in that very thread.
Holder of controversial views, all of which my own.


Advertisement: