monitor-frontend/get_other.php

61 lines
2.3 KiB
PHP
Raw Normal View History

2018-08-04 10:53:24 +02:00
<?php
require_once("config.inc.php");
// Check User online
2018-10-01 12:12:24 +02:00
if (!isset($show_online_users)) $show_online_users = "";
$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($dbconn));
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-10-01 12:12:24 +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($dbconn));
$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;"> &nbsp;toggle </font></a>';
$uw_warntime = time_format(get_time($row["u_lastchange"]));
$uw_text = $row["u_text"];
// Neu markieren wenn ungelesen
2018-10-01 12:12:24 +02:00
( $_SESSION["last_seen"] <= $row["u_lastchange"] ) ? $_SESSION["uw_isnew"] = 'neu' : $_SESSION["uw_isnew"] = "";
if (!isset($unwetter_field)) $unwetter_field = "";
2018-08-04 10:53:24 +02:00
eval ("\$unwetter_field .= \"".gettemplate($template_dir."body_unwetter")."\";");
}
2018-10-01 12:12:24 +02:00
*/
2018-08-04 10:53:24 +02:00
// Check PM
2018-10-01 12:12:24 +02:00
if (!isset($message_field)) $message_field = "";
$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-10-01 12:12:24 +02:00
WHERE a.userid_to = '$_SESSION[userid]' ORDER BY pm_date ASC") or die (mysqli_error($dbconn));
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>";
2018-10-01 12:12:24 +02:00
if( !isset($_SESSION["online_users"]) || $_SESSION["online_users"] != $show_online_users ) echo $show_online_users;
2018-08-04 10:53:24 +02:00
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;
?>