News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

__For those 1.x users who can't get the Shadow tag to work__

Started by gbsothere, August 28, 2009, 01:30:18 PM

Previous topic - Next topic

gbsothere

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

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:

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
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.

shadow82x

Moved to Tips and Tricks and added this to our index. :)
Colin B
Former Spammer, Customize, & Support Team Member

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.


LHW

Never used it, so I didn't know it didn't work.  LOL

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


gbsothere

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.

Advertisement: