Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function guestAction()
- {
- $parts = explode('_', $_GET['id']);
- $GuestMapper = new Application_Model_GuestMapper();
- $guest = $GuestMapper->find($parts[0]);
- $this->disableView();
- if (isset($parts[1]) && in_array($parts[1], array(1, 2, 3))) {
- $image = 'image' . $parts[1];
- if ($guest && $guest->$image) {
- $content_type = $guest->contentType($parts[1]);
- $path = $guest->imagePath($parts[1]);
- }
- else {
- $content_type = 'image/jpeg';
- $path = Application_Model_Property::noImagePath();
- }
- }
- else {
- $content_type = 'image/jpeg';
- $path = Application_Model_Property::noImagePath();
- }
- $this->getResponse()->setHeader('Content-Type', $content_type);
- readfile($path);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement