Annotation of /trunk/www/image.php
Parent Directory
|
Revision Log
Revision 2 - (view) (download)
| 1 : | andphe | 2 | <?php |
| 2 : | //zOOm Media Gallery// | ||
| 3 : | /** | ||
| 4 : | ----------------------------------------------------------------------- | ||
| 5 : | | zOOm Media Gallery! by Mike de Boer - a multi-gallery component | | ||
| 6 : | ----------------------------------------------------------------------- | ||
| 7 : | |||
| 8 : | ----------------------------------------------------------------------- | ||
| 9 : | | | | ||
| 10 : | | Author: Mike de Boer, <http://www.mikedeboer.nl> | | ||
| 11 : | | Copyright: copyright (C) 2007 by Mike de Boer | | ||
| 12 : | | Description: zOOm Media Gallery, a multi-gallery component for | | ||
| 13 : | | Joomla!. It's the most feature-rich gallery component | | ||
| 14 : | | for Joomla!! For documentation and a detailed list | | ||
| 15 : | | of features, check the zOOm homepage: | | ||
| 16 : | | http://www.zoomfactory.org | | ||
| 17 : | | License: GPL | | ||
| 18 : | | Filename: image.php | | ||
| 19 : | | | | ||
| 20 : | ----------------------------------------------------------------------- | ||
| 21 : | * @version $Id:image.php 106 2007-02-10 22:30:30Z kevinuru $ | ||
| 22 : | * @package zOOmGallery | ||
| 23 : | * @author Mike de Boer <mailme@mikedeboer.nl> | ||
| 24 : | **/ | ||
| 25 : | |||
| 26 : | define( "_VALID_MOS", 1 ); | ||
| 27 : | |||
| 28 : | require_once( '../../../globals.php' ); | ||
| 29 : | include_once('../../../configuration.php'); | ||
| 30 : | |||
| 31 : | $ref = $_SERVER['HTTP_REFERER']; | ||
| 32 : | if (strpos($ref,$mosConfig_live_site) === 0 || strpos($ref, 'http') !== 0) { | ||
| 33 : | |||
| 34 : | require_once("../lib/inserts.class.php"); | ||
| 35 : | |||
| 36 : | // get variables from HTTP request... | ||
| 37 : | $q = $zoom->decrypt($zoom->getParam($_REQUEST, 'q')); | ||
| 38 : | // Use & for correct processing | ||
| 39 : | $params = split("&", $q); | ||
| 40 : | foreach ($params as $param) { | ||
| 41 : | $var = split("=", $param); | ||
| 42 : | if (count($var) === 2) { | ||
| 43 : | $_REQUEST[$var[0]] = $var[1]; | ||
| 44 : | } | ||
| 45 : | } | ||
| 46 : | |||
| 47 : | // SSL check - $http_host returns <live site url>:<port number if it is 443> | ||
| 48 : | $http_host = explode(':', $_SERVER['HTTP_HOST'] ); | ||
| 49 : | if( (!empty( $_SERVER['HTTPS'] ) && strtolower( $_SERVER['HTTPS'] ) != 'off' || isset( $http_host[1] ) && $http_host[1] == 443) && substr( $mosConfig_live_site, 0, 8 ) != 'https://') { | ||
| 50 : | $mosConfig_live_site = 'https://'.substr( $mosConfig_live_site, 7 ); | ||
| 51 : | } | ||
| 52 : | |||
| 53 : | |||
| 54 : | //Get all the stuff for the picture | ||
| 55 : | $key = intval($zoom->getParam($_REQUEST, 'key')); | ||
| 56 : | $catid = intval($zoom->getParam($_REQUEST, 'catid')); | ||
| 57 : | $type = intval($zoom->getParam($_REQUEST, 'type')); | ||
| 58 : | $zoom->setGallery($catid); | ||
| 59 : | $zoom->_gallery->_images[$key]->getInfo(); | ||
| 60 : | |||
| 61 : | //Lets show some pictures! | ||
| 62 : | $img_type = $zoom->_gallery->_images[$key]->_type; | ||
| 63 : | if ($type == 0) { //Viewsize | ||
| 64 : | $img = $mosConfig_absolute_path."/".$zoom->_CONFIG['imagepath'].$zoom->_gallery->_dir."/".$zoom->_gallery->_images[$key]->_viewsize; | ||
| 65 : | } elseif ($type == 1) { //Fullsize | ||
| 66 : | $img = $mosConfig_absolute_path."/".$zoom->_CONFIG['imagepath'].$zoom->_gallery->_dir."/".$zoom->_gallery->_images[$key]->_filename; | ||
| 67 : | } elseif ($type == 2) { //Thumbnail | ||
| 68 : | $img = $zoom->_gallery->_images[$key]->_thumbnail; | ||
| 69 : | $img = str_replace($mosConfig_live_site, $mosConfig_absolute_path, $img); | ||
| 70 : | $img_type = $zoom->_gallery->_images[$key]->_thumbtype; | ||
| 71 : | } | ||
| 72 : | $img = str_replace(' ','%20',$img); | ||
| 73 : | echo header("Content-Type: image/".$img_type.""); | ||
| 74 : | @readfile($img); | ||
| 75 : | } else { | ||
| 76 : | echo header("Content-Type: image/png"); | ||
| 77 : | $img = $mosConfig_live_site."/components/com_zoom/www/images/hotlink.png"; | ||
| 78 : | @readfile($img); | ||
| 79 : | } | ||
| 80 : | ?> |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |
Web Hosting provided by Network Redux.

