<?php
/* WebWall */
	define("ONLINE", 1);
	$root = dirname( dirname( dirname(__FILE__) ) );
	require_once "$root/core.php";
	checkuserloggedoff();
	define("USER_THEME", $engine_session->getuserdata(USER_USERNAME, "THEME"), true);
	define("BACKGROUND_URL", $engine_session->getuserdata(''.USER_USERNAME.'', "BACKGROUND"), true);
	$choosedtheme = $_POST["theme"];
	$photo_file = $_FILES["photo"];
	
	if($_SERVER['REQUEST_METHOD'] == "POST")
	{ 
		if($_FILES['photo']['size']>0)
		{
			$engine_session->updateuserbackground(''.USER_USERNAME.'', $photo_file); 
		}
		else
		{
			$engine_session->updateusertheme(''.USER_USERNAME.'', $choosedtheme); 
		}
	}

	$template_session->setparameter("serializeThemes", $engine_session->serializethemes(''.USER_THEME.'',''.BACKGROUND_URL.''), true);

	$template_session->loadhead($template_session->getlangval(99));
	$template_session->loadlogo(); 
	$template_session->loadmenu();
	$template_session->loadtpl("acc_themes");
	$template_session->loadtpl("footer");
	$template_session->loadend();
?>