forked from Rezgo/rezgo-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframe.php
112 lines (83 loc) · 3.86 KB
/
frame.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
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
<?php
// any new page must start with the page_header, it will include the correct files
// so that the rezgo parser classes and functions will be available to your templates
require('rezgo/include/page_header.php');
// start a new instance of RezgoSite
$site = new RezgoSite($_REQUEST['sec'], 1);
// remove the 'mode=page_type' from the query string we want to pass on
$_SERVER['QUERY_STRING'] = preg_replace("/([&|?])?mode=([a-zA-Z_]+)/", "", $_SERVER['QUERY_STRING']);
// set a default page title
$site->setPageTitle((($_REQUEST['title']) ? $_REQUEST['title'] : ucwords(str_replace("page_", "", $_REQUEST['mode']))));
if($_REQUEST['mode'] == 'page_details') {
/*
this query searches for an item based on a com id (limit 1 since we only want one response)
then adds a $f (filter) option by uid in case there is an option id, and adds a date in case there is a date set
*/
$item = $site->getTours('t=com&q='.$_REQUEST['com'].'&f[uid]='.$_REQUEST['option'].'&d='.$_REQUEST['date'].'&limit=1', 0);
// if the item does not exist, we want to generate an error message and change the page accordingly
if(!$item) {
$item = new stdClass();
$item->unavailable = 1;
$item->name = 'Item Not Available';
}
if ($item->seo->seo_title != '') {
$page_title = $item->seo->seo_title;
} else {
$page_title = $item->item;
}
if ($item->seo->introduction != '') {
$page_description = $item->seo->introduction;
} else {
$page_description = strip_tags($item->details->overview);
}
$site->setPageTitle($page_title);
$site->setMetaTags('
<meta name="description" content="' . $page_description . '" />
<meta property="og:url" content="http://' . $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] . '" />
<meta property="og:title" content="' . $page_title . '" />
<meta property="og:description" content="' . $page_description . '" />
<meta property="og:image" content="' . $item->media->image[0]->path . '" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
');
} elseif($_REQUEST['mode'] == 'page_content') {
$title = $site->getPageName($page);
$site->setPageTitle($title);
} elseif($_REQUEST['mode'] == 'index') {
// expand to include keywords and dates
$site->setPageTitle((($_REQUEST['tags']) ? ucwords($_REQUEST['tags']) : 'Home'));
}
?>
<?=$site->getTemplate('header')?>
<script type="text/javascript">
// for iFrameResize native version
// MDN PolyFil for IE8
if (!Array.prototype.forEach){
Array.prototype.forEach = function(fun /*, thisArg */){
"use strict";
if (this === void 0 || this === null || typeof fun !== "function") throw new TypeError();
var
t = Object(this),
len = t.length >>> 0,
thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++)
if (i in t)
fun.call(thisArg, t[i], i, t);
};
}
</script>
<div id="rezgo_content_container" style="width:100%;">
<iframe id="rezgo_content_frame" src="<?=$site->base?>/<?=$_REQUEST['mode']?>?<?=$_SERVER['QUERY_STRING']?>" style="width:100%; height:900px; padding:0px; margin:0px;" frameBorder="0" scrolling="no"></iframe>
</div>
<script type="text/javascript" src="<?=$site->base?>/js/iframeResizer.min.js"></script>
<script type="text/javascript">
iFrameResize ({
enablePublicMethods: true,
scrolling: true
});
</script>
<?=$site->getTemplate('footer')?>
<!-- Start Alexa Certify Javascript -->
<script type="text/javascript" src="https://d31qbv1cthcecs.cloudfront.net/atrk.js"></script>
<script type="text/javascript">_atrk_opts = { atrk_acct: "51dve1aoim00G5", domain:"rezgo.com"}; atrk();</script>
<noscript><img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=51dve1aoim00G5" style="display:none" height="1" width="1" alt="" /></noscript>
<!-- End Alexa Certify Javascript -->