( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php $themeid = $_GET["theme_id"];
$row = getEachLayer($themeid,$catalogid,$layerPosition);
$str =$row['name'];
$check = checkType($str);
//button
$x=10; $y=50;
$left=10;
$top=10;
$fontadjust=35;
$padding_x=10;
$padding_y=10;
$color='FFFFFF';
$opacity=30;
$corner_radius=10;
$text='KENYA';
$text_color='#CC0000';
$font = 'assets/fonts/TitilliumWeb-SemiBold.ttf';
$fontsize = '20';
$background=$background;
$background= button($x,$y,$left, $top, $padding_x, $padding_y, $color, $opacity, $corner_radius, $text, $text_color,$background,$font,$fontsize,$fontadjust);
if($check=="theGraphics")
{
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
$layer_w=$row['layerw'];
$layer_h=$row['layerh'];
$layeropacity=$row['layeropacity'];
$layer_r=$row['layerr'];
$background = gd_apply_graphics($background, $str, $layeropacity,$layer_x,$layer_y,$layer_w,$layer_h,$layer_r);
/*$background = gd_apply_graphics($background, $str, 100,$x,$y,$w,$h);*/
/* exit($newPic);
if (!empty($_GET['newPic']))
{
$newPic = $_GET['newPic'];
$background = gd_apply_logo($background, $newPic, $layeropacity,$x,$y,$w,$h);
}*/
}
if($check=="profilePicture")
{
$picme=profilepicture();
$x =$layer1x; $y=$layer1y; $w=$layer1w; $h=$layer1h;
$layeropacity=$row['layeropacity'];
}
if($check=="theUpdate")
{
$str =$row['name'];
$str = str_replace('?', '&', $str);
parse_str($str, $output);
$route=$output['route'];/*exit($route);*/
$fontid=$output['fontid'];
$myfont=$output['myfont'];
$fontcatalogid=$output['fontcatalogid'];
$themeid=$output['themeid'];
$font_Username=$output['font_Username'];
$font_Name=$output['font_Name'];
$font_Url=$output['font_Url'];
$font_Text=$output['font_Text'];
$text_w=$output['text_w'];
$text_h=$output['text_h'];
$text_x=$output['text_x'];
$text_y=$output['text_y'];
$text_align=$output['text_align'];
$text_size=$output['text_size']-5;
$text_color=$output['text_color'];
$url_color=$output['url_color'];
$name_color=$output['name_color'];
$username_color=$output['username_color'];
$url_size=$output['url_size'];
$name_size=$output['name_size'];
$username_size=$output['username_size'];
$text_pad=$output['text_pad'];
$text_line_height=$output['text_line_height'];
$text=$output['text'];
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
$layer_r =$row['layerr'];
if (empty($_GET['cl']))
{
$text = realText() ;
}
else
{
$text = dummyText();
}
$angle = $layer_r;
$underline = true;
$font_Text = "assets/fonts/$font_Text"; //font used
$type = "Caption";$column = "font";
$fontLayer = checkFont($type,$column,$fontcatalogid,$_GET["theme_id"]);
$customFont =$fontLayer;
if (!empty($customFont))
{
$font_Text=$customFont;
$font_Text = "assets/newfont/$font_Text";
//font used
/*$oldFont = strtolower($output['font_Text']);
$newFont = strtolower($fontLayer);
exit($newFont);
if ($newFont = $oldFont )
{
}
else
{
$font_Text = "assets/fonts/".$output['font_Text'];
} */
}
$backgroundWidth = $text_w;
$backgroundHeight = 0;
$text = str_replace("*machine","",$text);
/* $text = str_replace("'", "`", $text);
$text = str_replace('"', "`", $text);
$text = str_replace('\\', "", $text);*/
/*exit($text);*/
$text = cleanText($text);
WriteCaption($background,$text_size,$text_color,$text_color,$text_line_height,$text_align,$angle,$underline,$font_Text,$backgroundWidth,$backgroundHeight,$layer_y,$text_pad,$backgroundColor,$layer_x,$text);
}
if($check=="theUrl")
{
$str =$row['name'];
$str = str_replace('?', '&', $str);
parse_str($str, $output);
$route=$output['route'];/*exit($route);*/
$fontid=$output['fontid'];
$myfont=$output['myfont'];
$fontcatalogid=$output['fontcatalogid'];
$themeid=$output['themeid'];
$font_Username=$output['font_Username'];
$font_Name=$output['font_Name'];
$font_Url=$output['font_Url'];
$font_Text=$output['font_Text'];
$text_w=$output['text_w'];
$text_h=$output['text_h'];
$text_x=$output['text_x'];
$text_y=$output['text_y'];
$text_align=$output['text_align'];
$text_size=$output['text_size']-7;
$text_color=$output['text_color'];
$url_color=$output['url_color'];
$name_color=$output['name_color'];
$username_color=$output['username_color'];
$url_size=$output['url_size'];
$name_size=$output['name_size'];
$username_size=$output['username_size'];
$text_pad=$output['text_pad'];
$text_line_height=$output['text_line_height'];
$layer_r =$row['layerr'];
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
if (empty($_GET['cl']))
{
$text = realText() ;
}
else
{
$text = dummyText();
}
$text= "thebrand.co.ke/". cleanText(slug());
$angle = $layer_r;
$underline = true;
$font_Text = "assets/fonts/$font_Text"; //font used
$type = "Url";$column = "font";
$fontLayer = checkFont($type,$column,$fontcatalogid,$_GET["theme_id"]);
$customFont =$fontLayer;
if (!empty($customFont))
{
$font_Text=$customFont;
$font_Text = "assets/newfont/$font_Text"; //font used
}
$backgroundWidth = $text_w;
$backgroundHeight = 0;
WriteCaption($background,$text_size,$text_color,$text_color,$text_line_height,$text_align,$angle,$underline,$font_Text,$backgroundWidth,$backgroundHeight,$layer_y,$text_pad,$backgroundColor,$layer_x,$text);
}
if($check=="thePlain")
{
$str =$row['name'];
$str = str_replace('?', '&', $str);
parse_str($str, $output);
$route=$output['route'];/*exit($route);*/
$fontid=$output['fontid'];
$myfont=$output['myfont'];
$fontcatalogid=$output['fontcatalogid'];
$themeid=$output['themeid'];
$font_Username=$output['font_Username'];
$font_Name=$output['font_Name'];
$font_Url=$output['font_Url'];
$font_Text=$output['font_Text'];
$text_w=$output['text_w'];
$text_h=$output['text_h'];
$text_x=$output['text_x'];
$text_y=$output['text_y'];
$text_align=$output['text_align'];
$text_size=$output['text_size']-5;
$text_color=$output['text_color'];
$url_color=$output['url_color'];
$name_color=$output['name_color'];
$username_color=$output['username_color'];
$url_size=$output['url_size'];
$name_size=$output['name_size'];
$username_size=$output['username_size'];
$text_pad=$output['text_pad'];
$text_line_height=$output['text_line_height'];
$text=$output['text'];
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
$layer_r =$row['layerr'];
if (empty($_GET['cl']))
{
$text = realText() ;
}
else
{
$text = dummyText();
}
$angle = $layer_r;
$underline = true;
$font_Text = "assets/fonts/$font_Text"; //font used
$type = "Caption";$column = "font";
$fontLayer = checkFont($type,$column,$fontcatalogid,$_GET["theme_id"]);
$customFont =$fontLayer;
if (!empty($customFont))
{
$font_Text=$customFont;
$font_Text = "assets/newfont/$font_Text"; //font used
/*$oldFont = strtolower($output['font_Text']);
$newFont = strtolower($fontLayer);
exit($newFont);
if ($newFont = $oldFont )
{
}
else
{
$font_Text = "assets/fonts/".$output['font_Text'];
} */
}
$backgroundWidth = $text_w;
$backgroundHeight = 0;
$text = str_replace("*machine","",$output['text']);
if($text == "timeFunc")
{
$date =date('H:i');
$text = $date;
}
if($text == "dayFunc")
{
$date =date('d/m/Y ');
$text = $date;
}
if($text == "randomFunc")
{
$rand =rand(11111111,99999999);
$text = $rand;
}
$text = cleanText($text);
WriteCaption($background,$text_size,$text_color,$text_color,$text_line_height,$text_align,$angle,$underline,$font_Text,$backgroundWidth,$backgroundHeight,$layer_y,$text_pad,$backgroundColor,$layer_x,$text);
}
if($check=="theName")
{
$str =$row['name'];
$str = str_replace('?', '&', $str);
parse_str($str, $output);
$route=$output['route'];/*exit($route);*/
$fontid=$output['fontid'];
$myfont=$output['myfont'];
$fontcatalogid=$output['fontcatalogid'];
$themeid=$output['themeid'];
$font_Username=$output['font_Username'];
$font_Name=$output['font_Name'];
$font_Url=$output['font_Url'];
$font_Text=$output['font_Text'];
$text_w=$output['text_w'];
$text_h=$output['text_h'];
$text_x=$output['text_x'];
$text_y=$output['text_y'];
$text_align=$output['text_align'];
$text_size=$output['text_size']-7;
$text_color=$output['text_color'];
$url_color=$output['url_color'];
$name_color=$output['name_color'];
$username_color=$output['username_color'];
$url_size=$output['url_size'];
$name_size=$output['name_size'];
$username_size=$output['username_size'];
$text_pad=$output['text_pad'];
$text_line_height=$output['text_line_height'];
$layer_r =$row['layerr'];
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
if (empty($_GET['cl']))
{
$text = realText() ;
}
else
{
$text = dummyText();
}
$angle =$layer_r;
$underline = true;
$font_Text = "assets/fonts/$font_Text"; //font used
$type = "Name";$column = "font";
$fontLayer = checkFont($type,$column,$fontcatalogid,$_GET["theme_id"]);
$customFont =$fontLayer;
if (!empty($customFont))
{
$font_Text=$customFont;
$font_Text = "assets/newfont/$font_Text"; //font used
}
$backgroundWidth = $text_w;
$backgroundHeight = 0;
$text= cleanText(user());
WriteCaption($background,$text_size,$text_color,$text_color,$text_line_height,$text_align,$angle,$underline,$font_Text,$backgroundWidth,$backgroundHeight,$layer_y,$text_pad,$backgroundColor,$layer_x,$text);
}
if($check=="theUser")
{
$str =$row['name'];
$str = str_replace('?', '&', $str);
parse_str($str, $output);
$route=$output['route'];/*exit($route);*/
$fontid=$output['fontid'];
$myfont=$output['myfont'];
$fontcatalogid=$output['fontcatalogid'];
$themeid=$output['themeid'];
$font_Username=$output['font_Username'];
$font_Name=$output['font_Name'];
$font_Url=$output['font_Url'];
$font_Text=$output['font_Text'];
$text_w=$output['text_w'];
$text_h=$output['text_h'];
$text_x=$output['text_x'];
$text_y=$output['text_y'];
$text_align=$output['text_align'];
$text_size=$output['text_size']-7;
$text_color=$output['text_color'];
$url_color=$output['url_color'];
$name_color=$output['name_color'];
$username_color=$output['username_color'];
$url_size=$output['url_size'];
$name_size=$output['name_size'];
$username_size=$output['username_size'];
$text_pad=$output['text_pad'];
$text_line_height=$output['text_line_height'];
$layer_r =$row['layerr'];
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
if (empty($_GET['cl']))
{
$text = realText() ;
}
else
{
$text = dummyText();
}
$angle =$layer_r;
$underline = true;
$font_Text = "assets/fonts/$font_Text"; //font used
$type = "Name";$column = "font";
$fontLayer = checkFont($type,$column,$fontcatalogid,$_GET["theme_id"]);
$customFont =$fontLayer;
if (!empty($customFont))
{
$font_Text=$customFont;
$font_Text = "assets/newfont/$font_Text"; //font used
}
$backgroundWidth = $text_w;
$backgroundHeight = 0;
$text= cleanText(username());
WriteCaption($background,$text_size,$text_color,$text_color,$text_line_height,$text_align,$angle,$underline,$font_Text,$backgroundWidth,$backgroundHeight,$layer_y,$text_pad,$backgroundColor,$layer_x,$text);
}
if($check=="Uploaded")
{
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
$layer_w=$row['layerw'];
$layer_h=$row['layerh'];
$brand = $row['name'] ;
$brandr = $row['layerr'] ;
$brand = basename($brand);
$layeropacity=$row['layeropacity'];
/*exit($brand);*/
$picture = explode('.',$brand);
$ext = strtolower($picture[1]);
switch ($ext)
{
case 'gif':
// We will be converting GIFs to PNGs to avoid transparency issues when resizing GIFs
// This is maybe not the ideal solution, but IE6 can suck it
$creationFunction = 'ImageCreateFromGif';
$outputFunction = 'ImagePng';
$mime = 'image/png'; // We need to convert GIFs to PNGs
$doSharpen = FALSE;
$quality = round(10 - ($quality / 10)); // We are converting the GIF to a PNG and PNG needs a compression level of 0 (no compression) through 9
break;
case 'png':
$creationFunction = 'ImageCreateFromPng';
$outputFunction = 'ImagePng';
$doSharpen = FALSE;
$quality = round(10 - ($quality / 10)); // PNG needs a compression level of 0 (no compression) through 9
break;
default:
$creationFunction = 'ImageCreateFromJpeg';
$outputFunction = 'ImageJpeg';
$doSharpen = FALSE;
break;
}
$background2Rotation = (180+$brandr) + 180;
$brand = $creationFunction("v/uploads/gthumbs/$brand");
$foto2W = imagesx($brand);
$foto2H = imagesy($brand);
$background2W = $layer_w;
$background2H = $layer_h;
$background2TOP = $layer_y;
$background2LEFT= $layer_x;
if(!empty($_GET['width'])){
$newWidth= $_GET['width'];
$brand_width = $newWidth;
$brand_height = $newWidth;
$background2W = $newWidth;
$background2H = $newWidth;
$foto2W = $layer_w;
$foto2H = $layer_h;
}
$background2 = imagecreatetruecolor($background2W,$background2H);
$trans_colour = imagecolorallocatealpha($background2, 0, 0, 0, 127);
imagefill($background2, 0, 0, $trans_colour);
imagecopyresampled($background2, $brand, 0, 0, 0, 0, $background2W, $background2H, $foto2W, $foto2H);
$background2 = imagerotate($background2,$background2Rotation, -1,0);
/*after rotating calculate the difference of new height/width with the one before*/
$extraTop =(imagesy($background2)-$background2H)/2;
$extraLeft =(imagesx($background2)-$background2W)/2;
imagecopy($background, $background2,$background2LEFT-$extraLeft, $background2TOP-$extraTop, 0, 0, imagesx($background2), imagesy($background2));
if (strpos($row['name'], 'unique=profilePic') !== false)
{
$layer_x=$row['layerx'];
$layer_y=$row['layery'];
$layer_w=$row['layerw'];
$layer_h=$row['layerh'];
$brand = $row['name'] ;
$brandr = $row['layerr'] ;
$brand = basename($brand);
$layeropacity=$row['layeropacity'];
$newPic = $_GET['newPic'];
/*
$mask = imagecreatefrompng( '2.png' );
// Apply mask to source
imagealphamask( $background, $mask );
*/
$background = gd_apply_logo($background, $newPic, $layeropacity,$layer_x,$layer_y,$layer_w,$layer_h);
if (!empty($_GET['fx']))
{
$moodswing2 = $_GET['fx'];
include("mags/machineEffects.php");
}
$hasFx = themeDetailsX("fx",$_GET["theme_id"]);
if ($hasFx!="blank" && empty($_GET['fx']))
{
$moodswing2 = $hasFx;
include("mags/machineEffects.php");
}
}
}
?>