forked from iseeyoucopy/U-232-Trinity-RC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
help.php
123 lines (123 loc) · 5 KB
/
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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php
/**
* ------- U-232 Codename Trinity ----------*
* ---------------------------------------------*
* -------- @authors U-232 Team --------------*
* ---------------------------------------------*
* ----- @site https://u-232.duckdns.org/ ----*
* ---------------------------------------------*
* ----- @copyright 2020 U-232 Team ----------*
* ---------------------------------------------*
* ------------ @version V6 ------------------*
*/
require_once(__DIR__.DIRECTORY_SEPARATOR.'include'.DIRECTORY_SEPARATOR.'bittorrent.php');
require_once(INCL_DIR.'user_functions.php');
require_once(INCL_DIR.'bbcode_functions.php');
dbconn(false);
loggedinorreturn();
$lang = array_merge(load_language('global'), load_language('help'));
$HTMLOUT = '';
$HTMLOUT .= '<div class="grid-container">
<div class="grid-x">
<div class="cell medium-3">';
$HTMLOUT .= "<ul class='vertical menu drilldown' data-drilldown data-auto-height=true data-animate-height='true' style = 'width: 200px'>
<li>
<a href='#'>FAQ</a>
<ul class='menu vertical nested'>";
$count = 0;
$cats = [];
($q = sql_query("SELECT * FROM faq_cat WHERE min_view <=".sqlesc($CURUSER['class']))) || sqlerr(__file__, __line__);
while ($item = $q->fetch_assoc()) {
$cats[] = $item;
}
foreach ($cats as $row) {
if ($count == 9) {
$HTMLOUT .= "";
}
if ($count == 0) {
$HTMLOUT .= "";
} else {
$HTMLOUT .= "";
}
$HTMLOUT .= "<li><a data-toggle='div".htmlsafechars($row['shortcut'])."' href='#".htmlsafechars($row['shortcut'])."'>".htmlsafechars($row['name'])."</a></li>";
$count++;
}
$HTMLOUT .= "</ul></li>";
$count = 0;
if (($faqs = $cache->get($cache_keys['faqs'])) === false) {
$faqs = [];
($q2 = sql_query("SELECT * FROM faq")) || sqlerr(__FILE__, __LINE__);
while ($row = $q2->fetch_assoc()) {
$faqs[] = $row;
}
$cache->set($cache_keys['faqs'], $faqs, $TRINITY20['expires']['faqs']);
}
$rules = [];
if (($rules = $cache->get($cache_keys['rules'])) === false) {
$q = sql_query("SELECT rules_cat.id, rules_cat.name, rules_cat.shortcut, rules_cat.min_view, rules.type, rules.title, rules.text FROM rules_cat LEFT JOIN rules ON rules.type=rules_cat.id WHERE rules_cat.min_view <=".sqlesc($CURUSER['class']));
while ($item1 = $q->fetch_assoc()) {
$rules = (array)$rules;
$rules[] = $item1;
}
$cache->set($cache_keys['rules'], $rules, $TRINITY20['expires']['rules']);
}
$HTMLOUT .= "<li><a href='#'>Rules</a>
<ul class='menu vertical nested'>";
foreach ($rules as $row_rules) {
if (is_array($row_rules)) {
$HTMLOUT .= "<li><a data-toggle='div".htmlsafechars($row_rules['shortcut'])."' href='#".htmlsafechars($row_rules['shortcut'])."'>".htmlsafechars($row_rules['name'])."</a></li>";
}
}
$HTMLOUT .= "</ul></li>";
$HTMLOUT .= "</ul></div>
<div class='cell medium-9'>
<h6 class='sub-header text-center'>{$lang['faq_welcome']}</h6>
<h6 class='sub-header text-center'>{$lang['rules_welcome']}</h6>
</div>";
//** Start Rules reveal/modal **//
foreach ($rules as $row_rules) {
$HTMLOUT .= "<div class='reveal' id='div".htmlsafechars($row_rules['shortcut'] ?? '')."' data-reveal>
<p><h4 class='sub-header'>".htmlsafechars($row_rules['name'] ?? '')."</h4></p>";
$HTMLOUT .= "<ul class='accordion' data-accordion data-allow-all-closed='true'>
<li class='accordion-item is-active' data-accordion-item>
<a href='#' class='accordion-title'>".htmlsafechars($row_rules['title'] ?? '')."</strong></a>
<div class='accordion-content' data-tab-content>
<p>".htmlsafechars_decode($row_rules['text'] ?? '')."</p></div>";
$HTMLOUT .= "</div>";
}
//** End Rules reveal/modal **//
//** Start FAQ reveal/modal **//
foreach ($cats as $row) {
$HTMLOUT .= "<div class='reveal' id='div".htmlsafechars($row['shortcut'])."' data-reveal>
<p><h2>".htmlsafechars($row['name'])."</h2></p>";
foreach ($faqs as $item) {
if ($item['type'] == $row['id']) {
$item['text'] = str_replace([
"SITE_NAME",
"SITE_PIC_URL",
"BASE_URL",
" ",
], [
"{$TRINITY20['site_name']}",
"{$TRINITY20['pic_base_url']}",
"{$TRINITY20['baseurl']}",
" ",
], $item['text']);
$HTMLOUT .= "<ul class='accordion' data-accordion data-allow-all-closed='true'>
<li class='accordion-item is-active' data-accordion-item>
<a href='#' class='accordion-title'><strong>".htmlsafechars_decode($item['title'])."</strong></a>
<div class='accordion-content' data-tab-content>
<p>".htmlsafechars_decode($item['text'])."</p>
</div>
</li>
</ul>";
}
}
$HTMLOUT .= '<button class="close-button" data-close aria-label="Close reveal" type="button">
<span aria-hidden="true">×</span>
</button></div>';
}
//** End FAQ reveal/modal **//
$HTMLOUT .= '</div></div>';
echo stdhead('FAQ & Rules').$HTMLOUT.stdfoot();
?>