brusselopole/Worldopole

[Bug] Lure Map shows more lures + Timezone

Closed this issue · 0 comments

pki0 commented

Expected Behavior

Current Behavior

	case 'pokestop':
		$req 		= "SELECT latitude, longitude, lure_expiration FROM pokestop";
		$result 	= $mysqli->query($req);

		$i=0;

		while ($data = $result->fetch_object()) {
			if ($data->lure_expiration != '') {
				$icon = 'pokestap_lured.png';
				$text = 'Lured expire @ '.date('h:i:s', strtotime($data->lure_expiration)+(3600*2)) ;
			} else {
				$icon = 'pokestap.png';
				$text = 'Normal stop';
			}
  • Timezone is wrong here/no dynamic timezone
  • Shows also inactive lures on map on my Setup

if ($data->lure_expiration != '')
This don't work, because mysql keeps a date and not change it back to "NULL"

Possible Solution

	case 'pokestop':
		$req 		= "SELECT latitude, longitude, lure_expiration, UTC_TIMESTAMP() as now FROM pokestop";
		$result 	= $mysqli->query($req);

		$i=0;

		while ($data = $result->fetch_object()) {
			if ($data->lure_expiration >= $data->now) {

Timezone have to be fixed