curl_setopt($ch, CURLOPT_URL, "http://redisq.zkillboard.com/listen.php"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $timer = new Timer(); while ($timer->stop() < 58000) { $raw = curl_exec($ch); $json = json_decode($raw, true); if (!isset($json['package'])) { exit; } // Something's wrong , exit and try again later $killmail = $json['package']; if ($killmail == null) { continue; } $killID = $killmail['killID']; if (checkFilter($killmail['killmail']) == false) { continue; } $hash = $killmail['zkb']['hash']; if (!$mdb->exists("crestmails", ['killID' => $killID, 'hash' => $hash])) { $mdb->save("crestmails", ['killID' => $killID, 'hash' => $hash, 'processed' => false]); } } curl_close($ch); function checkFilter($killmail) { global $characters, $corporations, $alliances; if (sizeof($characters) == 0 && sizeof($corporations) == 0 && sizeof($alliances) == 0) { return true; } $hasID = checkEntities([$killmail['victim']]);
$comment = $_REQUEST['comment']; $maxspeed = $_REQUEST['maxspeed']; $averagespeed = $_REQUEST['averagespeed']; $duration = $_REQUEST['duration']; $distance = $_REQUEST['distance']; addWorkout(); } else { if (!strcmp($action, "applyFilter")) { $timerange = $_REQUEST['timerange']; $commentpattern = $_REQUEST['commentpattern']; $filter = applyFilter(); } } } } $filter = checkFilter(); /*print($filter);*/ ?> <body> <div id="wrap"> <div id="header"> <h1>JuMiCycling</h1> <h2>Repository for Cycling statistics</h2> </div> <div id="menu"> <!--<a href="#">Home</a> <a href="#">About </a> <a href="#">Contact</a>--></div> <div id="content"> <h2>Add workout</h2> <p><table width="100%"><tr> <td width="5%"> </td>