 -    (  )   ...         ,,,     ..       (   )      
 :
Block "Preview Theme
 : PHP-Nuke 7.3
 : www.cpgnuke.com
  :
1-    block-Preview_theme.php   
2-   mainfile.php         
[ this is the whole function get_theme() ]
-----------------------------
function get_theme() {
    global $user, $cookie, $Default_Theme;
    if(is_user($user)) {
	$user2 = base64_decode($user);
	$t_cookie = explode(":", $user2);
	if($t_cookie[9]=="") $t_cookie[9]=$Default_Theme;
	if(isset($theme)) $t_cookie[9]=$theme;
	if(!$tfile=@opendir("themes/$t_cookie[9]")) {
	    $ThemeSel = $Default_Theme;
	} else {
	    $ThemeSel = $t_cookie[9];
	}
    } else {
	$ThemeSel = $Default_Theme;
    }
    return($ThemeSel);
}
--------------------------------
-    
--------------------------------
function get_theme() {
    global $user, $userinfo, $Default_Theme, $prevtheme;
    static $ThemeSelSave;  // Thanks to steven111 at NukeCops for pointing to static vars
    if (isset($ThemeSelSave)) return ($ThemeSelSave);
    if (isset($prevtheme) && file_exists("themes/$prevtheme/theme.php")) {
        $ThemeSel = $prevtheme;
    } else if(is_user($user)) {
	$user2 = base64_decode($user);
	$t_cookie = explode(":", $user2);
	if($t_cookie[9]=="") $t_cookie[9]=$Default_Theme;
	if(isset($theme)) $t_cookie[9]=$theme;
	if(!$tfile=@opendir("themes/$t_cookie[9]")) {
	    $ThemeSel = $Default_Theme;
	} else {
	    $ThemeSel = $t_cookie[9];
	}
    } else {
	$ThemeSel = $Default_Theme;
    }
    return($ThemeSel);
}
--------------------------------
3-       ... 
4-     ..     -   ... 
-----------
  : 
    www.n4a.net
14/6/2004
26/4/1425
