1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 04:30:29 +01:00

Merge pull request #6163 from marc1706/ticket/16730

[ticket/16730] Don't do additional sorting or output without any tickets
This commit is contained in:
Marc Alexander 2021-03-24 21:31:22 +01:00
commit 7d48254cc9
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995

View File

@ -38,6 +38,7 @@ else
$xml = simplexml_load_string(file_get_contents($url));
}
$types = [];
foreach ($xml->xpath('//item') as $item)
{
$key = (string) $item->key;
@ -51,17 +52,20 @@ foreach ($xml->xpath('//item') as $item)
$types[(string) $item->type][$key] = $value;
}
ksort($types);
foreach ($types as $type => $tickets)
if (count($types))
{
echo "<h4>$type</h4>\n";
echo "<ul>\n";
uksort($tickets, 'strnatcasecmp');
foreach ($tickets as $ticket)
ksort($types);
foreach ($types as $type => $tickets)
{
echo "<li>$ticket</li>\n";
echo "<h4>$type</h4>\n";
echo "<ul>\n";
uksort($tickets, 'strnatcasecmp');
foreach ($tickets as $ticket)
{
echo "<li>$ticket</li>\n";
}
echo "</ul>\n";
}
echo "</ul>\n";
}