Ok,I've got the BBcode working now, thanks for the help
How to Add Rainbow and Neon Text
EXTRACT
texteffects.zip to
templates/common/js
OPEN
includes/bbcode.php
FIND
'rainbow' => array(
'nested' => true,
'inurl' => true,
'allow_empty' => false,
),
REPLACE WITH
'gradient' => array(
'nested' => true,
'inurl' => true,
'allow_empty' => false,
),
ADD AFTER
'neon' => array(
'nested' => false,
'inurl' => false,
),
'rainbow' => array(
'nested' => false,
'inurl' => false,
),
FIND
// RAINBOW
if($tag === 'rainbow')
{
/*
if($this->is_sig)
{
return $error;
}
*/
$html = rainbow($content);
return array(
'valid' => true,
'html' => $html,
'allow_nested' => false,
);
}
REPLACE WITH
// GRADIENT
if($tag === 'gradient')
{
/*
if($this->is_sig)
{
return $error;
}
*/
$html = rainbow($content);
return array(
'valid' => true,
'html' => $html,
'allow_nested' => false,
);
}
ADD AFTER
// RAINBOW
if($tag === 'rainbow')
{
/*if($this->is_sig)
{
return $error;
}*/
$speed = 80;
if(isset($item['params']['speed']))
{
try
{
$speed = intval($item['params']['speed']);
} catch (Exception $e) {
break;
}
}
$text = $content;
if(strpos($text,"n") !== false)
{
return $error;
}
$html = "n<script language="javascript" type="text/javascript">nvar text = "". $text . ""nvar speed = " . $speed . " nrainbow()n</script>n<noscript>" . $text . "</noscript>n";
return array(
'valid' => true,
'html' => $html,
);
}
// NEON
if($tag === 'neon')
{
/*if($this->is_sig)
{
return $error;
}*/
$speed = 80;
if(isset($item['params']['speed']))
{
try
{
$speed = intval($item['params']['speed']);
} catch (Exception $e) {
break;
}
}
$colors = array();
$red = 128;
$green = 128;
$blue = 128;
if(isset($item['params']['basecolor']))
{
try
{
$colors = split(",",$item['params']['basecolor']);
for($i=0;$i<3;$i++)
{
if (intval($colors[$i]) > 255)
{
$colors[$i] = "255";
}
elseif (intval($colors[$i]) < 0)
{
$colors[$i] = "0";
}
}
$red = intval($colors[0]);
$green = intval($colors[1]);
$blue = intval($colors[2]);
} catch (Exception $e) {
break;
}
}
$basecolor = "rgb(" . $red . ", " . $green . ", " . $blue . ")";
$red = 64;
$green = 64;
$blue = 255;
if(isset($item['params']['textcolor']))
{
try
{
$colors = split(",",$item['params']['textcolor']);
for($i=0;$i<3;$i++)
{
if (intval($colors[$i]) > 255)
{
$colors[$i] = "255";
}
elseif (intval($colors[$i]) < 0)
{
$colors[$i] = "0";
}
}
$red = intval($colors[0]);
$green = intval($colors[1]);
$blue = intval($colors[2]);
} catch (Exception $e) {
break;
}
}
$textcolor = "rgb(" . $red . ", " . $green . ", " . $blue . ")";
$text = $content;
if(strpos($text,"n") !== false)
{
return $error;
}
$html = "n<script language="javascript" type="text/javascript">nvar text = "". $text . ""nvar speed = " . $speed . " nvar basecolor = "" . $basecolor . ""nvar textcolor = "" . $textcolor . ""nneon()n</script>n<noscript>" . $text . "</noscript>n";
return array(
'valid' => true,
'html' => $html,
);
}
OPEN
templates/mg_themes/overall_include.tpl
FIND
ADD BEFORE
<script type="text/javascript" src="{FULL_SITE_PATH}{T_COMMON_TPL_PATH}js/texteffects.js"></script>
NOTE: If you have other base template, You'll need to modify them as well.
BBcode Info
Key
{optional=Defualt Value}
required=Format
Neon
Highlight letter by letter at given speed, stays lit for a bit thte restarts.
[neon {speed=80} {basecolor=128,128,128} {textcolor=0,0,255}]Text here[/neon]
Rainbow
Text changes colour at given speed
[rainbow {speed=80}]Text here[/neon]
NOTE: the old rainbow is now gradient