monitor-frontend/get_other.php
2018-08-04 10:53:24 +02:00

55 lines
2.0 KiB
PHP
Executable File

<?php
require_once("config.inc.php");
// Check User online
$result = mysql_query("SELECT id, a_name, real_name FROM admin_users where last_seen > '$useronlinetime' ORDER BY a_name ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$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
$result = mysql_query("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 (mysql_error());
$row = mysql_fetch_array($result);
if( !empty($row["u_meldung"]) )
{
$uw_show_link = '<a href="javascript:animatedcollapse.toggle(\'wetter\')"><font style="background-color:#FFFFFF;"> &nbsp;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
$result = mysql_query("SELECT a.*, DATE_FORMAT(a.pm_date, '%Y%m%d%H%i%s') AS date, b.real_name
FROM messages a
LEFT JOIN admin_users b ON b.id = a.userid_from
WHERE a.userid_to = '$_SESSION[userid]' ORDER BY pm_date ASC") or die (mysql_error());
while($row = mysql_fetch_array($result))
{
$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;
?>