Uutiset:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu
Advertisement:

Blink Tag?

Aloittaja Senkusha, toukokuu 02, 2005, 10:00:29 AP

« edellinen - seuraava »

Senkusha

Where would I add the ability to support the <blink> html tag?
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

shanks

In subs.php

Find
'~\[s\](.+?)\[/s\]~i' => isset($disabled['s']) ? '$1' : '<del>$1</del>',

Add after
'~\[blink\](.+?)\[/blink\]~i' => isset($disabled['blink']) ? '$1' : '<blink>$1</blink>',

I have no idea how it works, but it does  :D

Senkusha

I tried adding that, but it does not work.
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

shanks

Are you using [blink] and [/blink], or <blink> and </blink>?

For this to work you have to use [blink] and [/blink].

-shanks

Senkusha

I found the problem.  the Blink tag is not directly supported by IE.  So, instead, I had to use the tag in combination with the following JavaScript:


<script type="text/javascript">
function blinkIt() {
if (!document.all) return;
else {
   for(i=0;i<document.all.tags(\'blink\').length;i++){
      s=document.all.tags(\'blink\')[i];
      s.style.visibility=(s.style.visibility==\'visible\')?\'hidden\':\'visible\';
   }
}
}
</script>


And then, I had to change the following:


<body onload="setInterval(\'blinkIt()\',500)">


This was all done in the index.template.php file.

With this code, I can control how fast it the blinks blink by changing the parameter in the setInterval funtion.  What would  be even more cool, would be an optional argument in the [blink] tag itself to set the speed.  I'm not sure if SMF supports optional attributes though.
-- Senkusha
The Kawaii Klub
The Creative Anime Role Playing Community.
(SMF v. 2.1.4, PHP v. 8.0)

RomanyX

Senkusha, I'd love to see this tag developed further.

SMF does support optional attributes. See Sheepy's Enhanced Move Tag for a great example. :D

Also, please let me know if you are interested in coming up with javascripts to make some other tags universal.  ???

Advertisement: