/rave_cap_alert.php Secret
Last active
September 2, 2019 18:34
Star
You must be signed in to star a gist
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