PDA

View Full Version : BB Code Enhancements - Highlight BBCode - Highlights text with a yellow box (BB Code)


BirdOPrey5
08-07-2010, 10:00 PM
This is a simple bbcode to highlight text with a yellow box. You can of course change the color to your needs.

This has been confirmed working in the latest releases of IE, FF, Chrome, Safari, and Opera.

Demo: here. (http://www.juot.net/forums/showthread.php?p=845388&styleid=1#post845388)

Add a new BBCode

Title: Highlight
BB Code Tag Name: hl
Replacement:

<span style="background-color:yellow;color:black;">{param}</span>

OR
Replacement:

<span class="highlight">{param}</span>

(Thanks to Boofo who pointed this out, you may want to use the second option if you have a custom skin, it may look better. Best to try both and see which you prefer.)
Example: This is a highlight test
Description: This highlights selected text.
Use Option: No
Button Image: (optional) https://vborg.vbsupport.ru/external/2010/08/53.jpg

Remove Tag If Empty: Yes
All Disable Options: No

The above implementation fixes the color of the highlight at yellow and the text black for easy use. If you prefer you may also install it with a variable highlight color. If you prefer to have the user choose the highlight color then instead add the following:

Title: Highlight
BB Code Tag Name: hl
Replacement:

<span style="background-color:{option};color:black;">{param}</span>


Example: This is a highlight test
Description: This highlights selected text.
Use Option: Yes
Button Image: (optional) https://vborg.vbsupport.ru/external/2010/08/53.jpg

Remove Tag If Empty: Yes
All Disable Options: No

You can use standard color names in the option such as red, blue, green, yellow, etc...
You can also use hex color codes preceded by the # sign for exact colors, such as #0000FF
Click here for common hex color codes. (http://www.december.com/html/spec/colorhex.html)

Please mark as installed if you use this. :)

Check My Profile (https://vborg.vbsupport.ru/member.php?u=258922) for other BB Code enhancements. They work on all versions.

Screenshot:
https://vborg.vbsupport.ru/attachment.php?attachmentid=120558&stc=1&d=1281238379

Juggernaut
08-08-2010, 03:51 AM
Very nice bb code :D
it would be cool if you put the password bbcode here as well :D

Dr.osamA
08-08-2010, 09:34 AM
thanxx man

installed + 5 stars

Boofo
08-08-2010, 10:32 AM
That is already the default style highlight code in vb 4. This will do it in templates automatically.

<span class="highlight">Testing</span>

BirdOPrey5
08-08-2010, 12:02 PM
Very nice bb code :D
it would be cool if you put the password bbcode here as well :D

I didn't create that BB Code so I won't post it here but will PM you info on it... Actually it kind of stinks because the password is revealed when you quote the post, so it's just for fun. I was talking with someone about rewriting it to store them in the database but quite frankly it hasn't been a priority.

That is already the default style highlight code in vb 4. This will do it in templates automatically.

<span class="highlight">Testing</span>

I see that highlight is used when searching and such but I don't see any bb code implementation of it. If you're suggesting I use the code you posted as a replacement it's certainly just as valid but my code is more easily editable for the user to change the highlight color if so inclined. It may even be a smart idea so as not to confuse it with text highlighted by vBulletin automatically.

Boofo
08-08-2010, 12:20 PM
I was just letting you know it was already there, that's all. I didn't know if you knew it or not. I use the default highlight code for my Thread Starter in Postbit hack, that is how I knew. No offense meant, sir. ;)

BirdOPrey5
08-08-2010, 12:36 PM
No offense taken, Thanks for the info.

mitch84
08-08-2010, 01:40 PM
work fine, installed, thx

COL NIL SATIS
09-04-2010, 02:59 PM
another good one...!!!!

OldSchoolDSL
01-05-2011, 10:41 PM
Wonderful.

Installed and working

4.1 PL2

Trangalleiro
10-16-2011, 11:09 PM
Hello

Thanks BirdOPrey5 for the MOD, installed and working perfectly in 4.1.7, as always.

Sorry for my English.

Greetings, Luis.

Mr_Running
12-16-2011, 02:51 AM
Right now it highlights the bottom word.
It would be a nice improvement if it change with the increase font size and not just highlight the bottom of the word.

If the font size is increased.
How to get all of the entire word highlighted? <-- top to bottom

pantani
12-16-2011, 07:34 AM
Works well on 4.1.8 thanks :)

BirdOPrey5
12-16-2011, 10:48 AM
Right now it highlights the bottom word.
It would be a nice improvement if it change with the increase font size and not just highlight the bottom of the word.

If the font size is increased.
How to get all of the entire word highlighted? <-- top to bottom

Maybe you have a custom style? Link to your site? For most people it highlights the whole word.

Mr_Running
12-16-2011, 03:24 PM
Upgrading shortly to 4.1.9 :)

@BirdOPrey5 If it's still an issue may I send you the url by PM?

I hope your feeling better :)


Edit: Done the upgrade to 4.1.9 and the issue remains.

Mr_Running
12-16-2011, 04:00 PM
For most people it highlights the whole word.

It's really noticeable with a font of 5, 6, 7

BirdOPrey5
12-16-2011, 05:31 PM
You need to put the tags INSIDE the Size tags...

wrong:
This is BIG highlighted text.


right:
[hl]This is BIG highlighted text 2.

Example of the difference: http://www.qapla.com/mods/showthread.php/129-Highlight-BB-Code-Testing?p=283#post283

cstreater
03-23-2012, 08:26 PM
Has anyone noticed that highlight is a built in BBCode in 4.x, but for some reason they didn't include a button for it?

Code is [highlight]

Trevor Matthews
03-23-2012, 10:19 PM
Well spotted, I wonder why that isn't a button?
Thanks for the info.

Snowhog
05-23-2013, 02:51 AM
Just too cool. Another fine mini-MOD. BoP5 rocks!! Added to our BBCodes. And, this is so much better than the 'hidden' [hightlight] BBCode in 4.x

Toorak Times
05-23-2013, 08:18 AM
Has anyone noticed that highlight is a built in BBCode in 4.x, but for some reason they didn't include a button for it?

Code is [highlight]


I wonder what else is hidden in the WYSIWYG???

Webmist
01-23-2016, 04:35 PM
I've expanded on this with:
<span class="highlighter" style="background-color:{option};">{param}</span>

added this to the additional.css file:
.highlighter {padding-top: 2px; padding-left: 5px; border: 2px solid #333333; color: #333333;}

You could even make a duplicate (i.e. hl16) and add font size 16px to the CSS by changing .highlighter to .hl16.