Hi Leute!
Ich habe mir für das Uploadscript Jumploader ein nettes Script geschrieben, welches den Upload-Part übernimmt...
Mithilfe einer anderen Datei, welche auch einwandfrei funktioniert, sollen auch direkt die Thumbnails erstellt werden...
Aber wie immer klappt es net...
Kann mir da vielleicht einer helfen???
Es klappt auf jeden fall allesin dem Script, außer dem Part:
Wäre euch sehr dankbar!!!
MfG. DjScaleo
Edit:
Mir ist schon einmal aufgefallen, dass ich
vor dem
vergessen hatte,aber das hilft auch nicht weiter...
Ich habe mir für das Uploadscript Jumploader ein nettes Script geschrieben, welches den Upload-Part übernimmt...
PHP-Code:
<?php
session_start();
include("../gallery/_IMG.php");
$path = '../../images/fotos/';
$ablauf_datum = date('H:i', strtotime('+15 minutes'));
if (isset($_REQUEST['reset'])) {
$_SESSION['upload_datum'] = 0;
$albumtitel = $_REQUEST[title];
echo'<meta http-equiv="refresh" content="0; URL=../../index.php?site=bilder">';
}
if($_SESSION['upload_datum'] < date('H:i')){
$verzeichnis = dir($path);
while($eintrag=$verzeichnis->read())
{
if($eintrag != '.' && $eintrag != '..')
{
if(is_dir($path.$eintrag))
{
$ordner[$i] = $eintrag;
$i++;
}
}
}
$titel = str_replace(" ", "_", $albumtitel);
$titel = str_replace("ä", "ae", $titel);
$titel = str_replace("ö", "oe", $titel);
$titel = str_replace("ü", "ue", $titel);
$titel = str_replace("-", "", $titel);
$neuer_ordner = $i + 1;
$neuer_ordner = sprintf("%05d", $neuer_ordner);
$bilderordner = $path.'P'.$neuer_ordner.'_'.$titel.'';
mkdir ($bilderordner, 0777);
$text = $albumtitel;
$datei = "".$bilderordner."/vz.cfg";
$write = fopen ($datei, "a+");
fwrite($write, $text);
fclose($write);
$_SESSION['bilderordner'] = $bilderordner;
$_SESSION['upload_datum'] = $ablauf_datum;
}else{
$bilderordner = $_SESSION['bilderordner'];
}
$file_param_name = 'file';
$file_name = $_FILES[ $file_param_name ][ 'name' ];
$source_file_path = $_FILES[ $file_param_name ][ 'tmp_name' ];
$target_file_path = $bilderordner. "/" . $file_name;
move_uploaded_file( $source_file_path, $target_file_path );
$strSource = $target_file_path;
$strDestination = $bilderordner. "/thumb/" . $file_name;
$oldsize = getimagesize ($strSource);
$Zheight = 150;
$verhaltnis = $oldsize[1] / $Zheight;
$Zwidth = $oldsize[0] / $verhaltnis;
if (!file_exists($strDestination)){
$img->resize($strSource,$strDestination, 1, $Zwidth, $Zheight ,90);
}
?>
Aber wie immer klappt es net...
Kann mir da vielleicht einer helfen???
Es klappt auf jeden fall allesin dem Script, außer dem Part:
PHP-Code:
$strSource = $target_file_path;
$strDestination = $bilderordner. "/thumb/" . $file_name;
$oldsize = getimagesize ($strSource);
$Zheight = 150;
$verhaltnis = $oldsize[1] / $Zheight;
$Zwidth = $oldsize[0] / $verhaltnis;
if (!file_exists($strDestination)){
$img->resize($strSource,$strDestination, 1, $Zwidth, $Zheight ,90);
}
MfG. DjScaleo
Edit:
Mir ist schon einmal aufgefallen, dass ich
PHP-Code:
$img = new IMG();
PHP-Code:
$strSource = $target_file_path;
$strDestination = $bilderordner. "/thumb/" . $file_name;
$oldsize = getimagesize ($strSource);
$Zheight = 150;
$verhaltnis = $oldsize[1] / $Zheight;
$Zwidth = $oldsize[0] / $verhaltnis;
if (!file_exists($strDestination)){
$img->resize($strSource,$strDestination, 1, $Zwidth, $Zheight ,90);
}

Kommentar