added a way to add custom header and footer (#1)
* added a way to add custom header and footer * rework to be backwords compatible for people who dont update their config file * isset to make sure no warnings are shown
This commit is contained in:
parent
ea8176c6e2
commit
81f1bb7a20
@ -29,6 +29,11 @@ const LG_CUSTOM_HTML = __DIR__.'/custom.html.php';
|
|||||||
// Define a file here which will be loaded on top of the index file, this can be used to do some post logic;
|
// Define a file here which will be loaded on top of the index file, this can be used to do some post logic;
|
||||||
const LG_CUSTOM_PHP = __DIR__.'/custom.post.php';
|
const LG_CUSTOM_PHP = __DIR__.'/custom.post.php';
|
||||||
|
|
||||||
|
// Define a file here which will be used to display the custom header. Will be at the top of file;
|
||||||
|
const LG_CUSTOM_HEADER_PHP = __DIR__.'/custom.header.php';
|
||||||
|
// Define a file here which will be used to display the custom footer. Will be at the bottom of file;
|
||||||
|
const LG_CUSTOM_FOOTER_PHP = __DIR__.'/custom.footer.php';
|
||||||
|
|
||||||
// Define the location of this network, usually a city and a country;
|
// Define the location of this network, usually a city and a country;
|
||||||
const LG_LOCATION = 'Amsterdam, Netherlands';
|
const LG_LOCATION = 'Amsterdam, Netherlands';
|
||||||
// Define a query location for the link to openstreetmap (eg: Amsterdam, Netherlands will be https://www.openstreetmap.org/search?query=Amsterdam, Netherlands)
|
// Define a query location for the link to openstreetmap (eg: Amsterdam, Netherlands will be https://www.openstreetmap.org/search?query=Amsterdam, Netherlands)
|
||||||
|
16
index.php
16
index.php
@ -75,6 +75,18 @@ if (LG_BLOCK_CUSTOM) {
|
|||||||
ob_start();
|
ob_start();
|
||||||
include LG_CUSTOM_HTML;
|
include LG_CUSTOM_HTML;
|
||||||
$templateData['custom_html'] = ob_get_clean();
|
$templateData['custom_html'] = ob_get_clean();
|
||||||
|
|
||||||
|
if (defined('LG_CUSTOM_HEADER_PHP')) {
|
||||||
|
ob_start();
|
||||||
|
include LG_CUSTOM_HEADER_PHP;
|
||||||
|
$templateData['custom_header'] = ob_get_clean();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (defined('LG_CUSTOM_FOOTER_PHP')) {
|
||||||
|
ob_start();
|
||||||
|
include LG_CUSTOM_FOOTER_PHP;
|
||||||
|
$templateData['custom_footer'] = ob_get_clean();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LG_CHECK_LATENCY && filter_var(LookingGlass::detectIpAddress(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
|
if (LG_CHECK_LATENCY && filter_var(LookingGlass::detectIpAddress(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
|
||||||
@ -97,6 +109,8 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<?php echo isset($templateData['custom_header']) ? $templateData['custom_header'] : '' ?>
|
||||||
|
|
||||||
<div class="col-lg-6 mx-auto p-3 py-md-5">
|
<div class="col-lg-6 mx-auto p-3 py-md-5">
|
||||||
|
|
||||||
<header class="d-flex align-items-center pb-3 mb-5 border-bottom">
|
<header class="d-flex align-items-center pb-3 mb-5 border-bottom">
|
||||||
@ -274,6 +288,8 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
|
|||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php echo isset($templateData['custom_footer']) ? $templateData['custom_footer'] : '' ?>
|
||||||
|
|
||||||
<?php if ($templateData['session_call_backend']): ?>
|
<?php if ($templateData['session_call_backend']): ?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function () {
|
(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user