[go: up one dir, main page]

Menu

[72b583]: / www / pslib.php  Maximize  Restore  History

Download this file

59 lines (54 with data), 1.6 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
<?php
$manpagedir = "doc";
function output_manpage_content($funcname) {
global $manpagedir;
$filename = $manpagedir."/".$funcname.".html";
if(file_exists($filename)) {
$content = file_get_contents($filename);
$start = strpos($content, "<H1");
if($start !== false) {
$content = substr($content, $start, -16);
$pattern = "/([a-zA-Z0-9_]*)\(([0-9])\)/";
$replacement = "<a href=\"documentation.php?manpage=\$1\">\$1(\$2)</a>";
$content = preg_replace($pattern, $replacement, $content);
echo $content."\n";
}
} else {
echo "Manual page for ".$funcname." not found!\n";
}
}
function output_manpage($funcname) {
global $manpagedir;
$filename = $manpagedir."/".$funcname.".html";
if(file_exists($filename)) {
$filecreation = date("Y-m-d", filemtime($filename));
echo "<A HREF=\"documentation.php?manpage=".$funcname."\">".$funcname."</A> (".$filecreation.")<BR>\n";
} else {
echo "Manual page for ".$funcname." not found!\n";
}
}
function output_manpage_list() {
global $manpagedir;
if($handle = opendir($manpagedir)) {
$files = array();
while (false !== ($file = readdir($handle))) {
if(substr($file, 0, 2) == "PS") {
$files[] = $file;
}
}
asort($files);
closedir($handle);
foreach($files as $file)
output_manpage(substr($file, 0, -5));
}
}
function output_news($headline, $date, $text) {
echo "<h2>".$headline."</h2>\n";
echo "<p>".$date."\n";
echo "<p>".$text."\n";
}
function output_manpage_old($funcname) {
$filecreation = date("Y-m-d", filemtime("doc/".$funcname.".html"));
echo "<A HREF=\"doc/".$funcname.".html\">".$funcname."</A> (".$filecreation.")<BR>\n";
}
?>