Dodawanie zdjecia do news w php-fusion


(Krawczyk Michal) #1

Proszę o pomoc w przerobieniu mojego skryptu. Skrypt ladnie wgrywa zdjęcia do folderu "artykuły" /images/articles/ a mi chodzi żeby skrypt wgrywal zdjecia na "news" /images/news/

to jest mój kod:

require_once "maincore.php";

require_once THEMES."templates/admin_header.php";

include LOCALE.LOCALESET."admin/image_uploads.php";


if (isset($_GET['imagesa']) && $_GET['imagesa'] == "imagesa") { $afolder = IMAGES_A; }

else { $_GET['imagesa'] = "imagesa"; $afolder = IMAGES_A; }


if (isset($_GET['status'])) {

	if ($_GET['status'] == "upn") {

		$title = $locale['420'];

		$message = "".$locale['425']."";

	} elseif ($_GET['status'] == "upy") {

		$title = $locale['420'];

		$message = "
Skopiuj link: 
\n".$locale['426']."";

	}

	opentable($title);

	echo "

".$message."
\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&imagesa=".$_GET['imagesa']); } 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&imagesa=".$_GET['imagesa']); } 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&imagesa=".$_GET['imagesa']."&img=$imgname"); } } else { opentable($locale['420']); echo "\n"; echo "

| ".$locale['421']." | |
| \n"; echo " |

\n\n"; closetable(); } require_once THEMES."templates/footer.php"; ?>[/code]

Dziekuje za pomoc


(Grzelix) #2

zamień IMAGES_A na IMAGES_N


(Krawczyk Michal) #3

Jestes wielki Grzesiu. Pozdrawwiam Wroclaw i dziekuje. =D> .