-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-header.php
More file actions
185 lines (158 loc) · 4.98 KB
/
index-header.php
File metadata and controls
185 lines (158 loc) · 4.98 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?php
/*
* Session start
*/
session_start();
/*
* Error reportin 1 is aan 0 is uit
*/
ini_set('display_errors', 1); // 0 = uit, 1 = aan
error_reporting(E_ALL | E_STRICT);
/*
* AutoLoader
*/
function __autoload($className)
{
// haal de base dir op.
$base = dirname(__FILE__);
// het pad ophalen
$path = $className;
// alle paden samenvoegen tot waar ik zijn moet en de phpfile eraan plakken.
$file = $base . "/lib/" . $path . '.php';
// als file bestaat haal op anders error
if (file_exists($file))
{
require $file;
}
else
{
error_log('Class "' . $className . '" could not be autoloaded');
throw new Exception('Class "' . $className . '" could not be autoloaded from: ' . $file);
}
}
/*
* Menu block
*/
$menu = '';
if (file_exists("index.ini") && is_array($content = parse_ini_file("index.ini", true)))
{
if (array_key_exists("navigation", $content))
{
foreach ($content["navigation"] as $basename => $title)
{
if(isset($_GET['page']) and $_GET['page'] == $basename)
{
$class = 'current';
}
else
{
$class = '';
}
$menu .= '<li><a class="' . $class . '" href="index.php?page=' . $basename . '">' . $title . '</a></li>';
}
}
}
/*
* get Content blocks
*/
try
{
$db = new PDO('mysql:host=localhost;dbname=projectx', 'root', 'root');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $db->prepare(' SELECT
id, title, content, description, thumbnail, data
FROM
articles
ORDER BY
data
');
$stmt->execute();
if($stmt === false)
{
$msg = 'error 03';
}
else
{
$msg = '';
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
{
foreach($row as $rows => $key)
{
$msg .= '<article class="contentblock">';
$msg .= '<figure> <a href="#"><img src="img/nofoto.gif" alt="Post thumbnail" class="thumbnail alignleft" /></a> </figure>';
$msg .= '<h2>' . $key['title'] . '</h2><time datetime=' . $key['data'] . '>' . $key['data'] . '</time>' ;
$msg .= '<p>' . $key['description'] . '</p>';
$msg .= '<a class="read-more" href="?id='. (int) ($key['id']) .'">lees verder</a>';
$msg .= '</article>';
$msg = preg_replace("#(^|[ \n\r\t])www.([a-z\-0-9]+).([a-z]{2,4})($|[ \n\r\t])#mi", "\\1<a href=\"http://www.\\2.\\3\" target=\"_blank\">www.\\2.\\3</a>\\4", $msg);
$msg = preg_replace("#(^|[ \n\r\t])(((ftp://)|(http://)|(https://))([a-z0-9\-\.,\?!%\*_\#:;~\\&$@\/=\+]+))#mi", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $msg);
}
}
}
}
catch (PDOException $e)
{
$msg = "Error:" . $e;
}
$db = NULL;
?>
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="nl"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>
<?php
if (file_exists("index.ini") && is_array($title = parse_ini_file("index.ini", true)))
{
if (array_key_exists("title", $title))
{
foreach ($title["title"] as $basename => $title)
{
if(isset($_GET['page']) and $_GET['page'] == $basename)
{
echo $title;
}
}
}
else
{
echo 'Reshad Farid';
}
}
?>
</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/design.css">
<script src="js/libs/modernizr-2.5.3.min.js"></script>
<!-- Begin Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent -->
<link rel="stylesheet" type="text/css" href="css/cookiebar.css"/>
<script type="text/javascript" src="http://assets.cookieconsent.silktide.com/1.0.8/plugin.min.js"></script>
<script type="text/javascript">
// <![CDATA[
cc.initialise({
cookies: {
analytics: {}
},
settings: {
consenttype: "implicit",
bannerPosition: "top",
tagPosition: "vertical-left",
hideprivacysettingstab: true,
refreshOnConsent: true,
disableallsites: true
},
strings: {
analyticsDefaultDescription: 'We maken gebruik van cookies om u en andere gebruikers een betere gebruikerservaring te geven.',
advertisingDefaultDescription: 'We maken gebruik van cookies om u en andere gebruikers een betere gebruikerservaring te geven.'
}
});
// ]]>
</script>
<!-- End Cookie Consent plugin -->
</head>