Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: Mick. on September 14, 2013, 11:59:18 AM

Title: Highlight Any Text In Your Posts Using a BBC Button
Post by: Mick. on September 14, 2013, 11:59:18 AM
(http://www.idesign360.com/community/images/bbchighlighter.png)

Highlight pieces of text in your posts and other parts of your forum using a bbc button in SMF. A light background color will wrap your texts to call your users attentions. Useful for making lists, titles, rules page, etc. Very easy to implement in SMF with a few small edits.

Demo: http://www.idesign360.com/community/index.php/page,bbc_text_highlighter.html

Download this .gif image and upload it to /Themes/your-theme/images/bbc/highlight-text.gif
(http://www.idesign360.com/community/Themes/pixel/images/bbc/highlight-text.gif)

The CSS: Open /Themes/your-theme/css/index.css and add at the very end:

.highlight-text {
        background-color: #FFFF88;
}


Open /Themes/default/languages/Modifications.english.php and add

$txt['highlight-text'] = 'Highlight';

before the ?>

Open: /Sources/Subs-Editor.php and find:

array(
'image' => 'quote',
'code' => 'quote',
'before' => '[quote]',
'after' => '[/quote]',
'description' => $txt['bbc_quote']
),


Add after:

array(
'image' => 'highlight-text',
'code' => 'highlight-text',
'before' => '[highlight-text]',
'after' => '[/highlight-text]',
'description' => $txt['highlight-text']
),


Open: /Sources/Subs.php and find:

array(
'tag' => 'table',
'before' => '<table class="bbc_table">',
'after' => '</table>',
'trim' => 'inside',
'require_children' => array('tr'),
'block_level' => true,
),


Add before:

array(
'tag' => 'highlight-text',
'before' => '<span class="highlight-text">',
'after' => '</span>',
),
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Burke ♞ Knight on September 14, 2013, 12:08:29 PM
(http://www.katzy.dsl.pipex.com/Smileys/thanks3.gif)
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Westwegoman on September 15, 2013, 10:45:45 PM
Simple add but would still be nice as a mod. ;D
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Mick. on September 15, 2013, 11:30:47 PM
Quote from: Westwegoman on September 15, 2013, 10:45:45 PM
Simple add but would still be nice as a mod. ;D
too small to be a mod. Any average joe can do this manually. In fact, I think all bbc mods like this should be here on this board rather into a mod.
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Westwegoman on September 15, 2013, 11:44:05 PM
Quote from: Mick. on September 15, 2013, 11:30:47 PM
too small to be a mod. Any average joe can do this manually.
True... But would have been nice for adding to multiple forums instead of manually to each one. Guess I need to figure out how to put this into a package for my use then.
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Rain Forest on September 16, 2013, 05:19:30 AM
Thanks Mick :)

/I had to make a manual ThemeStrings.english.php file :)

Hmm errors :P

8: Undefined index: highlight-text
Apply Filter: Only show the errors from this file
File: /var/www/vhosts/ .. / .. /forum/Sources/Subs-Editor.php
Line: 1715


For 2.x users who doesn't seem to have the ThemeStrings.english.php they have to put it in /languages/index.english.php and post.english.php (It helped for me).

$txt['highlight-text'] = 'Highlight';
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Mick. on September 16, 2013, 08:10:50 AM
@Soft Drink, You are correct. My mistake. I edited the first post.

/Themes/default/languages/Modifications.english.php
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Rain Forest on September 16, 2013, 08:27:33 AM
Nice Tip BTW :)
Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: Westwegoman on October 26, 2013, 10:07:54 PM
Being an old Yabb user, I went ahead and made a mod file for Boardmod so I could do multiple forums with ease.

Not attaching the mod file since I don't know if that would be allowed but attached to this post is another bbc button that I put together, if anybody wants it.

Title: Re: Highlight Any Text In Your Posts Using a BBC Button
Post by: vishwasets on November 15, 2013, 07:07:23 AM
Nice to read it,Thank you for sharing.