<?
$phpbb_root_path = './forum/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
$redirect = '../index.php';
$images_path = $phpbb_path.'templates/'.$theme[template_name].'/images/';
$images['login'] = '<img src=\"'.$images_path.'icon_mini_login.gif\" />';
$login_path = append_sid($phpbb_path.'login.'.$phpEx.'');
$images['profile'] = '<img src=\"'.$images_path.'icon_mini_profile.gif\" />';
$profile_edit = append_sid($phpbb_path.'profile.'.$phpEx.'?mode=editprofile');
$profile_register = append_sid($phpbb_path.'profile.'.$phpEx.'?mode=register');
$images['pm_new_msg'] = '<img src=\"'.$images_path.'icon_mini_message.gif\" />';
$images['pm_no_new_msg'] = $images['pm_new_msg'];
if ( ($userdata['session_logged_in']) )
{
if ( $userdata['user_new_privmsg'] )
{
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']);
if ( $userdata['user_last_privmsg'] > $userdata['user_lastvisit'] )
{
$s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'];
}
else
{
$s_privmsg_new = 0;
$icon_pm = $images['pm_new_msg'];
}
}
else
{
$l_privmsgs_text = $lang['No_new_pm'];
$s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
}
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); }
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$l_privmsgs_text_unread = '';
$s_privmsg_new = 0;
}
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
'PRIVMSG_IMG' => $icon_pm,
'L_PRIVATEMSGS' => $lang['Private_Messages'],
'U_PRIVATEMSGS' => append_sid($phpbb_path.'privmsg.'.$phpEx.'?folder=inbox'),
'U_PRIVATEMSGS_POPUP' => append_sid($phpbb_path.'privmsg.'.$phpEx.'?mode=newpm'),
);
$login = '
<form method=\"post\" action=\"'.$login_path.'\">
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">
<tr>
<td align=\"center\" class=\"postbody\">
'.$images[login].' <input type=\"text\" name=\"username\" size=\"11\" class=\"post\" value=\"nick\" />
<input type=\"password\" name=\"password\" size=\"11\" maxlength=\"32\" class=\"post\" value=\"pass\" />
<input type=\"hidden\" name=\"redirect\" value=\"'.$redirect.'\" />
<input type=\"checkbox\" name=\"autologin\" class=\"post\" />
<input type=\"submit\" name=\"login\" value=\"Zaloguj\" class=\"post\" /> |
'.$images[profile].' Tu się możesz <a href=\"'.$profile_register.'\">zarejestrować</a>.
</td>
</tr>
</table>
</form>';
$logout = '
<form method=\"post\" action=\"'.$login_path.'\">
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"100%\">
<tr>
<td align=\"center\" valign=\"bottom\" class=\"postbody\">'.$images[login].' Witaj: <b>'.$userdata[username].'</b>
<input type=\"hidden\" name=\"redirect\" value=\"'.$redirect.'\" />
<input type=\"submit\" name=\"logout\" value=\"Wyloguj\" class=\"post\" /> |
'.$pm['PRIVMSG_IMG'].' <a href=\"'.$pm['U_PRIVATEMSGS'].'\" class=\"mainmenu\">'.$pm['PRIVATE_MESSAGE_INFO'].'</a> |
'.$images[profile].' <a href=\"'.$profile_edit.'\" class=\"mainmenu\">Profil</a>
</td>
</tr>
</table>
</form>';
$form = ($userdata['session_logged_in']) ? $logout : $login;
?>