Location: PHPKode > projects > RabbitBB - Online Web Storage Project > mywebdrive/PHP_CON/imagecontroller.php
<?PHP

$rootpath=$_SERVER['DOCUMENT_ROOT'] . "/";
include_once($rootpath . "common.php");


if (is_array($_GET) && (isset($_GET['action'])))
   doGet($_GET);
elseif (is_array($_POST) && (isset($_POST['action'])))
   doPost($_POST);
else
   exit;

function doGet($request)
{
	global $rootpath, $webappcfg, $rb, $db;

	if ($request['action'] == "getthumb")
	{
		include_once($webappcfg['APPPATH'] . "/imageprocess/include.php");
		include_once($webappcfg['APPPATH'] . "/file/include.php");
		$response = array();
		$bsgett = new BSGetThumb();
		$response = $bsgett->getthumb($request, $response);
		if ($response['result'] == false)
		{
			//
			header("HTTP/1.0 404 Not Found");
		}
		elseif ($response['result'] == true)
		{
			//print_r($response);
			//exit;
			if (isset($response['resizedimglist']) && (isset($response['resizedimglist'][0])))
			{
				header("Cache-Control: must-revalidate");
				header('Content-type: '.$response['resizedimglist'][0]['contenttype']);
				header("Content-Length: ".$response['resizedimglist'][0]['filesize']);
				header('Content-disposition: inline;');
				header("Accept-Ranges: ".$response['resizedimglist'][0]['filesize']);
				echo($response['resizedimglist'][0]['filecontent']);
			}
			else
				header("HTTP/1.0 404 Not Found");
		}
		
	}
	elseif ($request['action'] == "resizedimg")
	{
		// start resize bs

		// specify img location

		// return resized image and show it
	}

	$db->sql_close();
}

function doPost($request)
{
	doGet($request);
}

/*

Function to check login

		if (!NSession::check_login())
		{
			//echo("NOLOGIN");
			// Bring to login page;
			header("Location: http://".$webappcfg['httphost']."/");
			return;
		}


*/

?>
Return current item: RabbitBB - Online Web Storage Project