Last active
October 18, 2016 00:59
-
-
Save bwente/a5ba17b880cc6f77d67c to your computer and use it in GitHub Desktop.
Show chunk inline at a scheduled 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 | |
// [[!showMe? &start=`` &stop=`` &display=`featuresChunk` &default=`emptyChunk`]] | |
$start = strtotime($modx->getOption('start',$scriptProperties,time())); | |
$stop = strtotime($modx->getOption('stop',$scriptProperties,time())); | |
$display = $modx->getOption('display',$scriptProperties,''); | |
$default = $modx->getOption('default',$scriptProperties,''); | |
$rightNow = time(); | |
if($rightNow > $start && $rightNow < $stop){ | |
$output = $modx->getChunk($display); | |
} else { | |
$output = $modx->getChunk($default); | |
} | |
return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment