-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
62 lines (57 loc) · 2.4 KB
/
index.php
File metadata and controls
62 lines (57 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php get_header(); the_post();?>
<main class="row page-content" aria-label="Main content">
<div class="span8">
<?php
$alerts = get_posts(array(
'post_type' => 'alert',
'numberposts' => -1,
'orderby' => 'post_date',
'order' => 'desc')
);
if(!empty($alerts)) {
$theme_options = get_option(THEME_OPTIONS_NAME);
foreach ($alerts as $alert) {
$published = strtotime($alert->post_date);
$modified = strtotime($alert->post_modified);
$modified_est = new DateTime(null, new DateTimeZone('America/New_York'));
$modified_est = $modified_est->setTimestamp($modified);
$alert_type = get_post_meta($alert->ID, 'alert_alert_type', True) ? get_post_meta($alert->ID, 'alert_alert_type', True) : 'general';
$short = get_post_meta($alert->ID, 'alert_short', True);
echo sprintf('<h2 class="page-header %s">%s<br /><small>%s</small></h2>', $alert_type, esc_html($alert->post_title), date('F j, Y', $published));
if($alert->post_content != '') {
echo sprintf('<div class="alert-content">%s</div>', str_replace(']]>', ']]>', apply_filters('the_content', $alert->post_content)));
} else if($short != '') {
echo sprintf('<div class="alert-content">%s</div>', $short);
} else {
echo '<p class="lead">There is no additional information available at this time.</p>';
}
echo sprintf('<p class="muted">This information was last updated on <strong>%s at %s EST</strong></p>', date('F j, Y', $modified), $modified_est->format('g:i A'));
}
}
else {
echo '<p class="well lead">There are currently no active alerts.</p>';
}
?>
</div>
<div class="span3 offset1" id="sidebar">
<div class="about">
<h3>About this Page</h3>
<p>
This page is the official source of alert information for the University of Central Florida. In the event of an emergency, check this page for updated information. This page is updated and maintained by UCF Communications.
</p>
</div>
<hr />
<div class="contact">
<?php
$contacts = get_posts(array(
'post_type' => 'contact_information',
'numberposts' => -1));
foreach($contacts as $contact) {
$value = get_post_meta($contact->ID, 'contact_information_value', True);
echo sprintf('<h3>%s</h3><p>%s</p>', apply_filters('the_title', $contact->post_title), $value);
}
?>
</div>
</div>
</main>
<?php get_footer(); ?>