forked from andig/videodb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.php
40 lines (31 loc) · 830 Bytes
/
help.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
<?php
/**
* Help Page
*
* Browses the manual
*
* @package videoDB
* @author Andreas Gohr <[email protected]>
* @version $Id: help.php,v 1.10 2004/09/20 15:15:41 andig2 Exp $
*/
require_once './core/functions.php';
function _replace_anchors_callback($matches)
{
if (!preg_match('=^https?://=',$matches[2]))
{
$matches[2] = 'help.php?page='.$matches[2];
}
return $matches[1].$matches[2].$matches[3];
}
if (empty($page)) $page='index.html';
$page = 'doc/manual/'.$page;
$html = file_get_contents($page);
$html = preg_replace_callback("/(<a\s+.*?href\s*=\s*\")(.*?)(\".*?>)/is", '_replace_anchors_callback', $html);
preg_match('=<body.*?>(.*)</body>=is',$html,$matches);
$html = $matches[1];
// prepare templates
tpl_page();
$smarty->assign('helptext', $html);
// display templates
tpl_display('help.tpl');
?>