<?php
# Copyright by Manuel
# Support www.ilch.de
defined (
'main'
)
or
die
(
'no direct access'
);
$dif
=
date
(
'Y-m-d H:i:s'
, time() - 60);
$abf
=
"SELECT uid FROM `prefix_online` WHERE uptime > '"
.
$dif
.
"'"
;
$resultID
= db_query(
$abf
);
$brk
=
''
;
$uid
=
array
();
$guests
= 0;
$guestn
=
$lang
[
'guests'
];
$content
=
''
;
while
(
$row
= db_fetch_object(
$resultID
)) {
if
(
$row
->uid != 0 AND
$brk
!=
$row
->uid) {
$name
=@db_result(db_query(
'SELECT name FROM prefix_user WHERE id='
.
$row
->uid),0);
$content
.=
'<a href="index.php?user-details-'
.
$row
->uid.
'">'
.
$name
.
'</a>, '
.
""
;
$uid
[] =
$row
->uid;
}
}
$tpl
=
new
tpl (
'user/boxen_login.htm'
);
if
( loggedin() ) {
if
( user_has_admin_right(
$menu
,false) ) {
$tpl
->set (
'ADMIN'
,
'<a class="box" href="admin.php?admin">'
.
$lang
[
'adminarea'
].
'</a>'
);
}
else
{
$tpl
->set (
'ADMIN'
,
''
);
}
if
(
$allgAr
[
'Fpmf'
] == 1 ) {
$erg
= db_query(
"SELECT COUNT(id) FROM `prefix_pm` WHERE gelesen = 0 AND status < 1 AND eid = "
.
$_SESSION
[
'authid'
]);
$check_pm
= db_result(
$erg
,0);
$nachrichten_link
=
'<a class="box" href="index.php?forum-privmsg">'
.
$lang
[
'messages'
].
'</a> ('
.
$check_pm
.
')<br>'
;
}
else
{
$nachrichten_link
=
''
;
}
$abf1
=
'SELECT id, name, avatar FROM prefix_user WHERE name = "'
.
$_SESSION
[
'authname'
].
'"'
;
$erg1
= db_query(
$abf1
);
$row
= db_fetch_object(
$erg1
);
$id
=
$row
->id;
if
(
file_exists
(
$row
->avatar)) {
$avatar
=
'<br><img src="'
.
$row
->avatar.
'" border="0"><br>'
;
}
else
{
$avatar
=
'<br><img src="include/images/avatars/avat.png" border="0"><br>'
;
}
$tpl
->set (
'UID'
,
$id
);
$tpl
->set (
'AVATAR'
,
$avatar
);
$tpl
->set (
'SID'
, session_id() );
$tpl
->set (
'NACHRICHTEN'
,
$nachrichten_link
);
$tpl
->set (
'NAME'
,
$_SESSION
[
'authname'
] );
$tpl
->set (
'USER'
,
$content
);
$tpl
->out (0);
}
else
{
if
(
empty
(
$_POST
[
'login_name'
])) {
$_POST
[
'login_name'
] =
'Nickname'
; }
if
(
empty
(
$_POST
[
'login_pw'
])) {
$_POST
[
'login_pw'
] =
'ääääääää'
; }
$regist
=
''
;
if
(
$allgAr
[
'forum_regist'
] == 1 ) {
$regist
=
' <a href="index.php?user-regist">Regist</a>'
;
}
$tpl
->set_ar_out (
array
(
'regist'
=>
$regist
,
'wdlink'
=>
'?'
.
$allgAr
[
'smodul'
],
'PASS'
=>
$_POST
[
'login_pw'
],
'NAME'
=>
$_POST
[
'login_name'
] ) , 1 );
}
unset(
$tpl
);
?>