forked from dionyziz/complexity-article
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
42 lines (38 loc) · 987 Bytes
/
index.php
File metadata and controls
42 lines (38 loc) · 987 Bytes
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
<?php
$languages = array(
'en' => 'English',
'el' => 'Ελληνικά',
'mk' => 'македонски',
'es' => 'Español'
);
$lang = 'en';
foreach ( $languages as $code => $caption ) {
if ( isset( $_GET[ $code ] ) ) {
$lang = $code;
break;
}
}
ob_start();
?>
<ul class='translations'>
<?php
foreach ( $languages as $code => $caption ) {
?><li class='<?php
if ( $code == $lang ) {
?>selected<?php
}
?>'><a href='?<?php
echo $code;
?>'><?php
echo $caption;
?></a></li><?php
}
?><li><a href='mailto:dionyziz@gmail.com'>Help translate</a></li>
</ul>
<?php
$translations = ob_get_clean();
$article = include 'index-' . $lang . '.php';
include 'header.php';
echo $article[ 'content' ];
include 'footer.php';
?>