-
news_or_event == "news" && $post->breaking_news == "y" && $post->published_date <= date("Y-m-d H:i:s")){
if($counter <= 0) {
$introduction = htmlspecialchars_decode($post->introduction);
$urltitle = seoUrl($post->title);
print("
Breaking News
{$post->title}
");
}
$counter++;
}
}
?>
$toDateTime) $toDateTime->modify('+1 day'); return ($fromDateTime <= $inputDateTime&& $inputDateTime<= $toDateTime) || ($fromDateTime <= $inputDateTime->modify('+1 day') && $inputDateTime<= $toDateTime);
}
// Set default chat script
$chatScript = '';
// Get current time
$currentTime = date("H:i");
// Grab path to current script
$currentPath = pathinfo($_SERVER['PHP_SELF'], PATHINFO_DIRNAME)."/";
// For clearing, we only want to grab TAP script if current time is outside 9am-5pm
if($currentPath != "/clearing/" || ($currentPath == "/clearing/" && isTimeBetween("09:00","17:00",$currentTime) === false)) {
try {
// Grab popcard URL-script mappings
$popcards_json = file_get_contents('/efs/www.sunderland.ac.uk/lib/feeds/popcards/popcards.json');
// Convert to array
$popcards_array = json_decode($popcards_json)->{'popcards'};
print("\n\r");
foreach ($popcards_array as $popcard) {
$rowUrl = $popcard->url;
$length = strlen($currentPath);
if (substr($rowUrl, -$length) === $currentPath) {
// Popcard URL matches path to current script
$chatScript = "".$popcard->code;
print("\n\r");
break;
}
}
} catch (Exception $ex) {
// Do nothing
}
}
// Show chat script
print($chatScript);
?>