<?php
	//
	$cur_uri = $_SERVER['HTTP_HOST'];
	$cur_ip = $_SERVER['REMOTE_ADDR'];
	$cur_ruri = $_SERVER['REQUEST_URI'];
	$websitefolder = 'sites';
	//
	if(ereg("/([0-9a-zA-Z]+([0-9a-zA-Z]+))?",$cur_ruri , $folderresult))
	{
		if($folderresult[0] != "/" && $folderresult[0] != "")
		{
			$websitefolder = $folderresult[0];
		}
	}
	//
	if(ereg("/([0-9a-zA-Z]+(\\.[0-9a-zA-Z]+))?",$cur_ruri , $folderresult))
	{
		if($folderresult[0] != "/" && $folderresult[0] != "")
		{
			$websitefolder = $folderresult[0];
		}
	}
	$websitefolder = $websitefolder."/";
	// web site
	////////////////////////////////////////////////////////////////
	$Config['UserFilesPath'] = '/uploaded/' ;
	/////////// uploader ///////////////////////////////////////////
	// SECURITY: You must explicitelly enable this "uploader". 
	$Config['Enabled'] = true ;
	// Set if the file type must be considere in the target path. 
	// Ex: /UserFiles/Image/ or /UserFiles/File/
	$Config['UseFileType'] = false ;
	// Path to uploaded files relative to the document root.
	$Config['UserFilesPath'] = '/UserFiles/' ;
	////////////////////////////////////////////////////////////////
	// localhost
	if($cur_ip == "127.0.0.1")
	{
		$Config['UserFilesPath'] = $websitefolder.'uploaded/' ;
	}
	else
	{
		$Config['UserFilesPath'] = '/uploaded/' ;
	}
	echo($Config['UserFilesPath']);
?>