-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpreview.php
96 lines (77 loc) · 2.89 KB
/
preview.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
<?php
/*
* Version: 1.0, 31.05.2012
* by Adam Wysocki, goldpaid777@gmail.com
*
* Copyright (c) 2012 Adam Wysocki
*
* This is simple Preview -> PHP connector
*
*/
// Report simple running errors except notices
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ob_start("ob_gzhandler");
$home=true;
# SESSION -----------------
session_start();
if($_GET['route']=='logout'){
session_unset();
session_destroy();
}
# CONFIG -----------------
require_once('../once/config.php');
# ROUTES -------------------
require_once('../routes/routes.'.$_SESSION['user_lang'].'.php');
# LANGS -------------------
require_once('../langs/langs.'.$_SESSION['user_lang'].'.php');
# CLASS -------------------
require_once('../once/class/core.class.php');
$once=new core($_CONFIG);
if($_GET['path']!='layers' && $_GET['path']!='pages') exit;
// Is it required??
if(!preg_match("/^[a-zA-Z0-9_.]+$/i",$_GET['file'])) exit;
# PAGE START -------------------
echo '
<!DOCTYPE html>
<html>
<head>
';
# PAGE HEADER -------------------
echo '
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified font awesome -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<!-- Latest compiled and minified global styles from layers -->
<link rel="stylesheet" href="./css/global.css" type="text/css">
<!-- Latest compiled and minified styles from layers -->
<link rel="stylesheet" href="./css/style.css" type="text/css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div id="body">';
# PAGE GRIDS -------------------
require_once('../'.$_GET['path'].'/'.$_GET['file']);
echo '
</div>
<!-- Latest compiled and minified jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<!-- Latest compiled and minified modernizr -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<!-- Latest compiled and minified script of all layers -->
<script type="text/javascript" src="/js/script.js"></script>
<!-- Latest compiled and minified once -->
<script type="text/javascript" src="/js/once.js"></script>
</body>
</html>';
ob_end_flush();
?>