forked from afshinm/tehlug
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
72 lines (63 loc) · 2.24 KB
/
index.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
include_once('functions.php');
?>
<html>
<head>
<title>Tehran Linux Users Group</title>
<meta http-equiv="content-type" content="text-html; charset=UTF-8" />
<link rel="stylesheet" href="style.css" />
<link rel="alternate" type="application/rss+xml" href="rss.php" />
<link rel="icon" href="images/favicon.png" />
</head>
<body>
<div id="container">
<div id="header">
<div id="menu_container">
<?php
include('menu.php');
?>
<div id="search_box">
<form action="index.php?page=search" method="POST">
<input type="text" name="keywords" value="<?php if(isset($_POST['keywords'])) { echo $_POST['keywords']; } ?>" />
<input type="submit" name="submit" value="جستجو" />
</form>
</div>
</div>
</div>
<div id="content">
<?php
$page = (isset($_GET['page'])) ? $_GET['page'] : "front";
$page = 'contents/'.htmlentities($page).'.php';
//Make sure page is a subdir of contents
$realpath = realpath($page);
$contentsPath = realpath('./contents');
if(substr($realpath, 0, strlen($contentsPath)) === $contentsPath)
if(file_exists($page)) {
include($page);
$included = true;
}
?>
</div>
<div class="clear"></div>
<div id="footer">
<?php
if(isset($included)) {
$time = filemtime($page);
echo 'Updated: $Date: '.date('Y/m/d H:i:s', $time).' IRST $';
}
?>
</div>
<!-- Piwik -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "https://tehlug.org/stats/" : "http://tehlug.org/stats/");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src="http://tehlug.org/stats/piwik.php?idsite=1" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->
</body>
</html>