-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcontent.php
71 lines (51 loc) · 1.37 KB
/
content.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
<div style="width:900px;" >
<?php
define('PHP_TAG', '<?php');
// geshi einbinden
if (file_exists('./core/vendor/geshi/geshi.php'))
include './core/vendor/geshi/geshi.php';
include './core/vendor/dflydev/markdown/IMarkdownParser.php';
include './core/vendor/dflydev/markdown/MarkdownParser.php';
include './core/vendor/dflydev/markdown/MarkdownExtraParser.php';
use dflydev\markdown\MarkdownParser;
include './conf/conf.php';
include './core/functions.php';
include './core/grid/SimpleGrid.php';
include './core/tree/TreeSimple.php';
if (isset($_GET ['page'])) {
$tkn = explode( ':' , $_GET ['page']);
$page = DOC_ROOT.$tkn[0].'/doc/de/'. str_replace(array (
'/', '.'
), array (
'', '/'
), $tkn[1]) . '.php';
} else {
$page = './doc/de/start.php';
}
if (file_exists($page)) {
start_md();
include $page;
echo render_md();
} elseif ('127.0.0.1' == $_SERVER ['SERVER_NAME']) {
if (!is_dir(dirname($page)))
mkdir(dirname($page), 0777, true);
$tmp = explode('.', $_GET ['page']);
$key = ucfirst(array_pop($tmp));
file_put_contents( $page, <<<HTML
#{$key}
Hier könnte ihre Dokumentation stehen... Wenn sie endlich jemand schreiben würde...
## Codebeispiel
<?php start_highlight(); ?>
<_..._>
</_..._>
<?php display_highlight( 'xml' ); ?>
HTML
);
start_md();
include $page;
render_md();
} else {
include 'doc/de/errors/404.php';
}
?>
</div>