-
Notifications
You must be signed in to change notification settings - Fork 28
/
buttons.php
61 lines (52 loc) · 1.38 KB
/
buttons.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
<?php
require_once("bootstrap.inc.php");
class PouetBoxButtons extends PouetBox
{
public $buttons;
function __construct()
{
parent::__construct();
$this->uniqueID = "pouetbox_buttons";
}
function LoadFromDB()
{
// Get all the buttons ordered by type of buttons, randomly within each type
$this->buttons = SQLLib::SelectRows("SELECT type, url, img, alt FROM buttons WHERE dead = 0 ORDER BY type ASC, RAND()");
}
function Render()
{
echo "\n\n";
echo "<div class='pouettbl' id='".$this->uniqueID."'>\n";
$type = "";
foreach($this->buttons as $b)
{
if ($type != $b->type)
{
if($type)
{
echo "</ul>\n";
echo "</div>\n";
}
echo "<h2>"._html($b->type)."</h2>\n";
echo "<div class='content'>\n";
echo "<ul>\n";
$type = $b->type;
}
echo " <li><a href='"._html($b->url)."'><img src='".POUET_CONTENT_URL."buttons/".$b->img."' title='"._html($b->alt)."' alt='"._html($b->alt)."'/></a></li>\n";
}
echo "</ul>\n";
echo "</div>\n";
echo "</div>\n";
}
};
$TITLE = "we like !";
require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");
echo "<div id='content'>\n";
$box = new PouetBoxButtons();
$box->Load();
$box->Render();
echo "</div>\n";
require("include_pouet/menu.inc.php");
require_once("include_pouet/footer.php");
?>