-
Notifications
You must be signed in to change notification settings - Fork 59
/
map.php
58 lines (53 loc) · 1.69 KB
/
map.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
<?php
require_once 'inc/lib.php';
require_once 'inc/Spyc.php';
session_start();
if (empty($_SESSION['user']) || !$user = user_info($_SESSION['user'])) {
// Not logged in, redirect to login page
header('Location: .');
exit('Not Authorized');
}
?><!doctype html>
<html>
<head>
<title>Map | MCHostPanel</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/smooth.css" id="smooth-css">
<link rel="stylesheet" href="css/style.css">
<meta name="author" content="Alan Hardman <[email protected]>">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php require 'inc/top.php'; ?>
<div class="tab-content">
<div class="tab-pane active">
<div class="container-fluid">
<div class="row-fluid">
<?php
if(is_file($user["home"] . "/plugins/dynmap/configuration.txt")) {
$config = spyc_load_file($user["home"] . "/plugins/dynmap/configuration.txt");
$port = $config["webserver-port"];
?>
<iframe id="map" style="width: 100%; height: 600px; border: none;" frameborder="0" src="http://<?php echo $_SERVER['HTTP_HOST']; ?>:<?php echo $port; ?>/"></iframe>
<?php } else { ?>
<p class="alert alert-danger">No dynmap configuration found.</p>
<?php } ?>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
// Fix sizing
$('#map').css('height', $(window).height() - 200 + 'px');
// Keep sizing correct
$(document).resize(function () {
$('#map').css('height', $(window).height() - 200 + 'px');
});
});
</script>
</body>
</html>