Browse Source

Moved creation of new <ul>

chapter_donations
parent
commit
2b1509af2b
No known key found for this signature in database GPG Key ID: 630A04EE35E56530
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      resolutions/index.php

+ 7
- 1
resolutions/index.php View File

@ -78,11 +78,13 @@ $resolutions = json_decode(file_get_contents("resolutions.json"), true);
// Define placeholder variable for month separation
$currentYear = NULL;
$currentMonth = NULL;
$dateChanged = FALSE;
// Render them onto the page
foreach ($resolutions as $object) {
$objectDate = explode("/", $object["date"]);
// Create a new <ul> tag if the date has changed since the last entry
if ($currentYear != $objectDate[0] || $currentMonth != $objectDate[1]) {
$dateChanged = TRUE;
echo "</ul>";
}
// Print year header if year has changed
@ -95,7 +97,11 @@ foreach ($resolutions as $object) {
$currentMonth = $objectDate[1];
// Turn month number into human readable month name
$monthName = date("F", mktime(0, 0, 0, $currentMonth, 10));
echo "<h4>$monthName</h4><ul class=\"resolutions\">";
echo "<h4>$monthName</h4>";
}
if ($dateChanged) {
echo "<ul class=\"resolutions\">";
$dateChanged = FALSE;
}
// Create resolution object
$resolutionUrl = $CDNPATH . $object["date"] . "/" . $object["file"];


Loading…
Cancel
Save