function qs_process_pages($page, $month) { $file = QS_META . $month . '/page_users.ser'; $page_users = unserialize(file_get_contents($file)); $found = qs_pages_search_i($page, $month); if (!$found) { echo "no data\n"; exit; } foreach ($found as $page => $accesses) { echo "{$page}=>{$accesses}\n"; print_r($page_users[md5($page)]); } }
/** * @param $page: page name or partial name from $_POST * @return array of [page_names] = array(accesses=>integer, ips=>array(ip_addresses)) */ function qs_process_pages($page) { $month = rawurldecode($_POST['date']); $page_users = load_data('page_users', $month); $found = qs_pages_search_i($page, $month); if (!$found) { echo "no data\n"; exit; } $temp = array(); foreach ($found as $page => $accesses) { if (isset($page_users[md5($page)])) { $temp[$page] = array('accesses' => $accesses, 'ips' => $page_users[md5($page)]); } } return $temp; }