2018-08-04 10:53:24 +02:00
< ? php
require_once ( " config.inc.php " );
// Check User online
2018-08-04 11:50:40 +02:00
$result = mysqli_query ( $dbconn , " SELECT id, a_name, real_name FROM admin_users where last_seen > ' $useronlinetime ' ORDER BY a_name ASC " ) or die ( mysqli_error ());
2018-08-04 11:33:52 +02:00
while ( $row = mysqli_fetch_array ( $result ))
2018-08-04 10:53:24 +02:00
{
$show_online_users .= '<a href="javascript:oeffnefenster(\'pmfunctions.inc.php?pmdo=write&msg_to=' . $row [ " id " ] . '\');" title="Nachricht an: ' . $row [ " real_name " ] . '"><i>' . $row [ " a_name " ] . '</i></a>,' ;
}
// Check Wetter
2018-08-04 11:50:40 +02:00
$result = mysqli_query ( $dbconn , " SELECT u_meldung, u_text, u_farbe, DATE_FORMAT(u_lastcheck, '%Y%m%d%H%i%s') AS u_lastcheck, DATE_FORMAT(u_lastchange, '%Y%m%d%H%i%s') AS u_lastchange FROM unwetter WHERE id = '1' " ) or die ( mysqli_error ());
2018-08-04 11:33:52 +02:00
$row = mysqli_fetch_array ( $result );
2018-08-04 10:53:24 +02:00
if ( ! empty ( $row [ " u_meldung " ]) )
{
$uw_show_link = '<a href="javascript:animatedcollapse.toggle(\'wetter\')"><font style="background-color:#FFFFFF;"> toggle </font></a>' ;
$uw_warntime = time_format ( get_time ( $row [ " u_lastchange " ]));
$uw_text = $row [ " u_text " ];
// Neu markieren wenn ungelesen
if ( $_SESSION [ " last_seen " ] <= $row [ " u_lastchange " ] ) $_SESSION [ " uw_isnew " ] = 'neu' ;
eval ( " \$ unwetter_field .= \" " . gettemplate ( $template_dir . " body_unwetter " ) . " \" ; " );
}
// Check PM
2018-08-04 11:50:40 +02:00
$result = mysqli_query ( $dbconn , " SELECT a.*, DATE_FORMAT(a.pm_date, '%Y%m%d%H%i%s') AS date, b.real_name
2018-08-04 10:53:24 +02:00
FROM messages a
LEFT JOIN admin_users b ON b . id = a . userid_from
2018-08-04 11:33:52 +02:00
WHERE a . userid_to = '$_SESSION[userid]' ORDER BY pm_date ASC " ) or die (mysqli_error());
while ( $row = mysqli_fetch_array ( $result ))
2018-08-04 10:53:24 +02:00
{
$msg_date = get_date_long ( $row [ " date " ]) . " / " . get_time ( $row [ " date " ]);
$msg_text = nl2br ( $row [ " message " ]);
eval ( " \$ message_field .= \" " . gettemplate ( $template_dir . " body_message " ) . " \" ; " );
}
// Ausgabe
echo " <html> " ;
if ( $_SESSION [ " online_users " ] != $show_online_users ) echo $show_online_users ;
echo " | " ;
if ( ! empty ( $uw_text ) ) echo $unwetter_field . " @ " . $uw_text ;
echo " | " ;
if ( ! empty ( $msg_date ) ) echo $message_field ;
echo " </html> " ;
// Sessions füllen
$_SESSION [ " online_users " ] = $show_online_users ;
?>