-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.php
More file actions
136 lines (112 loc) · 4.43 KB
/
Copy pathevents.php
File metadata and controls
136 lines (112 loc) · 4.43 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="mstpete.css" rel="stylesheet" type="text/css" />
<link href="http://www.stpete.org/scripts/css/jquery.mobile.structure-1.0.min.css" rel="stylesheet" type="text/css" />
<script src="js/jquery.min.js"></script>
<script src="js/jquery.mobile-1.1.0.min.js"></script>
<script src="https://www.google.com/jsapi?key=ABQIAAAA3HxOQOL8rcl8b5IEkcw6FxSNyhnIJUuFeZdyc1CS7kFoPfuIoBTBalePKIZjxQYelAngbvvnNE7qPw" type="text/javascript"></script>
<script>
$(document).ready(function() {
// disable ajax nav
$.mobile.ajaxLinksEnabled = false;
});
</script>
<style type="text/css">
body .ui-li .ui-li-desc .ui-li-heading {
white-space: normal;
}
body .ui-footer .ui-title {
white-space: normal;
}
</style>
<title>Mobile St Pete</title>
<?php
// If "siteName" isn't in the querystring, set the default site name to 'nettuts'
$siteName = 'StPeteEvents';
$cache = dirname(__FILE__) . "/cache/$siteName";
// Re-cache every three hours
if(filemtime($cache) < (time() - 900))
{
// Get from server
if ( !file_exists(dirname(__FILE__) . '/cache') ) {
mkdir(dirname(__FILE__) . '/cache', 0777);
}
// YQL query (SELECT * from feed ... ) // Split for readability
$path = "http://query.yahooapis.com/v1/public/yql?q=";
$path .= urlencode('SELECT * FROM feed WHERE url="http://www.stpete.org/rss_events.xml"');
$path .= "&format=json";
// Call YQL, and if the query didn't fail, cache the returned data
$feed = file_get_contents($path, true);
// If something was returned, cache
if ( is_object($feed) && $feed->query->count ) {
$cachefile = fopen($cache, 'wb');
fwrite($cachefile, $feed);
fclose($cachefile);
}
}
else
{
// We already have local cache. Use that instead.
$feed = file_get_contents($cache);
}
// Decode that shizzle
$feed = json_decode($feed);
//Reverse feed
//$rev_feed = $feed;
//$rev_feed['item'] = array_reverse($rev_feed['item']);
?>
</head>
<body>
<!--Banner with Logo-->
<div id="header" data-role="header" data-theme="b">
<table id="banner">
<tr>
<td id="logo"><a href="http://www.stpete.org/mobile/"><img src="http://www.stpete.org/images/logo.png" alt="pelican" /></a></td>
<td id="palm"><img class="palm" src="http://www.stpete.org/images/palm.png" alt="palmtree" /></td>
</tr>
</table>
<div id="crumbs"><a href="http://www.stpete.org/mobile/" data-ajax="false" data-role="button" data-icon="home" data-theme="d">Home</a><!-- | The Vinoy Park Hotel--></div>
<div data-role="navbar">
<ul>
<li><a href="index.asp" data-direction="reverse">Home</a></li>
<li><a href="events.php" class="ui-btn-active">Events</a></li>
<li><a href="news.php">News</a></li>
<li><a href="contact.html" data-prefetch>Contact</a></li>
</ul>
</div><!-- /navbar -->
</div><!--/header-->
<div data-role="content">
<h2>Upcomming Events</h2><br/>
<div id="content">
<ul data-role="listview" data-theme="c" data-dividertheme="d" data-counttheme="e">
<?php foreach($feed->query->results->item as $item) { ?>
<li>
<h2><?php echo $item->title; ?></h2>
<p><?php echo $item->description; ?></p>
</li>
<?php } ?>
</ul>
<!--?php var_dump($feed); print_r($rev_feed); ?>-->
<!--<script>$("#eventsfeed").first().data("role") == "listview";</script> -->
</div><!-- END content div -->
<br />
</div><!-- end data role content -->
<!--Footer With Main Links-->
<div id="footer" data-role="footer" data-theme="d">
<div data-role="navbar">
<ul>
<li><a href="index.asp" data-prefetch>Home</a></li>
<li><a href="events.php">Events</a></li>
<li><a href="news.php">News</a></li>
<li><a href="contact.html" data-prefetch>Contact</a></li>
<li><a href="http://www.stpete.org/">Full Site</a></li>
</ul>
<p id="copyright">Copyright 2012, All Rights Reserved</p>
</div><!-- /navbar -->
</div>
<script type="text/javascript">$('[data-role=page]').live('pageshow',function(event,ui){try{_gaq.push(['_setAccount','UA-8738346-1']);hash=location.hash;if(hash){_gaq.push(['_trackPageview',hash.substr(1)])}else{_gaq.push(['_trackPageview'])}}catch(err){}});</script>
</body>
</html>