-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathajax_help.php
More file actions
46 lines (45 loc) · 1.03 KB
/
ajax_help.php
File metadata and controls
46 lines (45 loc) · 1.03 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
<?
// ===================================================================
// Sim Roulette -> AJAX
// License: GPL v3 (http://www.gnu.org/licenses/gpl.html)
// Copyright (c) 2016-2025 Sim Roulette, https://sim-roulette.com
// ===================================================================
include("_func.php");
if (!$_SERVER['HTTP_REFERER']){$_SERVER['HTTP_REFERER']='/index.php';}
$url=explode('/',$_SERVER['HTTP_REFERER']);
$url=$url[count($url)-1];
if (!$url){$url='index.php';}
$txt=trim(file_get_contents('help.txt'));
while (1)
{
$a=$txt;
$txt=str_replace('====','===',$txt);
if ($a==$txt){break;}
}
while (1)
{
$a=$txt;
$txt=str_replace('----','---',$txt);
if ($a==$txt){break;}
}
$a=explode("===",$txt);
$out='';
for ($i=count($a)-1;$i>0;$i--)
{
if ($a[$i])
{
$b=explode("---",$a[$i]);
$c=explode("
",trim($b[0]));
if (strpos($url,$c[0])!==false)
{
$out.='<h1>'.$c[1].'</h1>';
$out.=str_replace("
",'<br>',$b[1]);
break;
}
}
}
if (!$out){$out='Помощь по разделу готовится...';}
echo $out;
?>