This repository has been archived by the owner on Sep 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resort.php
69 lines (59 loc) · 1.25 KB
/
resort.php
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
<?
require_once('lib/init.php');
require_once('lib/template.php');
require_once('contrib/tropo/tropo.class.php');
require_once('contrib/simplepie/simplepie.inc');
require_once('lib/simplepie_snowrss.php');
if ( isset($_REQUEST['f']) ) {
if ( $_REQUEST['f'] == 'voice' ) {
# tropo
$format = 'voice';
}
elseif ( $_REQUEST['f'] == 'html' ) {
# html
$format = 'html';
}
else {
# html
$format = 'html';
}
}
else {
# html
$format = 'html';
}
if ( isset($_REQUEST['resort']) ) {
$code = $_REQUEST['resort'];
if ( isset($resorts[$code]) ) {
}
else {
die('unknown resort');
}
}
else {
die('Resort code missing');
}
$url = $resorts[$code]['url'];
$feed = new SimplePie_SnowRSS($url, sys_get_temp_dir());
$feed->set_item_class('SimplePie_Item_SnowRSS');
$feed->init();
$feed->handle_content_type();
if ($format == 'html') {
if ( $mobile ) {
$body_tpl = 'templates/resort.php';
$page_tpl = 'templates/mobile/default.php';
}
else {
$body_tpl = 'templates/resort.php';
$page_tpl = 'templates/default.php';
}
$Body = new Template($body_tpl);
$Body->set('feed', $feed);
$T = new Template($page_tpl);
$T->set('title', 'SnowLine');
$T->set('tagline', 'A SnowRSS Aggregator');
$T->set('body', $Body);
echo($T->fetch());
exit;
}
?>