-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaq.php
78 lines (69 loc) · 2.05 KB
/
faq.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
72
73
74
75
76
77
78
<?php
// AcmlmBoard XD - Frequently Asked Questions page
// Access: all
include("lib/common.php");
$title = "FAQ";
$admin = UserLink(Fetch(Query("select name, id, powerlevel, sex from users where id = 1")));
$sexes = array(0=>__("Male"),1=>__("Female"),2=>__("N/A"));
$powerlevels = array(0=>__("Normal user"),1=>__("Local moderator"),2=>__("Full moderator"),3=>__("Administrator"),4=>__("Root"));
$headers = "";
$colors = "";
foreach($sexes as $ss)
$headers .= format(
"
<th>
{0}
</th>
", $ss);
foreach($powerlevels as $pn => $ps)
{
$cellClass = ($cellClass+1) % 2;
$items = "";
foreach($sexes as $sn => $ss)
$items .= format(
"
<td class=\"center\">
<a href=\"javascript:void()\"><span class=\"nc{0}{1}\" style=\"font-weight: bold;\">
{2}
</span></a>
</td>
", $sn, $pn, $ps);
$colors .= format(
"
<tr class=\"cell{0}\">
{1}
</tr>
", $cellClass, $items);
}
$colortable = format("
<table class=\"width50 outline\" style=\"margin-left: 25%; margin-right: auto\">
<tr class=\"header1\">
{0}
</tr>
<tr class=\"cell0\">
<td class=\"center\" colspan=\"3\">
<a href=\"javascript:void()\"><span class=\"nc0x\" style=\"font-weight: bold;\">
".__("Banned user")."
</span></a>
</td>
</tr>
{1}
</table>
", $headers, $colors);
$faq = file_get_contents("lib/lang/faq_".$language.".html");
$faq = str_replace("<colortable />", $colortable, $faq);
if(empty($theWord))
$faq = preg_replace("'<iftheword>(.*)</iftheword>'s", "", $faq);
else
$faq = str_replace("<theword />", $theWord, $faq);
$code1 = '<link rel="stylesheet" type="text/css" href="http://.../MyLayout_$theme.css" />';
$code2 = '<link rel="stylesheet" type="text/css" href="http://.../MyLayout_'.$theme.'.css" />';
$faq = str_replace("<themeexample1 />", '<themeexample1>', $faq);
$faq = str_replace("<themeexample2 />", '<themeexample2>', $faq);
$faq = str_replace("<themelist />", implode(", ", $themeFiles), $faq);
$faq = str_replace("<admin />", $admin, $faq);
write("
<div class=\"faq outline margin\" style=\"width: 60%; overflow: auto; margin: auto;\">
{0}
</div>", $faq);
?>