This repository has been archived by the owner on May 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathviewpage.php
72 lines (63 loc) · 2.89 KB
/
viewpage.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
<?php
/*---------------------------------------------------------------------+
| ExiteCMS Content Management System |
+----------------------------------------------------------------------+
| Copyright 2006-2008 Exite BV, The Netherlands |
| for support, please visit http://www.exitecms.org |
+----------------------------------------------------------------------+
| Some code derived from PHP-Fusion, copyright 2002 - 2006 Nick Jones |
+----------------------------------------------------------------------+
| Released under the terms & conditions of v2 of the GNU General Public|
| License. For details refer to the included gpl.txt file or visit |
| http://gnu.org |
+----------------------------------------------------------------------+
| $Id:: $|
+----------------------------------------------------------------------+
| Last modified by $Author:: $|
| Revision number $Rev:: $|
+---------------------------------------------------------------------*/
require_once dirname(__FILE__)."/includes/core_functions.php";
require_once PATH_ROOT."/includes/theme_functions.php";
// load the locale for this module
locale_load("main.custom_pages");
// temp storage for template variables
$variables = array();
// parameter validation
if (!isset($page_id) || !isNum($page_id)) fallback("index.php");
// check if the requested page exists
$result = dbquery("SELECT * FROM ".$db_prefix."custom_pages WHERE page_id='$page_id'");
if (dbrows($result) != 0) {
$data = dbarray($result);
$title = $data['page_title'];
if (checkgroup($data['page_access'])) {
$custompage = stripslashes($data['page_content']);
$content = true;
} else {
$custompage = $locale['400'];
$content = false;
}
} else {
$title = $locale['401'];
$custompage = $locale['402'];
$content = false;
}
$variables['content'] = $content;
$variables['custompage'] = $custompage;
// define the search body panel variables
$template_panels[] = array('type' => 'body', 'name' => 'viewpage', 'title' => $title, 'template' => 'main.viewpage.tpl', 'locale' => "main.custom_pages");
$template_variables['viewpage'] = $variables;
if (dbrows($result) && checkgroup($data['page_access'])) {
// check if we need to display comments
if ($data['page_allow_comments']) {
include PATH_INCLUDES."comments_include.php";
showcomments("C","custom_pages","page_id",$page_id,FUSION_SELF."?page_id=$page_id");
}
// check if we need to display ratings
if ($data['page_allow_ratings']) {
include PATH_INCLUDES."ratings_include.php";
showratings("C",$page_id,FUSION_SELF."?page_id=$page_id");
}
}
// Call the theme code to generate the output for this webpage
require_once PATH_THEME."/theme.php";
?>