-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
75 lines (65 loc) · 1.73 KB
/
index.php
File metadata and controls
75 lines (65 loc) · 1.73 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
<?php
require_once('config.php');
$config = array();
foreach($db->query("SELECT * FROM config") as $row){
$config[$row['prop']] = $row['value'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><?= $config['title'] ?></title>
<link rel="stylesheet" type="text/css" href="media/style.css">
</head>
<body class="wide">
<div id="wrapper">
<div id="navbar">
<div id="branding">
<h1><?= $config['brandingHeader'] ?></h1>
</div>
<div id="nav">
<?php require_once('nav.php') ?>
</div>
</div>
<div id="contentWrapper">
<div id="content">
<?php
if(!isset($_GET['name'])){
$_GET['name'] = "home";
}
require('content.php');
?>
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script type="text/javascript">
var animSpeed = 250;
function load(name){
$.get("content.php?name="+name, function(content){
//$('#content').hide('blind', {direction: 'left'}, animSpeed, function(){
$('#content').html(content);
//$('#content').show('blind', {direction: 'left'}, animSpeed);
//});
});
$('.currentPage').removeClass("currentPage");
$('a[name="'+name+'"]').addClass("currentPage");
}
$(function(){
$(window).resize(function(){
if($(window).width() < 800){
$('body').removeClass("wide");
$('body').addClass("narrow");
} else {
$('body').removeClass("narrow");
$('body').addClass("wide");
}
});
$('a[name="<?= $_GET['name'] ?>"]').addClass("currentPage");
$('a').click(function(event){ event.preventDefault(); load(this.name); });
});
</script>
</body>
</html>