| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/store.tiacyrusxxx.com/public_html/dev/TSCP2/ |
Upload File : |
<?php
@header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
@header("Pragma: no-cache"); // HTTP/1.0
include ('config.php');
if (isset($_POST['post'])) {
#$sample = realpath(".").'/img/sample.jpg';
$quality = "80";
//brightness_contrast_sharp($filename = realpath(".").'/temp/icon.jpg');
//copy(realpath(".").'/temp/icon.jpg', $set_path.'icon.jpg');
$type=$_POST['type'];
$section=$_POST['section'];
$save=$_POST['save'];
$tn=$_POST['tn'];
$id=$_POST['id'];
if ($_POST['section'] == "model") {
$root = $modelsroot;
} elseif ($_POST['section'] == "video") {
$root = $contentroot;
} elseif ($_POST['section'] == "photoset") {
$root = $contentroot;
} elseif ($_POST['section'] == "tgp") {
$root = $affcontentdir;
} elseif ($_POST['section'] == "feature" || $_POST['section'] == "sample") {
$root = $featureroot;
} else {
$root = $blogroot;
//die("error, wrong section");
}
$save = $root.$save;
$localfile = file_get_contents($save);
$handle = fopen($save,"w+");
if(!fwrite($handle,$localfile)>-1) {
die("error could not write.");
}
if ($tn == "none") {
// go back to where you came from.
if ($_POST['section'] == "model") {
$tmp = str_replace("_gal.jpg","",$_POST['save']);
$tmp2 = str_replace("_delight.jpg","",$_POST['save']);
if($tmp == $id || $tmp2 == $id) {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./models_photos.php?model_id=".$id."\">");
} else {
dbconn();
$get = @mysql_query("SELECT model_id FROM cms_content_models WHERE content_id = '".$id."'");
$model_id = @mysql_result($get, 0, 'model_id');
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./models_photos.php?model_id=".$id."\">");
}
} elseif ($_POST['section'] == "video") {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./content_photos.php?content_id=".$id."\">");
} elseif ($_POST['section'] == "photoset") {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./content_photos.php?content_id=".$id."\">");
} elseif ($_POST['section'] == "tgp") {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./aff_content_images.php?id=".$id."\">");
} elseif ($_POST['section'] == "feature") {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./feature_photos.php?feature_id=".$id."\">");
} elseif ($_POST['section'] == "sample") {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./feature_photospage.php\">");
} else {
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./blogs.php\">");
//die("error, wrong section");
}
//printf("<meta http-equiv=\"Refresh\" content=\"0;url=./".$section."s_photos.php?".$section."_id=".$id."\">");
} else {
//go make thumbnail
printf("<meta http-equiv=\"Refresh\" content=\"0;url=./image_crop.php?type=tn§ion=".$section."&save=".$tn."&tn=none&id=".$id."\">");
}
} else {
// image_crop.php?type=icon§ion=model&save=77/icon.jpg&tn=tn1.jpg
// type: icon, img, tn
// section: model, photographer, photoset
// save: where to save (root is taken from config & assigned based on section
// tn: ex: "tn1.jpg" -- if isset, after cropping large image size, make thumbnail.
$quality = "80";
$type = $_GET['type'];
if($type == "selfie"){
$type = "img";
}
if ($_GET['section'] == "model") {
$T_WIDTH = $model_x[$type];
$T_HEIGHT = $model_y[$type];
$root = $modelsroot;
} elseif ($_GET['section'] == "video") {
$T_WIDTH = $video_x[$type];
$T_HEIGHT = $video_y[$type];
$root = $contentroot;
} elseif ($_GET['section'] == "photoset") {
$T_WIDTH = $photoset_x[$type];
$T_HEIGHT = $photoset_y[$type];
$root = $contentroot;
} elseif ($_GET['section'] == "tgp") {
$T_WIDTH = $aff_x[$type];
$T_HEIGHT = $aff_y[$type];
$root = $affcontentdir;
} elseif ($_GET['section'] == "feature" || $_GET['section'] == "sample") {
$T_WIDTH = $feature_x[$type];
$T_HEIGHT = $feature_y[$type];
$root = $featureroot;
} else {
$T_WIDTH = $blog_x[$type];
$T_HEIGHT = $blog_y[$type];
$root = $blogroot;
//die("error, no type");
}
#$source = realpath(".").'/img/temp.jpg';
$source = $modelsroot.$_GET['save'];
$sample = realpath(".").'/img/sample.jpg';
if(!file_exists($source)){
echo "error: missing image!";
} else {
$main_img=imagecreatefromjpeg($source);
$sx=imagesx($main_img);
$sy=imagesy($main_img);
if(imagesx($main_img)>$T_WIDTH){
$height_if_img = ($T_WIDTH*imagesy($main_img))/imagesx($main_img);
$img_resized = imagecreatetruecolor($T_WIDTH, $height_if_img);
imagecopyresampled($img_resized, $main_img, 0, 0, 0, 0, $T_WIDTH, $height_if_img, imagesx($main_img), imagesy($main_img));
$main_img=$img_resized;
}
if(imagesy($main_img)>$T_HEIGHT){
unset($img_resized);
$img_resized = imagecreatetruecolor($T_WIDTH, $T_HEIGHT);
imagecopy($img_resized, $main_img, 0, 0, 0, 0, imagesx($main_img), imagesy($main_img));
$main_img=$img_resized;
}
imagejpeg($main_img,$sample,$quality);
?>
<script type="text/javascript" src="wz_dragdrop.js"></script>
<div align="center">
<div id="theCrop" style="position:absolute;background-color:transparent;border:1px solid yellow;width:<?=$T_WIDTH?>px;height:<?=$T_HEIGHT?>px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'transbg.png\',sizingMethod=\'scale\');"></div>
<br>
<br><br>
Hold down either the "shift" or "control" button to resize the cropping area
<br><br>
<img src="/content/models/<?php print $_GET[save]; ?>" border="0" width="<?=$sx?>" height="<?=$sy?>" alt="crop this image" name="theImage">
<br><br>
<input type="button" value=" crop & preview " id="submit" onclick="my_Submit();" class="grey">
<br><br>
<strong>preview</strong> [<?=$T_WIDTH?> x <?=$T_HEIGHT?>]
<br><br>
<img id="ico_trgt" src="/content/models/<?php print $_GET[save]; ?>" width="<?=$T_WIDTH?>" height="<?=$T_HEIGHT?>">
<br><br>
<form method="POST" action="<?=$_SERVER['PHP_SELF']?>">
<input type="hidden" name="type" value="<?=$_GET['type']?>">
<input type="hidden" name="section" value="<?=$_GET['section']?>">
<input type="hidden" name="save" value="<?=$_GET['save']?>">
<input type="hidden" name="tn" value="<?=$_GET['tn']?>">
<input type="hidden" name="id" value="<?=$_GET['id']?>">
<input type="submit" class="grey" value=" save image as seen in preview above " name="post">
</form>
</div>
<script type="text/javascript">
<!--
SET_DHTML("theCrop"+MAXOFFLEFT+0+MAXOFFRIGHT+<?=$sx?>+MAXOFFTOP+0+MAXOFFBOTTOM+<?=$sy?>+RESIZABLE+MAXWIDTH+<?=$sx?>+MAXHEIGHT+<?=$sy?>+MINHEIGHT+25+MINWIDTH+25,"theImage"+NO_DRAG);
dd.elements.theCrop.moveTo(dd.elements.theImage.x, dd.elements.theImage.y);
dd.elements.theCrop.setZ(dd.elements.theImage.z+1);
dd.elements.theImage.addChild("theCrop");
dd.elements.theCrop.defx = dd.elements.theImage.x;
dd.elements.theCrop.scalable = 1;
dd.elements.theCrop.resizable = 0;
function my_DragFunc()
{
dd.elements.theCrop.maxoffr = dd.elements.theImage.w - dd.elements.theCrop.w;
dd.elements.theCrop.maxoffb = dd.elements.theImage.h - dd.elements.theCrop.h;
dd.elements.theCrop.maxw = <?=$sx?>;
dd.elements.theCrop.maxh = <?=$sy?>;
}
function my_ResizeFunc()
{
dd.elements.theCrop.maxw = (dd.elements.theImage.w + dd.elements.theImage.x) - dd.elements.theCrop.x;
dd.elements.theCrop.maxh = (dd.elements.theImage.h + dd.elements.theImage.y) - dd.elements.theCrop.y;
}
function my_Submit(){
var obj=document.getElementById("ico_trgt");
obj.src = "image_cropper.php?save=<?php print $_GET[save]; ?>&sx=" +
(dd.elements.theCrop.x - dd.elements.theImage.x) + "&sy=" +
(dd.elements.theCrop.y - dd.elements.theImage.y) + "&ex=" +
((dd.elements.theCrop.x - dd.elements.theImage.x) + dd.elements.theCrop.w) + "&ey=" +
((dd.elements.theCrop.y - dd.elements.theImage.y) + dd.elements.theCrop.h) + "&T_WIDTH=<?=$T_WIDTH?>&T_HEIGHT=<?=$T_HEIGHT?>";
}
//-->
</script>
<?php
}
}
?>