--- a/stats-fe.php Sat Oct 11 20:28:32 2008 -0400
+++ b/stats-fe.php Sat Oct 11 20:31:22 2008 -0400
@@ -122,25 +122,28 @@
function stats_merge($data)
{
global $stats_merged_data;
- foreach ( $data['counts'] as $channel => $chaninfo )
+ if ( isset($data['counts']) )
{
- if ( isset($stats_merged_data['counts'][$channel]) )
+ foreach ( $data['counts'] as $channel => $chaninfo )
{
- foreach ( $stats_merged_data['counts'][$channel] as $key => &$value )
+ if ( isset($stats_merged_data['counts'][$channel]) )
{
- if ( is_int($value) )
+ foreach ( $stats_merged_data['counts'][$channel] as $key => &$value )
{
- $value = max($value, $chaninfo[$key]);
- }
- else if ( is_array($value) )
- {
- $value = array_merge($value, $chaninfo[$key]);
+ if ( is_int($value) )
+ {
+ $value = max($value, $chaninfo[$key]);
+ }
+ else if ( is_array($value) )
+ {
+ $value = array_merge($value, $chaninfo[$key]);
+ }
}
}
- }
- else
- {
- $stats_merged_data['counts'][$channel] = $chaninfo;
+ else
+ {
+ $stats_merged_data['counts'][$channel] = $chaninfo;
+ }
}
}
foreach ( $data['messages'] as $channel => $chandata )