htdocs/24hours.php
changeset 20 e2f6e3af9959
parent 12 7f043e712c35
child 34 a8daa2016cf1
equal deleted inserted replaced
19:eb92dc5d9fb4 20:e2f6e3af9959
     2 
     2 
     3 require('../stats-fe.php');
     3 require('../stats-fe.php');
     4 require('../graphs.php');
     4 require('../graphs.php');
     5 require('../timezone.php');
     5 require('../timezone.php');
     6 
     6 
     7 $first_channel = array_keys($stats_data['messages']);
     7 $channel_list = stats_channel_list();
     8 $first_channel = $first_channel[0];
     8 $first_channel = $channel_list[0];
     9 $channel = ( isset($_REQUEST['channel']) && isset($stats_data['messages'][$_REQUEST['channel']]) ) ? $_REQUEST['channel'] : $first_channel;
     9 $channel = ( isset($_REQUEST['channel']) && in_array($_REQUEST['channel'], $channel_list) ) ? $_REQUEST['channel'] : $first_channel;
    10 
    10 
    11 // generate the data
    11 // generate the data
    12 // we're doing this by absolute hours, not by strictly "24 hours ago", e.g. on-the-hour stats
    12 // we're doing this by absolute hours, not by strictly "24 hours ago", e.g. on-the-hour stats
    13 $this_hour = gmmktime(gmdate('H'), 0, 0);
    13 $this_hour = gmmktime(gmdate('H'), 0, 0);
    14 $graphdata = array();
    14 $graphdata = array();