Function For Displaying Messages from RAVE CAP Feed
/** 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