-
-
Save dailyinvention/b3120c6b4d6f632667cf2fc5961ae1dc to your computer and use it in GitHub Desktop.
Function For Displaying Messages from RAVE CAP Feed
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
/** ALERT MESSAGES ON HOME PAGE */ | |
function cap_parse($url){ | |
$xml = simplexml_load_file($url); | |
$event = $xml->info->event; | |
$description=$xml->info->description; | |
$effective=strtotime($xml->info->effective); | |
$expires=strtotime($xml->info->expires); | |
$time = time(); | |
if (($time > $effective) && ($time < $expires)) { | |
print("<div class=\"alert\"><h2>".$event."</h2><h4><strong>".$description."</strong></h4></div>"); | |
} | |
} | |
cap_parse("https://www.getrave.com/cap/<account>/channel1"); | |
cap_parse("https://www.getrave.com/cap/<account>/channel4"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment