X-Git-Url: http://git.pjr.cc/?p=CBFWR.git;a=blobdiff_plain;f=libcbfwr%2Fweb.php;h=289fe19bb7a967223335c3a6406f973455cc125c;hp=6f976750366918f8d443f82c75505703fb6750b5;hb=cb45585d92144a65ff25bc1109cde4cbf60913de;hpb=13e5ebe14a18fb0d217fdc6fc4fc786a678889da diff --git a/libcbfwr/web.php b/libcbfwr/web.php index 6f97675..289fe19 100644 --- a/libcbfwr/web.php +++ b/libcbfwr/web.php @@ -89,6 +89,8 @@ function CBFBuildHomePage($urls) $comms = new Comms(); + + CBFWAddMessage("1", "i am a message"); echo "
"; print_r($comms->getConfig(0)); echo "\n\n\n"; @@ -132,12 +134,47 @@ function gcam($m, $s) function CBFWAddMessage($messagelev, $message) { + $comms = new Comms(); + $msgs = $comms->getConfig(6); + $cnum = 0; + if($msgs != false) { + foreach($msgs as $key=>$val) { + if($key >= $cnum) $cnum = $key+1; + } + } else { + $msgs = array(); + } + $msgs[$cnum]["timestamp"] = time(); + $msgs[$cnum]["level"] = $messagelev; + $msgs[$cnum]["message"] = $message; + $comms->putConfig($msgs, 6); } function CBFWMessageBuilder() { - echo "message"; + // show only 10 messages on this page + $maxshow = 6; + + $comms = new Comms(); + + $msgs = $comms->getConfig(6); + if($msgs != false) { + krsort($msgs); + } + $show = 0; + if(count($msgs) > 0) { + echo "
$datetime | $sev | $message |