-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
81 lines (77 loc) · 3.12 KB
/
index.php
File metadata and controls
81 lines (77 loc) · 3.12 KB
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
<?php
$version = '5.2.9';
if (version_compare(phpversion(), '5.4', '<')) {
exit("QRcdr requires at least PHP version 5.4.");
}
// https://stackoverflow.com/questions/11920026/replace-file-get-contents-with-curl
if (!ini_get('allow_url_fopen')) {
exit("Please enable <code>allow_url_fopen<code>");
}
if (!function_exists('mime_content_type')) {
exit("Please enable the <code>fileinfo</code> extension");
}
// Update this path if you have a custom relative path inside config.php
require dirname(__FILE__)."/lib/functions.php";
if (qrcdr()->getConfig('debug_mode')) {
error_reporting(E_ALL);
ini_set('display_errors', 1);
} else {
error_reporting(E_ALL ^ E_NOTICE);
}
$relative = qrcdr()->relativePath();
require dirname(__FILE__).'/'.$relative.'include/head.php';
?>
<!doctype html>
<html lang="<?php echo $lang; ?>" dir="<?php echo $rtl['dir']; ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<title><?php echo qrcdr()->getString('title'); ?></title>
<meta name="description" content="<?php echo qrcdr()->getString('description'); ?>">
<meta name="keywords" content="<?php echo qrcdr()->getString('tags'); ?>">
<link rel="shortcut icon" href="<?php echo $relative; ?>images/favicon.ico">
<link href="<?php echo $relative; ?>bootstrap/<?php echo $rtl['css']; ?>/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo $relative; ?>css/font-awesome.min.css" rel="stylesheet">
<script src="<?php echo $relative; ?>js/jquery-3.5.1.min.js"></script>
<?php
$custom_page = false;
$body_class = '';
if (isset($_GET['p'])) {
$load_page = dirname(__FILE__).'/'.$relative.'template/'.$_GET['p'].'.html';
if (file_exists($load_page)) {
$custom_page = file_get_contents($load_page);
}
}
qrcdr()->loadQRcdrCSS($version);
if (!$custom_page) {
$body_class = 'qrcdr';
qrcdr()->loadPluginsCss();
}
qrcdr()->setMainColor(qrcdr()->getConfig('color_primary'));
?>
</head>
<body class="<?php echo $body_class; ?>">
<?php
if (file_exists(dirname(__FILE__).'/'.$relative.'template/navbar.php')) {
include dirname(__FILE__).'/'.$relative.'template/navbar.php';
}
if (file_exists(dirname(__FILE__).'/'.$relative.'template/header.php')) {
include dirname(__FILE__).'/'.$relative.'template/header.php';
}
if ($custom_page) {
echo '<div class="container mt-4">'.$custom_page.'</div>';
} else {
// Generator
include dirname(__FILE__).'/'.$relative.'include/generator.php';
}
if (file_exists(dirname(__FILE__).'/'.$relative.'template/footer.php')) {
include dirname(__FILE__).'/'.$relative.'template/footer.php';
}
qrcdr()->loadQRcdrJS($version);
if (!$custom_page) {
qrcdr()->loadPlugins();
}
?>
</body>
</html>