vil nogen være sød at kigge på dette? på forhånd tak
<?php /* * examples: * $oFotoJobs = new FotoJobs( 400 ); // sets size of thumb * 1) uploading foto and creating thumb * $sUploadedFoto = $oFotoJobs->uploadFile( $_FILES['file'], 'foto/' ); // $_FILES['file'] - file is the name of the uploading file, foto/ - destination directory, return value is the patch of uploaded file for example foto/theFoto.jpg * $oFotoJobs->createThumb( $sUploadedFoto, 'foto/thumbs/', $_FILES['file']['name'], '80' ); // $sUploadedFoto patch form line before, foto/thumbs/ - destination directory for thumbs, $_FILES['file']['name'] - name of the thumb file (in this example the same as the uploaded file), 80 - quality of thumb image * 2) creating thumb from existing file * $oFotoJobs->createThumb( 'foto/Zdzis³aw Zawada.jpg', 'foto/thumbs/', 'theFoto.jpg', '80' ); * 3) uploading foto and creating two images thumb and original file * $aFotos = $oFoto->copyAndCreateThumb( 'files/products/', $_FILES['sFile'], 'newFileName', 'upload' ); // files/products/ - destination directory for files, $_FILES['sFile'] - an array where sFile is name of input field for this file, newFileName - new file name + oryginal extension, upload - option for upload * 4) copying foto and creating two images thumb and original file * $aFotos = $oFoto->copyAndCreateThumb( 'files/products/', 'files/products/asd.jpg', 'newFileName', 'copy' ); // files/products/ - destination directory for files, files/products/asd.jpg - patch for file to copy, newFileName - new file name + oryginal extension, copy - option for copy * * function copyAndCreateThumb returns an array which contains: * $aArray['bFile'] - big image file name (with extension) * $aArray['sFile'] - small image file name (with extension) * $aArray['bWidth'] - big image width * $aArray['sWidth'] - small image width * $aArray['bHeight'] - big image height * $aArray['sHeight'] - small image height * $aArray['bName'] - big image file name (without extension) * $aArray['sName'] - small image file name (without extension) * $aArray['ext'] - extension */
/** * Konstruktor * @return void * @param int $iThumbSize */ function FotoJobs( $iThumbSize = 100 ){ $this->iThumbX = $iThumbSize; } // end function FotoJobs
/** * Ustawia rozmiar miniaturki zdjecia * @return void * @param int $iThumbSize */ function setThumbSize( $iThumbSize = 100 ){ $this->iThumbX = $iThumbSize; } // end function setThumbSize
/** * Ustawia jakosc miniaturki zdjecia * @return void * @param int $iThumbQuality */ function setThumbQuality( $iThumbQuality = 80 ){ $this->iQuality = $iThumbQuality; } // end function setThumbQuality
/** * Ustawia przytostek nazwy dla miniaturki zdjecia * @return void * @param int $iThumbAdd */ function setThumbAdd( $iThumbAdd = '_m' ){ $this->iThumbAdd = $iThumbAdd; } // end function setThumbAdd
/** * Ustawia max rozmiar zdjecia dla ktorego tworza sie miniaturki * @return void * @param int $iMaxForThumbSize */ function setMaxForThumbSize( $iMaxForThumbSize = 2000 ){ $this->iMaxForThumbSize = $iMaxForThumbSize; } // end function setMaxForThumbSize
/** * Ustawia proporcje obrazka * @return void * @param int $fRatio */ function setRatio( $fRatio = 0.65 ){ $this->fRatio = $fRatio; } // end function setRatio
/** * Obsluguje upload lub kopiowanie plikow i tworzenie z nich miniaturek * @return array * @param string $sDestDir - katalog docelowy * @param mixed $mImgSrc - odpowiada array $_FILES jesli upload lub sciezce do pliku jesli copy * @param string $sImgOutput - proponowana nazwa pliku wyjsciowego * @param mixed $sOption - upload lub copy */ function copyAndCreateThumb( $sDestDir, $mImgSrc, $sImgOutput, $sOption = null ){
// zapamietanie wielkosci dla miniaturek $iOldSize = $this->iThumbX;
Vil du være så venlig at skrive hvilke(n) fejl, du støder på ?
Det kan ikke passe, at vi skal sidde og teste dit script - det er slet ikke sikkert, at vi møder de fejl, som du gør - det kan jo afhænge af serverens opsætning!
Så skriv venligst hvilke(n) fejl, du støder på, hvis du ønsker hjælp.
Udskriver den ingen fejl på siden? Har du husket at CHMOD dine mapper korrekt? Vi får intet ud af at kigge i en kode - der mest af alt, ligner en downloaded kode - vi får noget ud af, at hører din fejlbeskrivelse, fremfor "det virker ikke".
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.