diff --git a/html/includes/print-event.inc b/html/includes/print-event.inc
index ac23a7f101..288128a1c4 100644
--- a/html/includes/print-event.inc
+++ b/html/includes/print-event.inc
@@ -4,19 +4,18 @@
if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
$hostname = gethostbyid($entry['host']);
- $interface = fixifname(getifbyid($entry['interface']));
unset($icon);
$icon = geteventicon($entry['message']);
- if($icon) {$icon = "
"; }
+ if($icon) {$icon = '
'; }
- echo("
- |
-
- " . $entry['datetime'] . "
- | ");
+ echo('
+ |
+
+ ' . $entry['datetime'] . '
+ | ');
if(!$_GET[id] && !$overview) {
$dev['device_id'] = $entry['host'];
$dev['hostname'] = $hostname;
@@ -25,15 +24,11 @@ if($bg == $list_colour_a) { $bg = $list_colour_b; } else { $bg=$list_colour_a; }
");
}
- echo("");
-
- if($interface) {
- $if['interface_id'] = $entry['interface'];
- $if['ifDescr'] = $interface;
- echo(generateiflink($if));
+ echo(' | ');
+ if($entry['interface']) {
+ echo(generateiflink(getifbyid($entry['interface'])));
}
- echo(" " . htmlspecialchars($entry['message']) . "
- |
+ echo("" . htmlspecialchars($entry['message']) . " |
");
diff --git a/html/pages/device/events.inc.php b/html/pages/device/events.inc.php
index bd6b01e56f..c20b41283d 100644
--- a/html/pages/device/events.inc.php
+++ b/html/pages/device/events.inc.php
@@ -2,11 +2,11 @@
$query = "SELECT *,DATE_FORMAT(datetime, '%D %b %Y %T') as humandate FROM `eventlog` WHERE `host` = '$_GET[id]' ORDER BY `datetime` DESC LIMIT 0,250";
$data = mysql_query($query);
-echo("");
+echo('');
while($entry = mysql_fetch_array($data)) {
include("includes/print-event.inc");
}
-echo("
");
+echo('
');
- ?>
+?>
diff --git a/html/pages/eventlog.php b/html/pages/eventlog.php
index b57b713c38..63985c83f1 100644
--- a/html/pages/eventlog.php
+++ b/html/pages/eventlog.php
@@ -9,7 +9,7 @@ if($_SESSION['userlevel'] >= '5') {
$data = mysql_query($query);
-echo("");
+echo('');
while($entry = mysql_fetch_array($data)) {
include("includes/print-event.inc");
@@ -17,4 +17,4 @@ while($entry = mysql_fetch_array($data)) {
echo("
");
- ?>
+?>
diff --git a/includes/common.php b/includes/common.php
index 4c7145015c..5c1ebc01fc 100644
--- a/includes/common.php
+++ b/includes/common.php
@@ -51,6 +51,12 @@ function getifindexbyid($id) {
}
function getifbyid($id) {
+ $sql = mysql_query("SELECT * FROM `interfaces` WHERE `interface_id` = '$id'");
+ $result = @mysql_fetch_array($sql);
+ return $result;
+}
+
+function getifdescrbyid($id) {
$sql = mysql_query("SELECT `ifDescr` FROM `interfaces` WHERE `interface_id` = '$id'");
$result = @mysql_result($sql, 0);
return $result;