forked from Tinyportal/TinyPortal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTPStandalone.php
50 lines (38 loc) · 1 KB
/
TPStandalone.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
<?php
/**
* TPStandalone.php
*
* @package TinyPortal
* @version 2.0.0
* @author tinoest - http://www.tinyportal.net
* @founder Bloc
* @license MPL 2.0
*
* The contents of this file are subject to the Mozilla Public License Version 2.0
* (the "License"); you may not use this package except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Copyright (C) - The TinyPortal Team
*
*/
$ssi_path = '';
$settings_path = '';
ob_start('tp_url_rewrite');
global $boardurl, $context;
require_once($settings_path);
$context['TPortal'] = array();
$actual_boardurl = $boardurl;
require_once($ssi_path);
TPortal_init();
writeLog();
TPortalMain();
obExit(true);
function tp_url_rewrite($buffer) {{{
global $actual_boardurl, $boardurl;
if (!empty($buffer) && stripos($buffer, $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']) !== false) {
$buffer = str_replace($boardurl, $actual_boardurl, $buffer);
}
return $buffer;
}}}
?>