forked from pouetnet/pouet-www-v2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaq.php
69 lines (58 loc) · 1.52 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
<?
require_once("bootstrap.inc.php");
class PouetBoxFAQ extends PouetBox {
function PouetBoxFAQ() {
parent::__construct();
$this->uniqueID = "pouetbox_faq";
$this->title = "the always incomplete pouët.net faq";
}
function LoadFromDB()
{
$this->entries = SQLLib::SelectRows("select * from faq where deprecated = 0 order by category, id");
}
function RenderBody()
{
echo "<div class='content'>\n";
$lastType = "";
foreach($this->entries as $e)
{
if ($lastType != $e->category)
{
if ($lastType)
echo "</ul>\n";
echo "<h3>"._html($e->category)."</h3>";
$lastType = $e->category;
echo "<ul>\n";
}
echo "<li><a href='#faq"._html($e->id)."'>".$e->question."</a></li>";
}
echo "</ul>\n";
echo "</div>\n";
$lastType = "";
foreach($this->entries as $e)
{
if ($lastType != $e->category)
{
if ($lastType)
echo "</dl>\n";
echo "<h2>:: "._html($e->category)."</h2>";
$lastType = $e->category;
echo "<dl>\n";
}
echo "<dt id='faq"._html($e->id)."'>:: "._html($e->category)." :: ".$e->question."</dt>";
echo "<dd>".$e->answer."</dd>";
}
echo "</dl>\n";
}
};
$TITLE = "faq";
require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");
echo "<div id='content'>\n";
$box = new PouetBoxFAQ();
$box->Load();
$box->Render();
echo "</div>\n";
require("include_pouet/menu.inc.php");
require_once("include_pouet/footer.php");
?>