Jump to content

bobcooper

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by bobcooper

  1. Hi, Thanks for your reply, I've tried adding $_SERVER["DOCUMENT_ROOT"] to the $imageDir but it still does not work and it also does not echo the images either. Bob
  2. Hi there, I'm trying to create a zip file from an array of images that are posted from a form using the following code: <?php $shortlist = $_POST['shortlist']; $dir = $_POST['imageDir']; $imageDir = $dir; $imageArr = array(); $imageArr = preg_split('/\r\n|\r|\n/', $_POST['shortlist']); array_shift($imageArr); /* foreach ($imageArr as &$value) { $value = rtrim($value); $value = $imageDir . "/" . $value; } */ $imageTotal = count($imageArr); $zip = new ZipArchive(); // Load zip library $zip_name = time().".zip"; // Zip name if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE) { // Opening zip file to load files echo "* Sorry ZIP creation failed at this time"; } else { echo"zip created"; chmod($zip_name, 0755); foreach($imageArr as $file) { $hostedFile = $imageDir . '/' . $file; echo '<img src="' . $hostedFile . '" />'; $zip->addFile($hostedFile,$file); } $close = $zip->close(); if ($close) { echo 'File Closed'; } else { echo 'fail!!'; } echo 'Download these images as a <a href="'.$zip_name.'">ZIP file</a>.\n'; } ?> The php file is in a separate folder e.g. www.website.com/php/zip-test.php to the images folder as I want to be able to re-use it for other folders. I get as far as adding the files to the zip but when I try to close the zip it fails. The only thing I can think is that the $hostedFile is a relative link, e.g. /images/image1.jpg rather than http://www.website.com/images/image1.jpg so it's not finding the image to add to the zip So I tried adding the full website path to the image but it still does not work. The image is displaying fine when I echo it as an image, it just doesn't add to the zip. Any ideas? Thanks, Bob
  3. Hi there, I design a lot of Photography websites using flash and am looking for a simple CMS solution to update images and edit text pages. Most of the CMS's out there seem overly complicated and full of many features that I just don't need, does anyone know of any php based CMS that would meet the following requirements: 1. Need to be able to edit txt files. 2. Need to be able to upload multiple image files at once. 3. Image needs to be re-sized on upload to a specific either height or width (depending on the site). 4. Need to be able to create a thumbnail from the image by grabbing a selection / cropping new image (again to a specific size depending on the site). 5. Need to be able to change the image order of the images online without re-uploading everything, so they would be re-named as 1.jpg, 2.jpg, 3.jpg etc 6. I would need to be able to update the CMS depending on each site, so some sites might need thumbnails, some would not, some might need more/less text pages etc. Any thoughts or suggestions would be really appreciated. Thanks Bob www.bobcooper.org.uk
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.