Sort halls by ID

This commit is contained in:
Vencislav Atanasov 2024-10-31 21:24:28 +02:00
parent 20701350ba
commit 9fc93ec924
1 changed files with 6 additions and 3 deletions

View File

@ -27,6 +27,9 @@ function parseData($config, $data) {
if ($data === false) return false; if ($data === false) return false;
$halls = $data['halls'];
ksort($halls);
// We need to set these so we actually parse properly the dates. WP fucks up both. // We need to set these so we actually parse properly the dates. WP fucks up both.
date_default_timezone_set('Europe/Sofia'); date_default_timezone_set('Europe/Sofia');
setlocale(LC_TIME, $languages[$config['lang']]['locale']); setlocale(LC_TIME, $languages[$config['lang']]['locale']);
@ -46,7 +49,7 @@ function parseData($config, $data) {
$config['eventTypes'][$config['filterEventType']] : $config['eventTypes'][$config['filterEventType']] :
null; null;
foreach ($data['halls'] as $hall_id => $hall) { foreach ($halls as $hall_id => $hall) {
$slots[$hall_id] = []; $slots[$hall_id] = [];
foreach ($data['slots'] as $slot_id => $slot) { foreach ($data['slots'] as $slot_id => $slot) {
@ -99,7 +102,7 @@ function parseData($config, $data) {
// Fill in the event ID for each time slot in each hall // Fill in the event ID for each time slot in each hall
$events = []; $events = [];
foreach ($data['halls'] as $hall_id => $hall) { foreach ($halls as $hall_id => $hall) {
$hall_data = []; $hall_data = [];
foreach ($microslots as $timestamps) { foreach ($microslots as $timestamps) {
@ -358,7 +361,7 @@ function parseData($config, $data) {
$schedule = '<table cellpadding="0" cellspacing="0" style="text-align: center;" class="schedule"><thead><tr><th></th>'; $schedule = '<table cellpadding="0" cellspacing="0" style="text-align: center;" class="schedule"><thead><tr><th></th>';
foreach ($data['halls'] as $hall_id => $hall) { foreach ($halls as $hall_id => $hall) {
if (!in_array($hall_id, $hall_ids)) { if (!in_array($hall_id, $hall_ids)) {
continue; continue;
} }