Failed Conditions
Pull Request — master (#373)
by Florian
02:49
created
core/js/dashboard.graph.js.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -59,83 +59,83 @@  discard block
 block discarded – undo
59 59
 $captcha_accs = array();
60 60
 
61 61
 foreach ($stats as $data) {
62
-    if ($data->timestamp > $lastweek) {
63
-        $labels_global[] = '"'.date('D H:i', $data->timestamp).'"';
64
-        $total[] = $data->pokemon_now;
65
-        if (isset($data->pokemon_now_iv)) {
66
-            $total_iv[] = $data->pokemon_now_iv;
67
-        } else {
68
-            $total_iv[] = null;
69
-        }
70
-    }
62
+	if ($data->timestamp > $lastweek) {
63
+		$labels_global[] = '"'.date('D H:i', $data->timestamp).'"';
64
+		$total[] = $data->pokemon_now;
65
+		if (isset($data->pokemon_now_iv)) {
66
+			$total_iv[] = $data->pokemon_now_iv;
67
+		} else {
68
+			$total_iv[] = null;
69
+		}
70
+	}
71 71
 
72
-    if ($data->timestamp > $yesterday) {
73
-        $labels[] = '"'.date('H:i', $data->timestamp).'"';
74
-
75
-        if (isset($data->rarity_spawn->{'Very common'})) {
76
-            $veco[] = $data->rarity_spawn->{'Very common'};
77
-        } else {
78
-            $veco[] = 0;
79
-        }
80
-
81
-        if (isset($data->rarity_spawn->Common)) {
82
-            $commo[] = $data->rarity_spawn->Common;
83
-        } else {
84
-            $commo[] = 0;
85
-        }
86
-
87
-        if (isset($data->rarity_spawn->Rare)) {
88
-            $rare[] = $data->rarity_spawn->Rare;
89
-        } else {
90
-            $rare[] = 0;
91
-        }
92
-
93
-        if (isset($data->rarity_spawn->Mythic)) {
94
-            $myth[] = $data->rarity_spawn->Mythic;
95
-        } else {
96
-            $myth[] = 0;
97
-        }
98
-    }
72
+	if ($data->timestamp > $yesterday) {
73
+		$labels[] = '"'.date('H:i', $data->timestamp).'"';
74
+
75
+		if (isset($data->rarity_spawn->{'Very common'})) {
76
+			$veco[] = $data->rarity_spawn->{'Very common'};
77
+		} else {
78
+			$veco[] = 0;
79
+		}
80
+
81
+		if (isset($data->rarity_spawn->Common)) {
82
+			$commo[] = $data->rarity_spawn->Common;
83
+		} else {
84
+			$commo[] = 0;
85
+		}
86
+
87
+		if (isset($data->rarity_spawn->Rare)) {
88
+			$rare[] = $data->rarity_spawn->Rare;
89
+		} else {
90
+			$rare[] = 0;
91
+		}
92
+
93
+		if (isset($data->rarity_spawn->Mythic)) {
94
+			$myth[] = $data->rarity_spawn->Mythic;
95
+		} else {
96
+			$myth[] = 0;
97
+		}
98
+	}
99 99
 }
100 100
 
101 101
 $stats_file = SYS_PATH.'/core/json/gym.stats.json';
102 102
 $stats = json_decode(file_get_contents($stats_file));
103 103
 
104 104
 foreach ($stats as $data) {
105
-    if ($data->timestamp > $lastweek) {
106
-        $labels_gym[] = '"'.date('D H:i', $data->timestamp).'"';
105
+	if ($data->timestamp > $lastweek) {
106
+		$labels_gym[] = '"'.date('D H:i', $data->timestamp).'"';
107 107
 
108
-        $mystic_average[] = $data->team->mystic->average;
109
-        $mystic_owned[] = $data->team->mystic->gym_owned;
108
+		$mystic_average[] = $data->team->mystic->average;
109
+		$mystic_owned[] = $data->team->mystic->gym_owned;
110 110
 
111
-        $valor_average[] = $data->team->valor->average;
112
-        $valor_owned[] = $data->team->valor->gym_owned;
111
+		$valor_average[] = $data->team->valor->average;
112
+		$valor_owned[] = $data->team->valor->gym_owned;
113 113
 
114
-        $instinct_average[] = $data->team->instinct->average;
115
-        $instinct_owned[] = $data->team->instinct->gym_owned;
116
-    }
114
+		$instinct_average[] = $data->team->instinct->average;
115
+		$instinct_owned[] = $data->team->instinct->gym_owned;
116
+	}
117 117
 }
118 118
 
119 119
 $stats_file = SYS_PATH.'/core/json/pokestop.stats.json';
120 120
 $stats = json_decode(file_get_contents($stats_file));
121 121
 
122 122
 foreach ($stats as $data) {
123
-    if ($data->timestamp > $lastweek) {
124
-        $labels_stops[] = '"'.date('D H:i', $data->timestamp).'"';
125
-        $lure[] = $data->lured;
126
-    }
123
+	if ($data->timestamp > $lastweek) {
124
+		$labels_stops[] = '"'.date('D H:i', $data->timestamp).'"';
125
+		$lure[] = $data->lured;
126
+	}
127 127
 }
128 128
 
129 129
 if ($config->system->captcha_support) {
130
-    $stats_file = SYS_PATH.'/core/json/captcha.stats.json';
131
-    $stats = json_decode(file_get_contents($stats_file));
132
-
133
-    foreach ($stats as $data) {
134
-        if ($data->timestamp > $lastweek) {
135
-            $labels_captcha[] = '"'.date('D H:i', $data->timestamp).'"';
136
-            $captcha_accs[] = $data->captcha_accs;
137
-        }
138
-    }
130
+	$stats_file = SYS_PATH.'/core/json/captcha.stats.json';
131
+	$stats = json_decode(file_get_contents($stats_file));
132
+
133
+	foreach ($stats as $data) {
134
+		if ($data->timestamp > $lastweek) {
135
+			$labels_captcha[] = '"'.date('D H:i', $data->timestamp).'"';
136
+			$captcha_accs[] = $data->captcha_accs;
137
+		}
138
+	}
139 139
 }
140 140
 
141 141
 ?>
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 // -------------
595 595
 
596 596
 <?php if ($config->system->captcha_support) {
597
-    ?>
597
+	?>
598 598
 var ctx_captcha_accs = $('#captcha');
599 599
 
600 600
 var data_captcha_accs = {
Please login to merge, or discard this patch.
pages/pokemon.page.php 1 patch
Indentation   +102 added lines, -102 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 		<div class="col-sm-1 hidden-xs">
19 19
 
20 20
 				<?php if ($pokemon->id - 1 > 0) {
21
-    ?>
21
+	?>
22 22
 
23 23
 				<p class="nav-links"><a href="pokemon/<?= $pokemon->id - 1; ?>"><i class="fa fa-chevron-left"></i></a></p>
24 24
 
@@ -44,19 +44,19 @@  discard block
 block discarded – undo
44 44
 		<div class="col-sm-1 hidden-xs">
45 45
 
46 46
 			<?php if ($pokemon->id + 1 < $config->system->max_pokemon) {
47
-        ?>
47
+		?>
48 48
 
49 49
 			<p class="nav-links"><a href="pokemon/<?= $pokemon->id + 1; ?>"><i class="fa fa-chevron-right"></i></a></p>
50 50
 
51 51
 			<?php
52
-    } ?>
52
+	} ?>
53 53
 		</div>
54 54
 
55 55
 	</div>
56 56
 <?php
57
-    $form_array = array('Unset', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'X', 'Y', 'Z');
58
-    $form_array = array_values($form_array);
59
-    ?>
57
+	$form_array = array('Unset', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'X', 'Y', 'Z');
58
+	$form_array = array_values($form_array);
59
+	?>
60 60
 
61 61
 </header>
62 62
 <!-- /Header -->
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 
79 79
 				<p>
80 80
 				<?php foreach ($pokemon->types as $type) {
81
-        ?>
81
+		?>
82 82
 					<span class="label label-default" style="background-color:<?= $pokemons->typecolors->$type; ?>"><?= $type; ?></span>
83 83
 				<?php
84
-    }?>
84
+	}?>
85 85
 				</p>
86 86
 
87 87
 			</div>
@@ -110,28 +110,28 @@  discard block
 block discarded – undo
110 110
 				<td class="col-md-4 col-xs-4">
111 111
 
112 112
 				<?php
113
-                if (isset($pokemon->last_seen) || isset($pokemon->last_seen_day)) {
113
+				if (isset($pokemon->last_seen) || isset($pokemon->last_seen_day)) {
114 114
 
115
-                    if (isset($pokemon->last_seen)) {
116
-                        $time_ago = time_ago($pokemon->last_seen, $locales);
117
-                    } else {
118
-                        $time_ago = time_ago_day($pokemon->last_seen_day, $locales);
119
-                    }
115
+					if (isset($pokemon->last_seen)) {
116
+						$time_ago = time_ago($pokemon->last_seen, $locales);
117
+					} else {
118
+						$time_ago = time_ago_day($pokemon->last_seen_day, $locales);
119
+					}
120 120
 
121
-                    if (isset($pokemon->last_position)) {
122
-                        ?>
121
+					if (isset($pokemon->last_position)) {
122
+						?>
123 123
                         <a href="https://maps.google.com/?q=<?= $pokemon->last_position->latitude; ?>,<?= $pokemon->last_position->longitude; ?>&ll=<?= $pokemon->last_position->latitude; ?>,<?= $pokemon->last_position->longitude; ?>&z=16" target="_blank"><?= $time_ago ?></a>
124 124
                         <?php
125
-                    } else {
126
-                        echo $time_ago;
127
-                    }
128
-                    ?>
125
+					} else {
126
+						echo $time_ago;
127
+					}
128
+					?>
129 129
 
130 130
 				    <?php
131
-                } else {
132
-                    echo $locales->NEVER;
133
-                }
134
-                ?>
131
+				} else {
132
+					echo $locales->NEVER;
133
+				}
134
+				?>
135 135
 
136 136
 				</td>
137 137
 			</tr>
@@ -146,15 +146,15 @@  discard block
 block discarded – undo
146 146
 			<tr>
147 147
 				<td class="col-md-8 col-xs-8">
148 148
                     <?php
149
-                    if (isset($pokemon->protected_gyms)) {
150
-                        echo '<strong>'.$locales->POKEMON_GYM.$pokemon->name.'</strong>';
151
-                    } ?>
149
+					if (isset($pokemon->protected_gyms)) {
150
+						echo '<strong>'.$locales->POKEMON_GYM.$pokemon->name.'</strong>';
151
+					} ?>
152 152
                 </td>
153 153
 				<td class="col-md-4 col-xs-4">
154 154
                     <?php
155
-                    if (isset($pokemon->protected_gyms)) {
156
-                        echo $pokemon->protected_gyms;
157
-                    }?>
155
+					if (isset($pokemon->protected_gyms)) {
156
+						echo $pokemon->protected_gyms;
157
+					}?>
158 158
                 </td>
159 159
 			</tr>
160 160
 		</table>
@@ -169,16 +169,16 @@  discard block
 block discarded – undo
169 169
 				<td class="col-md-4 col-xs-4">
170 170
 
171 171
                     <?php
172
-                    if (isset($pokemon->last_raid_position)) {
173
-                        ?>
172
+					if (isset($pokemon->last_raid_position)) {
173
+						?>
174 174
 
175 175
 					    <a href="https://maps.google.com/?q=<?= $pokemon->last_raid_position->latitude; ?>,<?= $pokemon->last_raid_position->longitude; ?>&ll=<?= $pokemon->last_raid_position->latitude; ?>,<?= $pokemon->last_raid_position->longitude; ?>&z=16" target="_blank"><?= time_ago($pokemon->last_raid_seen, $locales); ?></a>
176 176
 
177 177
 					    <?php
178
-                    } else {
179
-                        echo $locales->NEVER;
180
-                    }
181
-                    ?>
178
+					} else {
179
+						echo $locales->NEVER;
180
+					}
181
+					?>
182 182
 
183 183
 				</td>
184 184
 			</tr>
@@ -301,25 +301,25 @@  discard block
 block discarded – undo
301 301
 	<div class="col-md-12 flex-container-tree results">
302 302
 
303 303
 		<?php
304
-        $tree = array($pokemon->tree);
305
-        $depth = get_depth($tree);
306
-        $skip = false;
307
-        for ($i = 0; $i < $depth; ++$i) {
308
-            $i_id = intval(($i + 1) / 2);
309
-            $data = get_tree_at_depth($tree, $i_id, $config->system->max_pokemon); ?>
304
+		$tree = array($pokemon->tree);
305
+		$depth = get_depth($tree);
306
+		$skip = false;
307
+		for ($i = 0; $i < $depth; ++$i) {
308
+			$i_id = intval(($i + 1) / 2);
309
+			$data = get_tree_at_depth($tree, $i_id, $config->system->max_pokemon); ?>
310 310
 
311 311
 			<?php
312
-            if (!is_null($data) && 0 != sizeof($data) && !$skip) {
313
-                ?>
312
+			if (!is_null($data) && 0 != sizeof($data) && !$skip) {
313
+				?>
314 314
 				<div class="col-md-12 flex-item-tree">
315 315
 					<?php
316
-                    foreach ($data as $obj) {
317
-                        $obj_id = $obj->id;
318
-                        $tree_pokemon = $pokemons->pokemon->$obj_id;
319
-                        $link = 'pokemon/'.$obj_id;
316
+					foreach ($data as $obj) {
317
+						$obj_id = $obj->id;
318
+						$tree_pokemon = $pokemons->pokemon->$obj_id;
319
+						$link = 'pokemon/'.$obj_id;
320 320
 
321
-                        if (0 == $i % 2) {
322
-                            ?>
321
+						if (0 == $i % 2) {
322
+							?>
323 323
 
324 324
 							<div>
325 325
 								<a href="<?= $link; ?>"><img src="<?= $tree_pokemon->img; ?>" alt="<?= $tree_pokemon->name; ?>" class="img"></a>
@@ -327,42 +327,42 @@  discard block
 block discarded – undo
327 327
 							</div>
328 328
 
329 329
 						<?php
330
-                        } else {
331
-                            ?>
330
+						} else {
331
+							?>
332 332
 
333 333
 							<div>
334 334
 								<img src="core/img/arrow<?=$obj->array_sufix; ?>.png" alt="Arrow" class="img">
335 335
 								<p class="pkmn-name">
336 336
 									<?php
337
-                                    if (isset($obj->candies)) {
338
-                                        echo $obj->candies.' '.$locales->POKEMON_CANDIES;
339
-                                    } else {
340
-                                        echo '? '.$locales->POKEMON_CANDIES;
341
-                                    }
342
-
343
-                            if (isset($obj->item)) {
344
-                                $itemName = 'ITEM_'.$obj->item;
345
-                                echo '<br>+ '.$locales->$itemName;
346
-                            } elseif (isset($obj->info)) {
347
-                                $infoName = 'INFO_'.$obj->info;
348
-                                echo '<br>('.$locales->$infoName.')';
349
-                            } else {
350
-                                echo '<br> </br>';
351
-                            } ?>
337
+									if (isset($obj->candies)) {
338
+										echo $obj->candies.' '.$locales->POKEMON_CANDIES;
339
+									} else {
340
+										echo '? '.$locales->POKEMON_CANDIES;
341
+									}
342
+
343
+							if (isset($obj->item)) {
344
+								$itemName = 'ITEM_'.$obj->item;
345
+								echo '<br>+ '.$locales->$itemName;
346
+							} elseif (isset($obj->info)) {
347
+								$infoName = 'INFO_'.$obj->info;
348
+								echo '<br>('.$locales->$infoName.')';
349
+							} else {
350
+								echo '<br> </br>';
351
+							} ?>
352 352
 								</p>
353 353
 							</div>
354 354
                             <?php
355
-                        }
356
-                    } ?>
355
+						}
356
+					} ?>
357 357
                 </div>
358 358
             <?php
359
-            } elseif ($skip) {
360
-                $skip = false;
361
-            } else {
362
-                $skip = true;
363
-            }
364
-        }
365
-        ?>
359
+			} elseif ($skip) {
360
+				$skip = false;
361
+			} else {
362
+				$skip = true;
363
+			}
364
+		}
365
+		?>
366 366
 	</div>
367 367
 </div>
368 368
 
@@ -377,8 +377,8 @@  discard block
 block discarded – undo
377 377
 
378 378
 		<?php
379 379
 
380
-        foreach ($related as $related_mon) {
381
-            ?>
380
+		foreach ($related as $related_mon) {
381
+			?>
382 382
 
383 383
 			<div class="col-md-1 col-sm-2 col-xs-3 pokemon-single">
384 384
 
@@ -390,9 +390,9 @@  discard block
 block discarded – undo
390 390
 
391 391
 
392 392
 			<?php
393
-        }
393
+		}
394 394
 
395
-        ?>
395
+		?>
396 396
 
397 397
 		</div>
398 398
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
 
403 403
 
404 404
 <?php if (!empty($top)) {
405
-            ?>
405
+			?>
406 406
 	<div class="row area" id="top50">
407 407
 		<div class="col-md-12">
408 408
 			<h2 class="text-center sub-title">Top 50 <strong><?= $pokemon->name; ?></strong></h2>
@@ -420,20 +420,20 @@  discard block
 block discarded – undo
420 420
 							<th><a href="pokemon/<?= $pokemon->id; ?>?order=move_2<?php echo 'move_2' == $top_order && !isset($_GET['direction']) ? '&direction=desc' : ''; ?>#top50">2. <?= $locales->MOVE; ?> <i class="fa fa-sort" aria-hidden="true"></i></a></th>
421 421
 							<th><a href="pokemon/<?= $pokemon->id; ?>?order=disappear_time<?php echo 'disappear_time' == $top_order && !isset($_GET['direction']) ? '&direction=desc' : ''; ?>#top50"><?= $locales->DATE; ?> <i class="fa fa-sort" aria-hidden="true"></i></a></th>
422 422
 							<?php if (201 == $pokemon->id) {
423
-                ?>
423
+				?>
424 424
 								<th>Form</th>
425 425
 							<?php
426
-            } ?>
426
+			} ?>
427 427
 						</tr>
428 428
 					</thead>
429 429
 				
430 430
 					<tbody>
431 431
 						<?php
432
-                        $i = 0;
433
-            foreach ($top as $top50) {
434
-                ++$i;
435
-                $move1 = $top50->move_1;
436
-                $move2 = $top50->move_2; ?>
432
+						$i = 0;
433
+			foreach ($top as $top50) {
434
+				++$i;
435
+				$move1 = $top50->move_1;
436
+				$move2 = $top50->move_2; ?>
437 437
 
438 438
 							<tr>
439 439
 								<td><?= $i; ?></td>
@@ -447,17 +447,17 @@  discard block
 block discarded – undo
447 447
 								<td><a href="https://maps.google.com/?q=<?= $top50->latitude; ?>,<?= $top50->longitude; ?>&ll=<?= $top50->latitude; ?>,<?= $top50->longitude; ?>&z=16"
448 448
 									target="_blank"><?=$top50->distime; ?></a></td>
449 449
 								<?php if (201 == $pokemon->id && $top50->form) {
450
-                    ?>
450
+					?>
451 451
 									<td><?php echo $form_array[$top50->form]; ?></td>
452 452
 								<?php
453
-                } else {
454
-                    ?>
453
+				} else {
454
+					?>
455 455
 									<td></td>
456 456
 								<?php
457
-                } ?>
457
+				} ?>
458 458
 							</tr>
459 459
 							<?php
460
-            } ?>
460
+			} ?>
461 461
 				</tbody>
462 462
 			</table>
463 463
 		</div>
@@ -465,8 +465,8 @@  discard block
 block discarded – undo
465 465
 </div>
466 466
 
467 467
 <?php
468
-        } if ($toptrainer) {
469
-            ?>
468
+		} if ($toptrainer) {
469
+			?>
470 470
 	<div class="row" id="trainer">
471 471
 		<div class="col-md-12">
472 472
 			<h2 class="text-center sub-title"><?= $locales->POKEMON_TOPTRAINER; ?> <strong><?= $pokemon->name; ?></strong></h2>
@@ -485,11 +485,11 @@  discard block
 block discarded – undo
485 485
 					</thead>
486 486
 					<tbody>
487 487
 						<?php
488
-                        $i = 0;
489
-            foreach ($toptrainer as $besttrainer) {
490
-                ++$i;
491
-                $move1 = $besttrainer->move_1;
492
-                $move2 = $besttrainer->move_2; ?>
488
+						$i = 0;
489
+			foreach ($toptrainer as $besttrainer) {
490
+				++$i;
491
+				$move1 = $besttrainer->move_1;
492
+				$move2 = $besttrainer->move_2; ?>
493 493
 
494 494
 							<tr>
495 495
 								<td><?= $i; ?></td>
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
 								<td><?=$besttrainer->lasttime; ?></td>
502 502
 							</tr>
503 503
 							<?php
504
-            } ?>
504
+			} ?>
505 505
 				</tbody>
506 506
 			</table>
507 507
 		</div>
508 508
 	</div>
509 509
 </div>
510 510
 <?php
511
-        } ?>
511
+		} ?>
Please login to merge, or discard this patch.