<?php
/*---------------------------------------------------+
| PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit http://gnu.org
+----------------------------------------------------+
| Modified by PHP-Fusion SF Group
| Copyright © 2007 by SF
| http://www.rus-phpfusion.com/
+----------------------------------------------------*/
/* gzip start header */
if ($settings['gzip_enabled'] == "1"){
if (strpos(' ' . $_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false) {
$site_gzipper_encoding = 'x-gzip';
}
if (strpos(' ' . $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false) {
$site_gzipper_encoding = 'gzip';
}
}
/* gzip end header */
if (!defined("IN_FUSION")) { header("Location: index.php"); exit; }

require_once THEME."theme.php";
if (!function_exists('showsubdate')) {
    require_once INCLUDES."theme_functions_include.php";
}

if ($settings_forum['forum_enabled'] == "1" && !iADMIN) fallback(FORUM."offline.php");
if (iMEMBER) $result = dbquery("UPDATE ".$db_prefix."users SET user_lastvisit='".time()."', user_ip='".USER_IP."' WHERE user_id='".$userdata['user_id']."'");

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">
<html>
<head>";
if(!empty($title))$title=stripinput($title);
else $title='&nbsp;';
echo "<title>".$title.$settings['sitename']."</title>
<meta http-equiv='Content-Type' content='text/html; charset=".$locale['charset']."'>
<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />
<meta http-equiv=\"pragma\" content=\"no-cache\" />
<meta name='description' content='".$settings['description']."'>
<meta name='keywords' content='".$settings['keywords']."'>
<link rel='shortcut icon' href='".BASEDIR."favicon.ico'>
<link rel='stylesheet' href='".THEME."styles.css' type='text/css'>";
echo "<script type='text/javascript' src='".INCLUDES."jscript.js'></script>
</head>";

echo "<body bgcolor='$body_bg' text='$body_text'><a name=\"top\"></a>\n";


$theme_width = "100%";

echo "<table align='center' cellspacing='0' cellpadding='0' width='$theme_width' class='outer-border'>
<tr>
<td>
<table cellpadding='0' cellspacing='0' width='100%'>
<tr>
<td class='full-header'>
<table border='0' id='header_bg' cellpadding='0'  cellspacing='0' id='header' width='100%'>
<tr>
<td class='logo'  height='100' valign='top' width='100%'><img src='".IMAGES."logo.gif' alt='".$settings['sitename']."' title='".$settings['sitename']."'></td>
</tr>
</table>
</td>
</tr>
</table>\n";

echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>
<td style='padding: 8px 4px 8px 4px; text-align:left; font-size: 10px; font-weight:bold;' class='tbl2'>";

if (iMEMBER) {
	echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;Вы вошли как&nbsp;<a href='".BASEDIR."profile.php?lookup=".$userdata['user_id']."'>".$userdata['user_name']."</a>&nbsp;<a href='".BASEDIR."setuser_forum.php?logout=yes'>(Выход)</a>";
} else {
	echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp;<a href='".BASEDIR."register.php'>Регистрация</a>&nbsp;&nbsp;<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp;<a href='".BASEDIR."lostpassword.php' class='side'>Забыли пароль?</a>";
}


echo "</td>
<td align='right' style='padding: 8px 4px 8px 4px; text-align:right; font-size: 10px; font-weight:bold;'  class='tbl2'>";

if (!iMEMBER) {
	echo "<form name='loginform' method='post' action=''>
Имя &nbsp;<input type='text' name='user_name' class='textbox' style='width:100px' onfocus=this.value='' value='Логин'>
Пароль&nbsp;<input type='password' name='user_pass' class='textbox' style='width:100px' onfocus=this.value='' value='********'>
<input type='checkbox' name='remember_me' value='y'>запомнить
<input type='submit' name='login_forum' value='Войти' class='button'><br>
</form>";
}

if (iADMIN) {

echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp<a href='".ADMIN."index.php".$aidlink."' target='_balnk'><b>Админпанель</b></a>&nbsp;&nbsp;";

} 

if (iMEMBER) {

echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp;<a href='".BASEDIR."edit_profile.php'>Личные данные</a>&nbsp;&nbsp;";

} 

if (iMEMBER) {

echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp;<a href='".FORUM."newposts.php'>Новые сообщения</a>&nbsp;&nbsp;";

} 


//View Private Messages + Members
if (iMEMBER) {

	echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp;<a href='".BASEDIR."members.php'>Пользователи</a>&nbsp;&nbsp;";
		echo "<img border='0' src='".THEME."images/bullet.gif'>&nbsp;&nbsp;<a href='".BASEDIR."messages.php'>Новых сообщений:</a>";
		$msg_count = dbcount("(message_id)", "messages", "message_to='".$userdata['user_id']."' AND message_read='0'AND message_folder='0'");	

	echo"&nbsp;<b>[<a href='".BASEDIR."messages.php?folder=inbox' class='side'><b>".sprintf($msg_count)."</a>]";
		echo "&nbsp;&nbsp;";
} else {
	echo "&nbsp;&nbsp;";
}
//


echo "</td>

</tr></table>\n";

echo "<table cellpadding='0' cellspacing='0' width='100%'>\n<tr>\n";


//render_headerf("<img src='".BASEDIR.$settings['sitebanner']."' alt='".$settings['sitename']."' title='".$settings['sitename']."'>");
?>