Highlight posts with a button

Started by Mick, Jul 31, 2018

Jul 31, 2018 Last Edit: Feb 05, 2019 by Mick

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.

Save this image:  and upload it to /Themes/your-theme/images/bbc folder.

The CSS:
Open ---->  /Themes/your-theme/css/index.css and at the very end add:
.highlight-text {
        background-color: #ffff88;

To change the highlight color, replace #ffff88; in the css file to suit your needs

Open  -----> /Themes/default/languages/Modifications.english.php and add before the ?>
$txt['highlight-text'] = 'Highlight';

Open ----->  /Sources/Subs-Editor.php and find:
                'image' => 'quote',
                'code' => 'quote',
                'before' => '[quote]',
                'after' => '[/quote]',
                'description' => $txt['bbc_quote']

Add after:
                'image' => 'highlight-text',
                'code' => 'highlight-text',
                'before' => '[highlight-text]',
                'after' => '[/highlight-text]',
                'description' => $txt['highlight-text']

Open ---->  /Sources/Subs.php and find:
                'tag' => 'table',
                'before' => '<table class="bbc_table">',
                'after' => '</table>',
                'trim' => 'inside',
                'require_children' => array('tr'),
                'block_level' => true,

Add before:
                'tag' => 'highlight-text',
                'before' => '<span class="highlight-text">',
                'after' => '</span>',