include "../../../../../connect.php";
include "../../../../../func.inc.php";
?>
if ($_GET["type"] == "img") {
if ($_GET["action"] == "insert") {
?>
=LANG_GLOBALWORDS_INSERTIMAGE;?>
|
=LANG_GLOBALWORDS_INSERTIMAGE;?>
|
|
|
|
}
if ($_GET["action"] == "upload") {
if (is_uploaded_file($_FILES["frmImage"]["tmp_name"])) {
$theFileName = preg_replace('/[^a-z0-9_\-\.]/i', '_', $_FILES["frmImage"]["name"]);
$theOriginalFN = $theFileName;
$i = 0;
$theFileName2 = $theFileName;
while (file_exists($config["site_root"]."images/".$theFileName2)) {
$i++;
$theFileArray = explode(".",$theFileName);
$theFileArray[0] .= $i;
$theFileName2 = implode(".",$theFileArray);
}
$theFileName = $theFileName2;
$FileExt2 = explode(".",$theFileName);
$FileExt = strtolower($FileExt2[count($FileExt2)-1]);
move_uploaded_file($_FILES["frmImage"]["tmp_name"], $config["site_root"]."images/".$theFileName);
$FN = $theFileName;
$filepath = $config["site_root"]."images/".$theFileName;
/**
$img_original = $filepath;
$ssimg = new ss_image($img_original,"f");
$ssimg->set_size(50,'*','-');
echo ""
**/
if ($_POST["frmSizeWidth"] != "-" && $_POST["frmSizeWidth"] != "" && $_POST["frmSizeHeight"] != "-" && $_POST["frmSizeHeight"] != "") {
$tsize[0] = $_POST["frmSizeWidth"];
$tsize[1] = $_POST["frmSizeHeight"];
/* if ($_POST["frmSizeWidth"] == "*" || $_POST["frmSizeWidth"] == "*") {
$blocked = true;
} else {
$blocked = false;
} */
$blocked = false;
list ($imgWidth, $imgHeight) = getimagesize ($filepath);
if ($blocked) $img2 = imagecreatetruecolor ($tsize[0], $tsize[1]);
if ($FileExt == "jpg" || $FileExt == "jpeg") {
$img = imagecreatefromjpeg($filepath);
} elseif ($FileExt == "gif") {
$img = imagecreatefromgif($filepath);
}
$percent0 = $tsize[0] / $imgWidth;
$percent1 = $tsize[1] / $imgHeight;
if ($blocked) {
if ($percent0 > $percent1) {
$tsize[1] = $percent0 * $imgHeight;
} else {
$tsize[0] = $percent1 * $imgWidth;
}
} else {
if ($percent0 < $percent1) {
$tsize[1] = $percent0 * $imgHeight;
} else {
$tsize[0] = $percent1 * $imgWidth;
}
}
if (!$blocked) $img2 = imagecreatetruecolor ($tsize[0], $tsize[1]);
imagecopyresampled($img2, $img, 0, 0, 0, 0, $tsize[0], $tsize[1], $imgWidth, $imgHeight);
$imgsize = $tsize;
if ($FileExt != "jpg") {
$filepath .= ".jpg";
$FN .= ".jpg";
}
imageJPEG($img2, $filepath);
} else {
$imgsize = getimagesize($filepath);
}
$filesize = filesize($filepath);
?>
} else {
echo "";
}
}
if ($_GET["action"] == "uploadset") {
$filename = "images/".$_POST["frmUploadSrc"];
$name = $_POST["frmUploadName"];
$cat = $_POST["frmUploadCat"];
if ($_POST["frmUploadCat2"] != "") $cat = $_POST["frmUploadCat2"];
$dims = $_POST["frmUploadDimensions"];
$owner = "Mark";
$res = mysql_query("INSERT INTO ".$tblprefix."tblfckimages (img_name, img_cat, img_size, img_src, img_owner) VALUES ('$name', '$cat', '$dims', '$filename', '$owner')");
// echo "\n";
echo "\n";
echo "";
}
}
if ($_GET["type"] == "getHTML") {
if ($_GET["action"] == "get") {
?>
Upload HTML
|
Insert from HTML-File
|
}
if ($_GET["action"]=="upload") {
$a = fopen($_FILES["frmHTML"]["tmp_name"],"r");
$b = fread($a, $_FILES["frmHTML"]["size"]);
$b = str_replace("\n","",$b);
$b = str_replace("\r","",$b);
echo "\n";
echo $b;
}
}
if ($_GET["type"] == "HTMLeditor") {
if ($_GET["action"] == "edit") {
?>
Bewerk HTML-code
}
if ($_GET["action"] == "set") {
echo "";
}
}
if ($_GET["type"] == "special") {
if ($_GET["action"] == "insert") {
?>
Insert Special Box
|
Insert Special Box
|