include("lib/config.inc.php");
include("lib/functions.php");
function colorFade($text, $color1, $color2)
{
//remove leading and trailing whitespaces.
$text = explode("\n",$text);
$color1=str_replace("#","",$color1);
$color2=str_replace("#","",$color2);
//convert the hexadecimal colors in decimal.
$decimalColor = array();
//first color
$decimalColor[0] = hexdec(substr($color1, 0, 2));
$decimalColor[1] = hexdec(substr($color1, 2, 2));
$decimalColor[2] = hexdec(substr($color1, 4, 2));
//second color
$decimalColor[3] = hexdec(substr($color2, 0, 2));
$decimalColor[4] = hexdec(substr($color2, 2, 2));
$decimalColor[5] = hexdec(substr($color2, 4, 2));
//formated chars are stored here (the key 0 is for the first
//char and must not be removed).
$newText = array(0 => null);
//run over every character except the first and the last,
//they will be added later.
for ($i = 2; $i <= count($text)-1; $i++) {
//check if the character is only a whitespace. If yes,
//save the whitespace without adding color and proceed
//to the next character.
if (!trim($text[$i-1])) {
$newText[] = $text[$i-1];
continue;
}
//calculate the (hex) color for this character.
$color = array();
//red
$color[] = dechex(($decimalColor[0] - $decimalColor[3])
/ count($text) * $i + $decimalColor[3]);
//green
$color[] = dechex(($decimalColor[1] - $decimalColor[4])
/ count($text) * $i + $decimalColor[4]);
//blue
$color[] = dechex(($decimalColor[2] - $decimalColor[5])
/ count($text) * $i + $decimalColor[5]);
//check if every color part is 2 chars long, if not, repeat it.
foreach ($color as $k => $v) {
if (strlen($v) < 2) {
$color[$k] = "0$v";
}
}
//merge the parts to the full hex color.
$color = implode($color, '');
//Save the formated char.
$newText[] = str_replace('$color',strtoupper("#$color"),$text[$i-1]);
}
//add first char.
$newText[0] = str_replace('$color',"#$color2",$text[0]);
//add last char.
$newText[] = str_replace('$color',"#$color1",$text[count($text)-1]);
//merge the characters and return it.
return implode($newText, "\n");
}
if(isset($speedy_hidden))
{
if ($cookie) {
setcookie("startcolor",$_POST[startcolor]);
setcookie("endcolor",$_POST[endcolor]);
setcookie("anbindung",$_POST[anbindung]);
}
switch ($boardtyp) {
case "vBulletin": list($headsize,$normal1,$normal2,$normal3,$small,$endsize) = array("[size=10]","[size=5]","[size=6]","[size=7]","[size=1]","[/size]"); break;
}
$text='[color=$color]'.$headsize.'SPEEDY'.$endsize.'[/color]
[color=$color]~~~~~~~~~~~~~~~~~~~[/color]
[color=$color]Danke für den Upload von [i]'.stripslashes($speedy_datei).',[/i] [b]'.stripslashes($speedy_upper).' [/b][/color]'."\r\n";
if($speedy_ip) $text.="[color=\$color]und auch ein digges Danke für die IP an [b]".stripslashes($speedy_ip)." [/b] :)[/color]\r\n";
$text.="\r\n";
$text.='[color=$color]Rulez Gelesen: [/color][b]'; if($speedy_rulez_gelesen == "y")
{ $text.="[color=limegreen][x] Ja[/color] [color=red][ ] Nein[/color]"; }
else
{ $text.="[color=red][ ] Ja[/color] [color=limegreen][x] Nein[/color]"; }
$text.='[/b]
[color=$color]Rulez Akzeptiert: [/color][b]'; if($speedy_rulez_akzeptiert == "y")
{ $text.="[color=limegreen][x] Ja[/color] [color=red][ ] Nein[/color]"; }
else
{ $text.="[color=red][ ] Ja[/color] [color=limegreen][x] Nein[/color]"; }
$text.='[/b]
[color=$color]Internet-Anbindung: [b]'.$_POST[anbindung].'[/b][/color]
[color=$color]Status: [/color]'; if($speedy_status == 1) $text.="[b]".$normal1."[COLOR=orangered]Am Leechen [/b]".$endsize."[/color]";
if($speedy_status == 2) $text.="[b]".$normal1."[COLOR=red]Pause [/b]".$endsize."[/color]";
if($speedy_status == 3) $text.="[b]".$normal2."[COLOR=orangered]Probleme [/b]".$endsize."[/color]";
if($speedy_status == 4) $text.="[b]".$normal3."[COLOR=limegreen]FERTIG !!! :) [/b]".$endsize."[/color]";
$text.='
[color=$color]Anfang: '; if($speedy_anfang == "") {$text.="[b][i]folgt...[/b][/i]"; } else $text.="[b][color=limegreen]$speedy_anfang kb/s[/color][/b]";
if($speedy_anfang_zeit == "y")
{ $text.=" ([i]$speedy_anfang_uhr Uhr[/i])"; }
$text.='[/color]
[color=$color]Mitte: '; if($speedy_mitte == "") {$text.="[b][i]folgt...[/b][/i]"; } else $text.="[b][color=limegreen]$speedy_mitte kb/s[/color][/b]";
if($speedy_mitte_zeit == "y")
{ $text.=" ([i]$speedy_mitte_uhr Uhr[/i])"; }
$text.='[/color]
[color=$color]Ende: '; if($speedy_ende == "") {$text.="[b][i]folgt...[/b][/i]"; } else $text.="[b][color=limegreen]$speedy_ende kb/s[/color][/b]";
if($speedy_ende_zeit == "y")
{ $text.=" ([i]$speedy_ende_uhr Uhr[/i])"; }
$text.="[/color]
".($speedy_bemerkung?"[color=\$color]Bemerkung: [b][i]$speedy_bemerkung [/i][/b][/color]
":"")."[color=\$color]Bewertung:"; if($speedy_bewertung == 0) {$text.=" [b][i]folgt...[/b][/I]"; } else For($i=1;$i<=$speedy_bewertung;$i++) $text.=" [img]http://speedy.alien-scripts.de/images/stern.gif[/img]";
$text.='[/color]
[color=$color]'.$small.'Erstellt mit dem [url=http://speedy.alien-scripts.de]Online Speedy Maker[/url] ver 0.3'.$endsize.'[/color]
[color=$color]~~~~~~~~~~~~~~~~~~~[/color]';
echo"
";
}
else
{
?>