( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
$picture = $row['picture'];
$poster = $row['poster'];
if(!empty($poster) && !empty($_GET['execute']))
{
$copyposter ="v/uploads/gallery/$poster";
imagejpeg($background,$copyposter , $quality);
}
if(empty($_GET['pic']) && !empty($_GET['theme_id']))
{
if(empty($poster))
{
$image ="images/backgrounds/bg-4.jpg";
$pic = basename($image);
$rand = rand(1111111111,9999999999);
$copyimage ="v/uploads/gthumbs/$rand".$pic;
$copyposter ="v/uploads/gallery/$rand".$pic;
$finalImage = basename($copyimage);
copy($image,$copyimage);
copy($image,$copyposter);
$theme_id = $_GET['theme_id'];
$nani = $_GET['nani'];
imageJpeg($background,$copyposter , $quality);
$sql="UPDATE profilepicture SET poster='$finalImage',picture='$finalImage' where catalogid='$nani' and id='$theme_id'";
$query = mysqli_query($sql) or die(mysql_error());
}
}
if($_GET['saveThemePoster']=="1") {
$image_path = str_replace("gthumbs","gallery",$image_path);
$image_pathX = str_replace("v/uploads/gallery/","",$image_path);
$theme_id = $_GET['theme_id'];
$nani = $_GET['nani'];
$finalName = basename($image_path);
$finalDir = "v/uploads/gallery/$finalName";
ImageJpeg($background,$finalDir , $quality);
$sql="UPDATE profilepicture SET poster='$finalName' where catalogid='$nani' and id='$theme_id'";
$query = mysqli_query($sql) or die(mysql_error());
exit();
}
?>