-
Notifications
You must be signed in to change notification settings - Fork 0
/
static_page.php
84 lines (73 loc) · 2.66 KB
/
static_page.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
<?php
/***************************************************************************
*
* File : static_page.php
* Software : Kwikcontent
* Version : 1.1
* Release Date : August 29, 2009
* Copyright : (C) 2009 Samson Software
* Contact : http://www.kwikcontent.com/
* License : Limited to one owner. My not be reproduced or
* redistributed under any circumstance.
*
***************************************************************************/
//Request needed includes
include_once('includes/_global.php');
include_once('includes/public_config.php');
include_once('includes/static_page.php');
//$smarty->debugging = true;
$sp = new StaticPage($p);
$sp->loadVars();
if (!($sp->sp_id > 0)) {
$url = BASE_FOLDER;
header("Location: $url");
die();
}
//find all child pages
$sp_children = $sp->getChildren();
if (count($sp_children) > 0) {
foreach ($sp_children as $id => $details) {
$spc = new StaticPage($id);
$spc->setVars($details);
$sp_children[$id]['sp_url'] = $spc->getLocation();
}
}
$smarty->assign("sp_children", $sp_children);
//check to see if this is a rss feed page
if (trim($sp->sp_rss_url) != '') {
define("MAGPIE_DIR", "includes/magpierss/");
include_once('includes/magpierss/rss_fetch.inc');
$sp->rss = fetch_rss(html_entity_decode($sp->sp_rss_url));
}
//format the sp object
$sp->sp_html = html_entity_decode($sp->sp_html);
$smarty->assign_by_ref("sp", $sp);
//create breadcrumb
$breadcrumb = '<a href="'.BASE_URL.'">Home</a> > ';
$current_parent = $sp->parent_sp_id;
while ($current_parent != '0') {
$spp = new StaticPage($current_parent);
$spp->loadVars();
$current_parent = $spp->parent_sp_id;
$breadcrumb_parents[$spp->sp_id]['url'] = $spp->getLocation();
$breadcrumb_parents[$spp->sp_id]['nav_title'] = $spp->sp_nav_title;
}
if (count($breadcrumb_parents) > 0) {
$breadcrumb_parents = array_reverse($breadcrumb_parents);
foreach ($breadcrumb_parents as $id => $spp) {
$breadcrumb .= '<a href="'.$spp['url'].'">'.$spp['nav_title'].'</a> > ';
}
}
$breadcrumb .= $sp->sp_nav_title;
$smarty->assign("BREADCRUMB", $breadcrumb);
//establish vars for template
$smarty->assign('WINDOW_TITLE', ($domain->domain_window_titles ? $domain->domain_title.$domain->delimiters['window_title'] : '').$sp->sp_win_title);
$smarty->assign('META_DESCRIPTION', $sp->sp_meta_desc);
$smarty->assign('META_KEYS', $sp->sp_meta_keys);
//load a header file for any preprocessing
include_once('includes/public_header.php');
//output page
$smarty->display('static_page.htm');
//load a footer file for any postprocessing
include_once('includes/public_footer.php');
?>