---------------------------
Block Theme select for SLAED CMS
http://www.slaed.net
---------------------------



1.      .
2.      html/    .
3.        "block-theme.php"   "  ".

    : function/function.php

 :

function get_theme() {
	global $user, $conf;
	if (!defined("ADMIN_FILE") && is_user()) {
		$utheme = $user[5];
		if (file_exists("templates/$utheme") && $utheme != "") {
			$theme = $utheme;
		} else {
			$theme = $conf['theme'];
		}
	} elseif (!defined("ADMIN_FILE")) {
		$theme = $conf['theme'];
	} elseif (defined("ADMIN_FILE")) {
		$theme = "admin";
	}
	return $theme;
}

   :

function get_theme() {
	global $user, $conf;
	if (!defined("ADMIN_FILE") && is_user()) {
		if (isset($_POST['user_theme'])) {
			$utheme = $_POST['user_theme'];
			setcookie("user_theme", $utheme);
		} elseif (isset($_COOKIE['user_theme'])) {
			$utheme = $_COOKIE['user_theme'];
		} else {
			$utheme = $user[5];
		}
		if (file_exists("templates/$utheme") && $utheme != "") {
			$theme = $utheme;
		} else {
			$theme = $conf['theme'];
		}
	} elseif (!defined("ADMIN_FILE") && !is_user()) {
		if (isset($_POST['user_theme'])) {
			$theme = $_POST['user_theme'];
			setcookie("user_theme", $theme);
		} elseif (isset($_COOKIE['user_theme'])) {
			$theme = $_COOKIE['user_theme'];
		} else {
			$theme = $conf['theme'];
		}
	} elseif (defined("ADMIN_FILE")) {
		$theme = "admin";
	}
	return $theme;
}

--------------------------

 !