News:

SMF 2.1.3 has been released! Take it for a spin! Read more.

Main Menu

Highlight Any Text In Your Posts Using a BBC Button

Started by Mick., September 14, 2013, 11:59:18 AM

Previous topic - Next topic

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.

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


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


Westwegoman


Mick.

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.

Westwegoman

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.

Rain Forest

#5
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';

Mick.

@Soft Drink, You are correct. My mistake. I edited the first post.

/Themes/default/languages/Modifications.english.php

Rain Forest


Westwegoman

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.


vishwasets


Advertisement: