Znalazłem taki skrypt dla V7 .
<?php
require_once 'maincore.php';
require_once THEMES.'templates/header.php';
include LOCALE.LOCALESET."admin/image_uploads.php";
if (isset($_GET['imagesn']) && $_GET['imagesn'] == "imagesn") { $afolder = IMAGES_N; }
else { $_GET['imagesn'] = "imagesn"; $afolder = IMAGES_N; }
if (isset($_GET['status'])) {
if ($_GET['status'] == "upn") {
$title = $locale['420'];
$message = "<strong>".$locale['425']."</strong>";
} elseif ($_GET['status'] == "upy") {
$title = $locale['420'];
$message = "<img src='".$afolder.stripinput($_GET['img'])."' alt='".stripinput($_GET['img'])."' /><br />Skopiuj link: <input type='text' name='foto_link' size='50' value='".$afolder.stripinput($_GET['img'])."'><br />\n<strong>".$locale['426']."</strong>";
}
opentable($title);
echo "<div style='text-align:center'>".$message."</div>\n";
closetable();
}
if (isset($_GET['del'])) {
unlink($afolder.stripinput($_GET['del']));
if ($settings['tinymce_enabled'] == 1) { include INCLUDES."buildlist.php"; }
redirect(FUSION_SELF."?status=del&imagesn=".$_GET['imagesn']);
} else if (isset($_POST['uploadimage'])) {
$error = "";
$image_types = array(
".gif",
".GIF",
".jpeg",
".JPEG",
".jpg",
".JPG",
".png",
".PNG"
);
$imgext = strrchr($_FILES['myfile']['name'], ".");
$imgname = $_FILES['myfile']['name'];
$imgsize = $_FILES['myfile']['size'];
$imgtemp = $_FILES['myfile']['tmp_name'];
if (!in_array($imgext, $image_types)) {
redirect(FUSION_SELF."?status=upn&imagesn=".$_GET['imagesn']);
} elseif (is_uploaded_file($imgtemp)){
move_uploaded_file($imgtemp, $afolder.$imgname);
chmod($afolder.$imgname,0644);
if ($settings['tinymce_enabled'] == 1) include INCLUDES."buildlist.php";
redirect(FUSION_SELF."?status=upy&imagesn=".$_GET['imagesn']."&img=$imgname");
}
} else {
opentable($locale['420']);
echo "<form name='uploadform' method='post' action='".FUSION_SELF."?amp;imagesn=".$_GET['imagesn']."' enctype='multipart/form-data'>\n";
echo "<table cellpadding='0' cellspacing='0' width='350' class='center'>\n<tr>\n";
echo "<td width='80' class='tbl'>".$locale['421']."</td>\n";
echo "<td class='tbl'><input type='file' name='myfile' class='textbox' style='width:250px;' /></td>\n";
echo "</tr>\n<tr>\n";
echo "<td align='center' colspan='2' class='tbl'>\n";
echo "<input type='submit' name='uploadimage' value='".$locale['420']."' class='button' style='width:100px;' /></td>\n";
echo "</tr>\n</table>\n</form>\n";
closetable();
}
require_once THEMES."templates/footer.php";
?>
Ten skrypt również działa dla V9 .
Wgrywa grafikę do katalogu infusions/news/images.
Chciałem się dowiedzieć czy istnieje możliwość aby wysyłać grafikę do innego katalogu .
|