diff --git a/etc/inc/notices.inc b/etc/inc/notices.inc index 755d4efef1..4dff7c20c3 100644 --- a/etc/inc/notices.inc +++ b/etc/inc/notices.inc @@ -44,7 +44,7 @@ $notice_path = $g['tmp_path'] . '/notices'; * $priority - A notice's priority. Higher numbers indicate greater severity. * 0 = informational, 1 = warning, 2 = error, etc. This may also be arbitrary, */ -function file_notice($id, $notice, $category = "General", $url = "", $priority = 1) { +function file_notice($id, $notice, $category = "General", $url, $priority = 1) { global $notice_path; if(!$queue = get_notices()) $queue = array(); $queuekey = time(); @@ -66,6 +66,7 @@ function get_notices($category = "all") { global $notice_path; if(file_exists($notice_path)) { $queue = unserialize(file_get_contents($notice_path)); + if(!$queue) return false; if($category != 'all') { foreach($queue as $time => $notice) { if(strtolower($notice['category']) == strtolower($category)) @@ -103,10 +104,9 @@ function close_notice($id) { break; } } - /* XXX: what's $queue? This does nothing right now so I commented it out --Bill */ -/* $queueout = fopen($notice_path, "w"); + $queueout = fopen($notice_path, "w"); fwrite($queueout, serialize($queue)); - fclose($queueout);*/ + fclose($queueout); return; } @@ -151,4 +151,10 @@ function print_notices($notices, $category = "all") { return $toreturn; } +function print_notice_box($category = "all") { + $notices = get_notices(); + if(!$notices) return; + print_info_box_np(print_notices($notices, $category)); + return; +} ?>