Blame view

index.php 1.86 KB
392aea79   Jean Wasilewski   Added database na...
1
  <?php
5d22ed6b   Geoffrey PREUD'HOMME   Redirect crepbeta...
2
  
bfaa212b   Geoffrey PREUD'HOMME   $page definition ...
3
4
5
6
7
  $url = $_SERVER["REQUEST_URI"];
  $parsedUrl = parse_url($url);
  $path = $parsedUrl['path'];
  $explodedUrl = explode('/', $path);
  $page = end($explodedUrl);
847ea853   Geoffrey PREUD'HOMME   Ensure no .php ha...
8
  $page = str_replace('.php', '', $page);
3fe59fff   Geoffrey PREUD'HOMME   Quick sanitization
9
  $page = str_replace('.', '', $page); // TODO Better sanitization
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
10
  
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
11
12
  if ($page == '') {
  	$page = 'home';
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
13
  }
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
14
15
  $toLoad = "pages/$page.php";
  
cdf55d6e   Geoffrey PREUD'HOMME   Quick 404 redirec...
16
  if (!file_exists($toLoad)) {
71f6177a   Geoffrey PREUD'HOMME   Removed hacky rew...
17
18
  	header('HTTP/1.1 404 Not Found');
  	header('Status: 404 Not Found'); // FastCGI fix
cdf55d6e   Geoffrey PREUD'HOMME   Quick 404 redirec...
19
  	$toLoad = '404.php';
71f6177a   Geoffrey PREUD'HOMME   Removed hacky rew...
20
21
22
  } else {
  	header('HTTP/1.1 200 OK');
  	header('Status: 200 OK'); // FastCGI fix
cdf55d6e   Geoffrey PREUD'HOMME   Quick 404 redirec...
23
  }
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
24
  
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
25
  if (isset($_GET['c'])) {
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
26
  	require_once("$toLoad");
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
27
  } else {
392aea79   Jean Wasilewski   Added database na...
28
  ?>
86112ecf   Geoffrey PREUD'HOMME   Added html to DOC...
29
  <!DOCTYPE html>
83cfb6f1   Jean Wasilewski   Initial scheme
30
31
  <html>
  	<head>
bff153e8   Geoffrey PREUD'HOMME   Re-ordered <head>
32
33
34
35
  		<title>Coupe de Robotique des Ecoles Primaires</title>
  		<meta name="description" content="Site Web de la Coupe de Robotique des Ecoles Primaires">
  		<meta name="author" content="Club Informatique de Polytech Lille">
  		<link rel="shortcut icon" href="favicon.ico"/>
66d6b134   Jean Wasilewski   Added viewport meta
36
  		<meta name="viewport" content="width=device-width, initial-scale=1.0">
d8c7aa8a   Jean Wasilewski   UTF8 encoding
37
  		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
f9e2f87a   Jean Wasilewski   Header completed
38
  		<meta http-equiv="X-UA-Compatible" content="IE=edge">
0f2e15ae   Geoffrey PREUD'HOMME   Added theme color
39
  		<meta name="theme-color" content="#749BD1">
bff153e8   Geoffrey PREUD'HOMME   Re-ordered <head>
40
  		<link rel="stylesheet" href="css/bootstrap.min.css">
fc27b313   Jean Wasilewski   Added paffing for...
41
  		<link rel="stylesheet" href="css/crep.css">
ba995b4e   Geoffrey PREUD'HOMME   Included jquery i...
42
  		<script type="text/javascript" src="js/jquery.min.js"></script>
3d7135c9   henyxia   Now trying with t...
43
  		<script type="text/javascript" src="js/bootstrap.min.js"></script>
e010c399   Geoffrey PREUD'HOMME   Removed signed-in...
44
  		<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
56c75c13   Geoffrey PREUD'HOMME   [Navigation] Ouvr...
45
  		<script type="text/javascript" src="js/crep.js"></script>
852ae003   Geoffrey PREUD'HOMME   Konami code
46
  		<script type="text/javascript" src="js/konami.js"></script>
83cfb6f1   Jean Wasilewski   Initial scheme
47
48
  	</head>
  	<body>
389dfe1b   Jean Wasilewski   Fixed issue with ...
49
  <?php require_once("topnavbar.php");?>
f9e2f87a   Jean Wasilewski   Header completed
50
  <?php require_once("menu.php");?>
cf13ef6c   henyxia   New menu
51
52
  		<div class="col-md-12 center-block">
  			<div class="col-md-12" id="mainContainer">
bce06567   Geoffrey PREUD'HOMME   Static PHP naviga...
53
  <?php
635819a5   Geoffrey PREUD'HOMME   Fake mod rewrite
54
  	require_once("$toLoad");
bce06567   Geoffrey PREUD'HOMME   Static PHP naviga...
55
  ?>
f9e2f87a   Jean Wasilewski   Header completed
56
57
  			</div>
  		</div>
f57188db   henyxia   New footer
58
  <?php require_once("footer.php");?>
83cfb6f1   Jean Wasilewski   Initial scheme
59
  	</body>
389dfe1b   Jean Wasilewski   Fixed issue with ...
60
  </html>
d21cc05e   Geoffrey PREUD'HOMME   ?c parameter to o...
61
62
63
  
  <?php
  }
367056d9   Geoffrey PREUD'HOMME   Merge from flashF...
64
  ?>