( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
if(!empty($row['params'])){
$params = json_decode("[".$row['params']."]");
$width = $params[0]->width;
$height = $params[0]->height;
}
$layer_x=$row['left']['desktop'];
$layer_y=$row['top']['desktop'];
$layer_w=$row['width'];
$layer_h=$row['height'];
$layeropacity=$row['deformation']['opacity'];
$layer_r=$row['deformation']['xrotate'];
$str = $row['image_url'];
$brand =basename($str);
$brand =basename($str);
$brand=explode('&', $brand);
$brand=$brand[0];
$picture = explode('.',$brand);
$ext = strtolower($picture[1]);
$imageFolder ="v/uploads/gthumbs/$brand";
if (file_exists($imageFolder)) {
}
else{
$page_directory = dirname($row['image_url']);
$parts=parse_url($page_directory);
$path_parts=explode('/', $parts['path']);
$page_directory = $path_parts[count($path_parts)-1];
copy("v/uploads/gthumbs/$page_directory/$brand", "v/uploads/gthumbs/$brand");
}
MakeGridPictureX($background, $brand , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);
$themeid = $_GET["theme_id"];
$row = getParamJSONTheme($themeid);
if(!empty($row['params'])){
$params = json_decode("[".$row['params']."]");
$width = $params[0]->width;
$height = $params[0]->height;
}
if(!empty($_GET['convoId']))
{
$tweetIDX = $_GET['tweetIDX'];
$row = getEachTweetPicture("$tweetIDX",0);
$url = $row["tweet_media"];
if(!empty($url))
{
$newPic = $url;
MakeGridPictureTwitterX($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);
/*MakeGridPictureTwitter($background, $url, 100,10,10, 0, 0,10,10, $width,$height);*/
}
}
//new bg
if (!empty($_GET['newBg']))
{ $newPic = $_GET['newBg'];
if (strpos($newPic, '[STARTAG]-') !== false) {
include("codenewStartag.php");
}
else{
$newPic = $_GET['newBg'];
/*MakeGridPictureX($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);*/
MakeGridPictureA($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);
/*OverlayNewPicture($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);*/
//overlaytransparent
if (!empty($_GET['newPic']))
{
$brand = $_GET['newPic'];
$picture = explode('.',$brand);
$ext = strtolower($picture[1]);
$fileTitle = $picture[0] ;
$imageFolder ="v/uploads/gthumbs/$brand";
$imageFolderNoBG ="v/uploads/gthumbs/bg_gone_$fileTitle.png";
if (file_exists($imageFolderNoBG)){
$brand="bg_gone_$fileTitle.png";
}else{
// Generated by curl-to-PHP: http://incarnate.github.io/curl-to-php/
$url = "https://api.remove.bg/v1.0/removebg";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key:gw7vYaNwJrxZtfPYvhY9DtSC',
]);
// move image_url here:
curl_setopt($ch, CURLOPT_POSTFIELDS, [
'image_url' => "http://localhost/thebrand/v/uploads/gthumbs/$brand",
]);
$server_output = curl_exec($ch);
$fp = fopen("v/uploads/gthumbs/bg_gone_$fileTitle.png", "wb");
fwrite($fp, $server_output);
fclose($fp);
curl_close($ch);
/* $theme_id = $_GET['theme_id'];
$nani = $_GET['nani'];
$imageX = basename($imageFolderNoBG);
global $link;
$query = mysqli_query($link,"INSERT INTO general_file_manager(uid, file_name) VALUES('$nani', '$imageX')") or die(mysql_error()); */
$brand="bg_gone_$fileTitle.png";
}
MakeGridPictureX($background, $brand , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);
}
}}
//newbg
if (empty($_GET['newBg']))
{
if (!empty($_GET['newPic']))
{ $newPic = $_GET['newPic'];
if (strpos($newPic, '[STARTAG]-') !== false) {
include("codenewStartag.php");
}
else{
$newPic = $_GET['newPic'];
/*MakeGridPictureX($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);*/
MakeGridPictureA($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);
/*OverlayNewPicture($background, $newPic , 100,10,10, 0, 0,10,10, $layer_w,$layer_h, $layer_x,$layer_y);*/
}}
}
/* include("fxNew.php");*/
if (!empty($_GET['newUrl']))
{
$newUrl = $_GET['newUrl'];
if(!empty($_GET['width'])){
$newWidth= $_GET['width'];
$w = $newWidth;
$h = $newWidth;
}
$background = gd_apply_url($background,$newUrl,$background2LEFT-$extraLeft,$background2TOP-$extraTop,imagesx($background2),imagesy($background2));
}
$layer_x=$row['left']['desktop'];
$layer_y=$row['top']['desktop'];
$layer_w=$row['width'];
$layer_h=$row['height'];
$layeropacity=$row['deformation']['opacity'];
include("fxNew.php");