Jump to content

atholon

Members
  • Posts

    132
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

atholon's Achievements

Member

Member (2/5)

0

Reputation

  1. I am trying to find out how I can make a business class available to all the controllers in my application or at least those related to a specific layout. Is there a way of doing this in Zend? I have looked all over and must be missing something. Also, with third party classes, how are you supposed to integrate them?
  2. Let me explain it better sometimes I am bad at making assumptions. I have a project I just created. I am not sure if I am going to have access to httpd config to do the virtual host stuff that they recommend in Zend's quickstart so I am trying to figure out how to do it with .htaccess. My project resides in a directory like /www/Leadership, I want to send everything to Zend's public folder in my project when they hit the Leadership directory. Maybe I am going about that the wrong way?
  3. I guess I was wondering if there was a generic rule for that?
  4. A friend of mine likes the Yii php framework. I've decided to give Zend a try.
  5. I've just started looking into Zend Framework and glancing at the quickstart on their website I saw they used a virtual host to redirect to the public directory. What are you supposed to do if you only have access to .htaccess on a shared host? I don't know much about mod_rewrite or any of that. I just want to send the traffic to that folder.
  6. Have any of you guys run into the issue with XHTML and 100% body height? If I don't use any DTD on my pages I can specify 100% height for the body of my page but once that DTD is on there it removes that capability. I've seen somewhere that W3 has depreciated 100% height and width on the body... but I couldn't find anything on their site. Does anyone know what we are supposed to do now if we still want that DTD/W3 validation?
  7. umm.. possibly because I only found crap when I did? I actually found some good ones on hotscripts.com but then they reorganized their website and I can't find them now.
  8. Does anyone know where I can find a very simple Flash file upload tutorial that works with PHP? I don't any actionscript Thank you!
  9. Well I figured I could do that with a PNG image as the background. it wouldn't matter that much but there's a water mark type thing that is on the very bottom
  10. Hi, I am trying to make a div have a semi transparent background using the filter and moz property on that div. The problem is is that it is making all the text and images placed inside of that div also transparent. Is there a way to fix that and just make the background itsself transparent?
  11. Your right, it looks like 2mb of memory is used by the other scripts that are included. Never realized how much the GD library hogs memory.
  12. The script I am writing has some other stuff to do and I want to have as much memory available as possible. I was thinking of doing that...but I wasn't sure if there was a better way.
  13. Is there a way to clear this array through PHP? I don't want the file to be in memory once I have the file saved to my server. But my script has other things it needs to do before redirecting.
  14. Hi there, I wrote a PHP class to crop images using the gd library...works fine on my local server but it appears my host has a smaller memory limit...any ideas of how to work around it? It seems I cannot upload any images larger than 300k with this cropping class. This is the error I get: The class is sort of long: <?php class ImageCropper { var $mediumWidth, $mediumHeight, $resizeWidth, $resizeHeight, $theImage, $width, $height, $newWidth, $newHeight, $imageType, $thumbSize, $error; function ImageCropper() { $this->mediumWidth = 275; $this->mediumHeight = 200; $this->resizeWidth = 325; $this->resizeHeight = 250; $this->error = null; } // Constructor function makeThumb($image, $iName, $iSize=110) // Thumbnails are square so there are only three params { $this->thumbSize = $iSize; list($this->width,$this->height, $this->imageType) = getimagesize($image); if($this->generateImageFromType($image)) { if ($this->width > $this->height) { $this->resizeWidth = $this->thumbSize + 100; $this->makeLandscape(); } else if ($this->height > $this->width) { $this->makePortrait(); $this->resizeHeight = $this->thumbSize + 100; } else { $this->resizeWidth = $this->thumbSize + 100; $this->makeLandscape(); } if ($this->width > $this->resizeWidth || $this->height > $this->resizeHeight) { if($this->imageType != IMAGETYPE_GIF) { $tempImage = imagecreatetruecolor( $this->newWidth, $this->newHeight ); $temp = imagecreatetruecolor( $this->thumbSize, $this->thumbSize); } else { $tempImage = imagecreate( $this->newWidth, $this->newHeight ); $temp = imagecreate( $this->thumbSize, $this->thumbSize); } imagecopyresampled( $tempImage, $this->theImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height ); imagecopy( $temp, $tempImage, 0, 0,($this->newWidth/2)-($this->thumbSize/2),($this->newHeight/2)-($this->thumbSize/2), $this->newWidth, $this->newHeight ); $this->renderImage($temp, $iName); imagedestroy( $temp ); imagedestroy( $tempImage ); } else { if($this->imageType != IMAGETYPE_GIF) { $temp = imagecreatetruecolor( $this->thumbSize, $this->thumbSize); } else { $tempImage = imagecreate( $this->newWidth, $this->newHeight ); $temp = imagecreate( $this->thumbSize, $this->thumbSize); } imagecopy( $temp, $this->theImage, ($this->thumbSize/2)-($this->width/2), ($this->thumbSize/2)-($this->height/2),0,0, $this->width, $this->height ); // resize to width $this->renderImage($temp, $iName); imagedestroy( $temp ); } } else echo $this->error; } // End Make Thumb function makeOtherSize($image, $iName, $iWidth=275, $iHeight=200) { $this->mediumWidth = $iWidth; $this->mediumHeight = $iHeight; $this->resizeWidth = $iWidth + 50; $this->resizeHeight = $iHeight + 50; list($this->width,$this->height, $this->imageType) = getimagesize($image); if($this->generateImageFromType($image)) { if ($this->width > $this->height) { $this->makeLandscape(); } else if ($this->height > $this->width) { $this->makePortrait(); } else { $this->makeLandscape(); } if ($this->width > $this->resizeWidth || $this->height > $this->resizeHeight) { if($this->imageType != IMAGETYPE_GIF) { $tempImage = imagecreatetruecolor( $this->newWidth, $this->newHeight ); $temp = imagecreatetruecolor( $this->mediumWidth, $this->mediumHeight); } else { $tempImage = imagecreate( $this->newWidth, $this->newHeight ); $temp = imagecreate( $this->mediumWidth, $this->mediumHeight); } imagecopyresampled( $tempImage, $this->theImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height ); imagecopy( $temp, $tempImage, 0, 0,($this->newWidth/2)-($this->mediumWidth/2),($this->newHeight/2)-($this->mediumHeight/2), $this->newWidth, $this->newHeight ); $this->renderImage($temp, $iName); imagedestroy( $temp ); imagedestroy( $tempImage ); } else { if($this->imageType != IMAGETYPE_GIF) { $temp = imagecreatetruecolor( $this->mediumWidth, $this->mediumHeight); } else { $temp = imagecreate( $this->mediumWidth, $this->mediumHeight); } imagecopy( $temp, $this->theImage, ($this->mediumWidth/2)-($this->width/2), ($this->mediumHeight/2)-($this->height/2),0,0, $this->width, $this->height ); // resize to width $this->renderImage($temp, $iName); imagedestroy( $temp ); imagedestroy( $tempImage ); } } else { echo $this->error; } } function generateImageFromType($toBeMade) { switch($this->imageType) { case IMAGETYPE_GIF: $this->theImage = imagecreatefromgif($toBeMade) or die("Error: Cannot find image!"); return true; break; case IMAGETYPE_JPEG: $this->theImage = imagecreatefromjpeg($toBeMade) or die("Error: Cannot find image!"); return true; break; case IMAGETYPE_PNG: $this->theImage = imagecreatefrompng($toBeMade) or die("Error: Cannot find image!"); return true; break; default: $this->error("This image type is not allowed:".$this->imageType); return false; break; } } function renderImage($theImage,$iName) { switch ($this->imageType) { case IMAGETYPE_JPEG: imagejpeg($theImage, $iName); break; case IMAGETYPE_GIF: imagegif($theImage, $iName); break; case IMAGETYPE_PNG: imagepng($theImage, $iName); break; default: break; } } function makeLandscape() { if ($this->width > $this->resizeWidth) { $ratio = $this->exceededAspectRatio(); if ($ratio == true) { $this->newHeight = $this->resizeHeight; $this->newWidth = ceil( $this->newHeight*($this->width/$this->height)); echo("got here"); } else { $this->newWidth = $this->resizeWidth; $this->newHeight = ceil( $this->newWidth*($this->height/$this->width)); } } else { $this->newWidth = $this->width; $this->newHeight = $this->height; } } // End Make LandScape function makePortrait() { if ($this->height > $this->resizeHeight) { $ratio = $this->exceededAspectRatio(); if ($ratio == true) { $this->newHeight = $this->resizeHeight; $this->newWidth = ceil( $this->newHeight*($this->width/$this->height)); echo("got here"); } else { $this->newHeight = $this->resizeHeight; $this->newWidth = ceil( $this->newHeight*($this->width/$this->height)); } } else { $this->newWidth = $this->width; $this->newHeight = $this->height; } } function exceededAspectRatio() { if ($this->width > $this->height) { if ($this->width / $this->height > 2) return true; } else { return false; } if ($this->height > $this->width) { if ($this->height / $this->width > 2) return true; } else { return false; } } } ?>
×
×
  • 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.