PDA

View Full Version : BB Code Enhancements - Blink BBCode- The Ultimate BB Code!


BirdOPrey5
07-06-2010, 10:00 PM
Back in the day Netscape made the <blink> tag, and it was good...
But then all the hater's rose up and effectively destroyed the humble <blink> tag in an attempt to strip it of its pure awesomeness and erase any trace of its existence from history. This can not be allowed to happen so I present the BLINK BB Code... There is another Blink BB Code for 3.7 but problems have been reported using it in 3.8 while this one works. You also don't need to disable other bbcode or smilies like in the original version.

New!!! - See Post #2 for a version that works in all major web browsers.

It is currently working in IE, Firefox, and Opera. It is not working in Safari and Chrome, for my site that is less than 12% of all traffic so I can deal with some people not seeing this amazing tag... for them text just won't blink, there is no error. It requires JavaScript to be active.

This is based off of code found here (http://www.siteexperts.com/tips/html/ts12/page2.asp) and their copyright remains intact. I have made some additions for increased compatibility.

Demo: here. (http://www.juot.net/forums/showthread.php?p=826483#post826483)

Add a new BBCode

Title: Blink
BB Code Tag Name: blink
Replacement:

<SCRIPT>
// Before you reuse this script you may want to have your head examined
//
// Copyright 1999 InsideDHTML.com, LLC.

function doBlink() {
// Blink, Blink, Blink...
var blink = document.all.tags("BLINK")
for (var i=0; i < blink.length; i++)
blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

function startBlink() {
// Make sure it is IE4
if (document.all)
setInterval("doBlink()",1000)
}
window.onload = startBlink;
</SCRIPT>
<blink>{param}</blink>


Example: test blink
Description: This code makes text Blink in IE, FF, and Opera
Use Option: No
Button Image: (optional) https://vborg.vbsupport.ru/external/2010/07/7.jpg
Remove Tag If Empty: Yes
All Disable Options: No

Unlike the other blink bbcode you can have line-breaks in this code...

line 1
line 2

works just as well as line 1. line 2.

Please mark as installed if you use this. :)

BirdOPrey5
08-16-2010, 03:27 AM
I have a new version that works in ALL major browsers including: IE / Firefox / Chrome / Opera and Safari! This is a little more complicated to implement so if you're happy with the existing tag there is no NEED to upgrade, however this new version works on more (all) browsers.

It makes use of the jquery javascript library.

Step 1. Download the attachment, unzip, and upload the 2 .js files it to your /clientscript/ directory. (This may be under /forums/clientscript/ or any other directory you have your forums installed in.)

Step 2. Admin CP -> Styles and Templates -> Style Manger -> Choose your style(s) -> All Style Options: Edit your header include template and add the following code at the bottom of it:

<!-- Start Blinking Text jquery Script-->
<script src="/forums/clientscript/jquery-1.4.2.min.js" language="javascript" type="text/javascript"></script>
<script src="/forums/clientscript/jquery-blink.js" language="javscript" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function()
{
$('.blink').blink();
});
</script>
<!-- End Blinking Text jquery Script-->

Make sure you change the file paths to the two .js files to match your directory setup. For me it's "/forums/clientscript/filename.js" If your forums are in your web root your location may be just "/clientscript/filename.js".


Step 3. Make a new BB Code using the instructions in the first post or edit your existing blink bb code. Use the following replacement code instead of the replacement in the first post. (much shorter):
<span class="blink">{param}</span>

Save your new or edited BB Code and you're done. You know have a [bkink] tag that works in all major browsers.

Note: Updated to latest jquery release 1.4.2 on Aug 16, 2010

Boofo
08-16-2010, 04:04 AM
Why was my post deleted here?

BirdOPrey5
08-16-2010, 01:02 PM
Why was my post deleted here?

Weird... I saw it last night before I went to bed and was going to respond to it this morning. :confused:

Anyway, Boofo had provided code that would link to the latest jquery javascript from their own servers to save you from having to upload 1 file and never worry about it being out of date...

That is certainly possible although I usually prefer to host all files locally if at all possible so I'm not dependent on someone else's servers, no matter how reliable they are.

BirdOPrey5
08-16-2010, 01:06 PM
Why was my post deleted here?

Actually you posted in the 4.0 version of this code, I release them for both 3.8 and 4 because people don't usually check other versions for mods.

Boofo
08-16-2010, 03:30 PM
Ah, ok, so I did. My bad. Sorry about that.

I do agree that maybe hosting the file yourself is a better idea as I use that same file for another fix on my site. The latest version is 1.42 I believe so it might be a good idea to grab it from that link. ;)

BirdOPrey5
08-16-2010, 05:16 PM
Thanks, I have updated the post to the latest release, 1.4.2

mholtum
11-17-2010, 11:24 PM
I installed this and it is working great, thank you. I just have once concern, if you change the color of text with bbcode, the the blink bbcode doesnt work.

I do have remove tag is empty enabled and the rest disabled.

BirdOPrey5
11-18-2010, 12:09 AM
That is unusual... which version are you using, the original or the jquery version?

I tested this on my site and it is working with the color code both inside or outside of the [blink] tag. You can see it here:
http://www.juot.net/forums/showthread.php?t=50044

If you could also give me a link to a post where it's not working on your forum I'll take a look.

ShawneyJ
06-02-2014, 10:48 AM
this is cool. thanks. but does not seem to work on the most latest Firefox. latest IE=Works. Previous version FF on my XP=Works.
V3.8.7. cheers.

Midohash
06-06-2014, 10:29 PM
Very interesting ... works well on Chrome ... Can blink images as well not only text! ... Installed ... Thank you :up:

Demo (http://www.almatareed.org/vb/showpost.php?p=1897867&postcount=3)

Is it possible to add it to the quick reply box as well?

BTW how can I reduce the blink frequency rate?

Perrier Sophie
06-11-2014, 12:18 AM
Nice bbcode

installed

thanks