From 305bb5dd9c7af8963715fcfe4b226727fcc40c4f Mon Sep 17 00:00:00 2001 From: paulr Date: Thu, 20 Oct 2011 13:37:23 +1100 Subject: [PATCH] not sure really --- libcbfwr/web.php | 29 ++++++++++++++++++++++++++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/libcbfwr/web.php b/libcbfwr/web.php index 289fe19..7f76f11 100644 --- a/libcbfwr/web.php +++ b/libcbfwr/web.php @@ -90,7 +90,7 @@ function CBFBuildHomePage($urls) $comms = new Comms(); - CBFWAddMessage("1", "i am a message"); + CBFWAddMessage(rand(1,6), "i am a message"); echo "
";
 	print_r($comms->getConfig(0));
 	echo "\n\n\n";
@@ -166,10 +166,33 @@ function CBFWMessageBuilder()
 	if(count($msgs) > 0) {
 		echo "";
 		foreach($msgs as $key => $val) {
-			$datetime = $val["timestamp"];
+			$datetime = strftime("%c", $val["timestamp"]);
 			$sev = $val["level"];
 			$message = $val["message"];
-			echo "";
+			
+			$sevcolour = "#ddffdd";
+			switch($sev) {
+				case "1":
+					$sevcolour = "#ffaaaa";
+					break;
+				case "2":
+					$sevcolour = "#ffdddd";
+					break;
+				case "3":
+					$sevcolour = "#ffffdd";
+					break;
+				case "4":
+					$sevcolour = "#ddffdd";
+					break;
+				case "5":
+					$sevcolour = "#aaffaa";
+					break;
+				case "6":
+					$sevcolour = "#ccaaaa";
+					break;
+			}
+			
+			echo "";
 			$show++;
 			if($show >= $maxshow) break;
 		}
-- 
1.7.0.4

$datetime$sev$message
$datetime$message ($sev)