-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatic.php
More file actions
40 lines (32 loc) · 871 Bytes
/
static.php
File metadata and controls
40 lines (32 loc) · 871 Bytes
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
<?php
/**
* static
*
* @package Sngine
* @author Zamblek
*/
// fetch bootstrap
require('bootstrap.php');
// valid inputs
if(!isset($_GET['url'])) {
_error(404);
}
try {
// get static page
$get_static = $db->query(sprintf("SELECT * FROM static_pages WHERE page_url = %s", secure($_GET['url']) )) or _error(SQL_ERROR_THROWEN);
if($get_static->num_rows == 0) {
_error(404);
}
$static = $get_static->fetch_assoc();
$static['page_text'] = html_entity_decode($static['page_text'], ENT_QUOTES);
$static['page_text'] = $smarty->fetch('string:'.$static['page_text']);
/* assign variables */
$smarty->assign('static', $static);
} catch (Exception $e) {
_error(__("Error"), $e->getMessage());
}
// page header
page_header($system['system_title'].' - '.$static['page_title']);
// page footer
page_footer("static");
?>