Advertisement:

Author Topic: __For those 1.x users who can't get the Shadow tag to work__  (Read 15095 times)

Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
__For those 1.x users who can't get the Shadow tag to work__
« on: August 28, 2009, 01:30:18 PM »
Most of my posters use Firefox.  The Shadow tag has never worked for us.  I've read that it only works for IE but my posters kept nagging me about it.... *sigh*......  that's what they do.

So, out of desperation, I found the code in Subs.php

Code: [Select]
array(
'tag' => 'shadow',
'type' => 'unparsed_commas',
'test' => '[#0-9a-zA-Z\-]{3,12},(left|right|top|bottom|[0123]\d{0,2})\]',
'before' => $context['browser']['is_ie'] ? '<span style="filter: Shadow(color=$1, direction=$2); height: 1.2em;\">' : '<span style="text-shadow: $1 $2">',
'after' => '</span>',
'validate' => $context['browser']['is_ie'] ? create_function('&$tag, &$data, $disabled', '
if ($data[1] == \'left\')
$data[1] = 270;
elseif ($data[1] == \'right\')
$data[1] = 90;
elseif ($data[1] == \'top\')
$data[1] = 0;
elseif ($data[1] == \'bottom\')
$data[1] = 180;
else
$data[1] = (int) $data[1];') : create_function('&$tag, &$data, $disabled', '
if ($data[1] == \'top\' || (is_numeric($data[1]) && $data[1] < 50))
return \'0 -2px\';
elseif ($data[1] == \'right\' || (is_numeric($data[1]) && $data[1] < 100))
return \'2px 0\';
elseif ($data[1] == \'bottom\' || (is_numeric($data[1]) && $data[1] < 190))
return \'0 2px\';
elseif ($data[1] == \'left\' || (is_numeric($data[1]) && $data[1] < 280))
return \'-2px 0\';
else
return \'0 0\';'),
),


and replaced it with this:

Code: [Select]
array(
'tag' => 'shadow',
'type' => 'unparsed_commas',
'test' => '[#0-9a-zA-Z\-]{3,12},(left|right|top|bottom|[0123]\d{0,2})\]',
'before' => $context['browser']['is_ie'] ? '<span style="display: inline-block; filter: Shadow(color=$1, direction=$2); height: 1.2em;">' : '<span style="text-shadow: $1 $2">',
'after' => '</span>',
'validate' => $context['browser']['is_ie'] ? create_function('&$tag, &$data, $disabled', '
if ($data[1] == \'left\')
$data[1] = 270;
elseif ($data[1] == \'right\')
$data[1] = 90;
elseif ($data[1] == \'top\')
$data[1] = 0;
elseif ($data[1] == \'bottom\')
$data[1] = 180;
else
$data[1] = (int) $data[1];') : create_function('&$tag, &$data, $disabled', '
if ($data[1] == \'top\' || (is_numeric($data[1]) && $data[1] < 50))
$data[1] =  \'0 -2px 1px\';
elseif ($data[1] == \'right\' || (is_numeric($data[1]) && $data[1] < 100))
$data[1] = \'2px 0 1px\';
elseif ($data[1] == \'bottom\' || (is_numeric($data[1]) && $data[1] < 190))
$data[1] = \'0 2px 1px\';
elseif ($data[1] == \'left\' || (is_numeric($data[1]) && $data[1] < 280))
$data[1] = \'-2px 0 1px\';
else
$data[1] = \'1px 1px 1px\';'),
),




and now it works (for us) in Firefox, Safari and Opera.   I'm no coder, trust me.  All this is, is the code from 2.x's Subs.php and, if it's a bad idea, someone whack my hands with a ruler and I'll go quietly. 

 :-[

It's just that, while searching, I ran across several threads where others wanted it to work and I did, too ....  and, well, it does, now, with no errors.


It may not for you.   You may want to try it on a test board, first. 

If you have questions, I'm pretty much done.  All I can do, at this point, is tell you how great you look and smile alot.      :D
« Last Edit: August 28, 2009, 01:39:44 PM by gbsothere »
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.
I Don't Want To Grow Old Alone

It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.


A reminder about admin / ftp passwords etc.

Offline cblaber

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 11,271
  • Gender: Male
    • cmblaber on LinkedIn
Re: __For those 1.x users who can't get the Shadow tag to work__
« Reply #1 on: August 28, 2009, 03:46:34 PM »
Moved to Tips and Tricks and added this to our index. :)
« Last Edit: August 28, 2009, 05:15:06 PM by Shadow82x »
Colin Blaber
Former Customize & Support Team Member

Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
Re: __For those 1.x users who can't get the Shadow tag to work__
« Reply #2 on: August 28, 2009, 03:58:14 PM »
I'm honored!   :D

Thanks!



My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.
I Don't Want To Grow Old Alone

It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.


A reminder about admin / ftp passwords etc.

Offline Batchfiles

  • Newbie
  • *
  • Posts: 4
Re: __For those 1.x users who can't get the Shadow tag to work__
« Reply #3 on: August 29, 2009, 01:32:24 PM »
Brilliant, thank you.

Offline LHW

  • Jr. Member
  • **
  • Posts: 311
  • Gender: Male
  • I am The Lord thy Warlock.
    • The Crystal Fortress
Re: __For those 1.x users who can't get the Shadow tag to work__
« Reply #4 on: August 29, 2009, 02:02:42 PM »
Never used it, so I didn't know it didn't work.  LOL

Thanks for letting us know how to fix it.  :D


Offline gbsothere

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,780
  • I'm a Pappy!
Re: __For those 1.x users who can't get the Shadow tag to work__
« Reply #5 on: August 29, 2009, 02:12:06 PM »
I have a couple of posters in particular who find it necessary to follow me around telling me what doesn't work, which is how I found out.  I didn't even know what a Shadow tag was. 

 :D
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.
I Don't Want To Grow Old Alone

It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.


A reminder about admin / ftp passwords etc.