Last active
August 25, 2016 06:30
-
-
Save hissy/9616508 to your computer and use it in GitHub Desktop.
#concrete5 #PageList How to display an icon with the page published date while specific time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php foreach ($pages as $page): | |
// Prepare data for each page being listed... | |
$pubTime = strtotime($page->getCollectionDatePublic()); | |
// 60 seconds, 60 minutes, 24 hours, 3 days | |
$new = ((time() - $pubTime) < (60 * 60 * 24 * 3)) ? '<p class="new">New</p>' : ''; | |
/* The HTML from here through "endforeach" is repeated for every item in the list... */ ?> | |
<?php echo $new?> | |
<?php endforeach; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment