function at_loginpage($vars) { extract($vars); $template = $loginpage['template']; session_start(); if (!atIsLoggedIn()) { $_SESSION['loggedin'] = 0; $_SESSION['login_entered'] = 0; return; } if ($_SESSION['loggedin'] == 1) { $_SESSION['login_entered'] = 1; return; } $_SESSION['loggedin'] = 1; $_SESSION['login_entered'] = 1; if (!$template) { $template = "loginpage.html"; } if (@file_exists($themepath . $template)) { $file = $themepath . $template; } elseif (@file_exists($atdir . "templates/{$template}")) { $file = $atdir . "templates/{$template}"; } else { return; } $HTML = atTemplatePrep($file, 1); $output = atCommandReplace($HTML, $command); atTemplateDisplay($output); atThemeExit(); }
function atThemeSet($theme, $douser = 0) { $dbi = $GLOBALS['dbi']; $prefix = $GLOBALS['prefix']; $userprefix = $GLOBALS['user_prefix']; $user = $GLOBALS['user']; if (isset($theme) && @file_exists("themes/{$theme}/theme.cfg")) { sql_query("UPDATE " . $prefix . "_config SET Default_Theme='{$theme}'", $dbi); if (atIsLoggedIn() && $douser) { $username = atGetUserName(); sql_query("UPDATE " . $userprefix . "_users SET theme='{$theme}' WHERE username='******'", $dbi); $userinfo = getusrinfo($user); docookie($userinfo['user_id'], $userinfo['username'], $userinfo['user_password'], $userinfo['storynum'], $userinfo['umode'], $userinfo['uorder'], $userinfo['thold'], $userinfo['noscore'], $userinfo['ublockon'], $theme, $userinfo['commentmax']); } } }
function atGetCompileFilename($filename, $modifier = "") { $thename = atRunningGetVar('thename'); if (atIsLoggedIn()) { $user = 1; } else { $user = 0; } if (atIsAdminUser()) { $admin = 1; } else { $admin = 0; } $temp = $user . $admin . $thename . $filename . $modifier; $filepre = md5($temp); return $filepre; }