[xoops-cvslog 4636] CVS update: xoops2jp/html

Back to archive index

Tom Hayakawa tom_g3x****@users*****
2006年 9月 25日 (月) 19:34:02 JST


Index: xoops2jp/html/image.php
diff -u xoops2jp/html/image.php:1.2.8.1 xoops2jp/html/image.php:1.2.8.2
--- xoops2jp/html/image.php:1.2.8.1	Wed Oct 19 02:12:33 2005
+++ xoops2jp/html/image.php	Mon Sep 25 19:34:02 2006
@@ -1,5 +1,7 @@
 <?php
-// $Id: image.php,v 1.2.8.1 2005/10/18 17:12:33 minahito Exp $
+
+
+// $Id: image.php,v 1.2.8.2 2006/09/25 10:34:02 tom_g3x Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -25,42 +27,25 @@
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
 //  ------------------------------------------------------------------------ //
 
-set_magic_quotes_runtime(0);
-if (function_exists('mb_http_output')) {
-    mb_http_output('pass');
-}
-$image_id = isset($_GET['id']) ? intval($_GET['id']) : 0;
-if (empty($image_id)) {
-    header('Content-type: image/gif');
-    readfile('./images/blank.gif');
-    exit();
-}
-$xoopsOption['nocommon'] = 1;
-include './mainfile.php';
-include XOOPS_ROOT_PATH.'/include/functions.php';
-include_once XOOPS_ROOT_PATH.'/class/logger.php';
-$xoopsLogger =& XoopsLogger::instance();
-$xoopsLogger->startTime();
-include_once XOOPS_ROOT_PATH.'/class/database/databasefactory.php';
-define('XOOPS_DB_PROXY', 1);
-$xoopsDB =& XoopsDatabaseFactory::getDatabaseConnection();
-// ################# Include class manager file ##############
-require_once XOOPS_ROOT_PATH.'/kernel/object.php';
-require_once XOOPS_ROOT_PATH.'/class/criteria.php';
-$imagehandler =& xoops_gethandler('image');
-$criteria = new CriteriaCompo(new Criteria('i.image_display', 1));
-$criteria->add(new Criteria('i.image_id', $image_id));
-$image =& $imagehandler->getObjects($criteria, false, true);
-if (count($image) > 0) {
-    header('Content-type: '.$image[0]->getVar('image_mimetype'));
-    header('Cache-control: max-age=31536000');
-    header('Expires: '.gmdate("D, d M Y H:i:s",time()+31536000).'GMT');
-    header('Content-disposition: filename='.$image[0]->getVar('image_name'));
-    header('Content-Length: '.strlen($image[0]->getVar('image_body')));
-    header('Last-Modified: '.gmdate("D, d M Y H:i:s",$image[0]->getVar('image_created')).'GMT');
-    echo $image[0]->getVar('image_body');
-} else {
-    header('Content-type: image/gif');
-    readfile('./images/blank.gif');
+$image_id = isset ($_GET['id']) ? intval($_GET['id']) : 0;
+if ($image_id > 0) {
+	include './mainfile.php';
+	$imagehandler = & xoops_gethandler('image');
+	$criteria = new CriteriaCompo(new Criteria('i.image_display', 1));
+	$criteria->add(new Criteria('i.image_id', $image_id));
+	$image = & $imagehandler->getObjects($criteria, false, true);
+	if (count($image) > 0) {
+		header('Content-type: '.$image[0]->getVar('image_mimetype'));
+		header('Cache-control: max-age=31536000');
+		header('Expires: '.gmdate("D, d M Y H:i:s", time() + 31536000).'GMT');
+		header('Content-disposition: filename='.$image[0]->getVar('image_name'));
+		header('Content-Length: '.strlen($image[0]->getVar('image_body')));
+		header('Last-Modified: '.gmdate("D, d M Y H:i:s", $image[0]->getVar('image_created')).'GMT');
+		echo $image[0]->getVar('image_body');
+		exit ();
+	}
 }
+header('Content-type: image/gif');
+readfile('./images/blank.gif');
+
 ?>
\ No newline at end of file


xoops-cvslog メーリングリストの案内
Back to archive index