forked from Bigjoos/U-232-V5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
faq.php
83 lines (82 loc) · 3.68 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
79
80
81
82
83
<?php
/**
|--------------------------------------------------------------------------|
| https://github.com/Bigjoos/ |
|--------------------------------------------------------------------------|
| Licence Info: WTFPL |
|--------------------------------------------------------------------------|
| Copyright (C) 2010 U-232 V5 |
|--------------------------------------------------------------------------|
| A bittorrent tracker source based on TBDev.net/tbsource/bytemonsoon. |
|--------------------------------------------------------------------------|
| Project Leaders: Mindless, Autotron, whocares, Swizzles. |
|--------------------------------------------------------------------------|
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \ / \
( U | - | 2 | 3 | 2 )-( S | o | u | r | c | e )-( C | o | d | e )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
*/
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('faq'));
$HTMLOUT = '<div class="panel panel-default">';
$HTMLOUT.= "<div class='panel-heading'>{$lang['faq_welcome']}</div>";
$HTMLOUT.= "<div class='panel panel-default'>";
$HTMLOUT.= "<table class='table table-bordered table-striped'><tr><td class='embedded'><h2>{$lang['faq_contents_header']}</h2><ul id='myTab' class='nav nav-pills'>";
$count = 0;
$cats = array();
$q = sql_query("SELECT * FROM faq_cat WHERE min_view <=" . sqlesc($CURUSER['class']));
while ($item = mysqli_fetch_assoc($q)) {
$cats[] = $item;
}
foreach ($cats as $row) {
if ($count == 9) $HTMLOUT.= "<div style='display:block;height:50px;'></div>";
if ($count == 0) $HTMLOUT.= "<li class='active'>";
else $HTMLOUT.= "<li>";
$HTMLOUT.= "<a href='#".htmlsafechars($row['shortcut'])."' data-toggle='tab'>".htmlsafechars($row['name'])."</a></li>";
$count++;
}
$HTMLOUT.= "</ul>
<hr />
<div style='display:block;height:20px;'></div>
<div id='myTabContent' class='panel panel-body tab-content'>";
$count = 0;
if (($faqs = $mc1->get_value('faqs__')) === false) {
$faqs = array();
$q2 = sql_query("SELECT * FROM faq");
while ($row = mysqli_fetch_assoc($q2)) $faqs[] = $row;
$mc1->cache_value('faqs__', $faqs, $INSTALLER09['expires']['faqs']);
}
foreach ($cats as $row) {
$HTMLOUT.= "<div class='tab-pane fade " . ($count == 0 ? "in active" : "") . "' id='".htmlsafechars($row['shortcut'])."'>
<p><h2>".htmlsafechars($row['name'])."</h2></p><p>";
foreach ($faqs as $item) {
if($item['type'] == $row['id']){
$item['text'] = str_replace(array(
"SITE_NAME",
"SITE_PIC_URL",
"BASE_URL",
" "
) , array(
"{$INSTALLER09['site_name']}",
"{$INSTALLER09['pic_base_url']}",
"{$INSTALLER09['baseurl']}",
" "
) , $item['text']);
$HTMLOUT.= "<b>".htmlspecialchars_decode($item['title'])."</b><br />
<br />".htmlspecialchars_decode($item['text'])."<br />
<br />
<br />";
}
}
$HTMLOUT.= "</p></div>";
$count++;
}
$HTMLOUT.= "</table>";
$HTMLOUT.= "</div></div>";
/////////////////////// HTML OUTPUT ///////////////////////
echo stdhead('FAQ') . $HTMLOUT . stdfoot();
?>