forked from pouetnet/pouet-www-v2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsceneorg.php
143 lines (122 loc) · 3.86 KB
/
sceneorg.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?
require_once("bootstrap.inc.php");
class PouetBoxSceneOrgAwards extends PouetBox {
function PouetBoxSceneOrgAwards() {
parent::__construct();
$this->uniqueID = "pouetbox_sceneorgawards";
$this->title = "scene.org awards";
}
function LoadFromDB()
{
$s = new BM_Query("sceneorgrecommended");
$s->AddField("sceneorgrecommended.type");
$s->AddField("sceneorgrecommended.category");
$s->attach(array("sceneorgrecommended"=>"prodID"),array("prods as prod"=>"id"));
$s->AddOrder("date_format(sceneorgrecommended_prod.releaseDate,'%Y') DESC");
$s->AddOrder("sceneorgrecommended.category");
$s->AddOrder("sceneorgrecommended.type");
$s->AddWhere("sceneorgrecommended.type != 'viewingtip'");
$this->sceneorg = $s->perform();
$a = array();
foreach($this->sceneorg as $v) $a[] = &$v->prod;
PouetCollectPlatforms($a);
}
function RenderBody()
{
echo "\n\n";
echo "<table class='boxtable'>\n";
$lastYear = 0;
$lastCategory = "";
foreach ($this->sceneorg as $row)
{
if ($lastYear != substr($row->prod->releaseDate,0,4))
{
$lastYear = substr($row->prod->releaseDate,0,4);
echo "<tr><th colspan='3' class='year'>".$lastYear."</th></tr>\n";
}
if ($lastCategory != $row->category)
{
$lastCategory = $row->category;
echo "<tr id='".str_replace(" ","",$lastYear.$lastCategory)."'><th colspan='3' class='category'>".$lastCategory."</th></tr>\n";
}
$p = $row->prod;
if (!$p) continue;
echo "<tr>\n";
echo "<td>\n";
echo "<img src='".POUET_CONTENT_URL."gfx/sceneorg/".$row->type.".gif' alt='".$row->type."'/> ";
echo $p->RenderTypeIcons();
echo "<span class='prod'>".$p->RenderLink()."</span>\n";
echo "</td>\n";
echo "<td>\n";
echo $p->RenderGroupsShortProdlist();
echo "</td>\n";
echo "<td>\n";
echo $p->RenderPlatformIcons();
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}
};
class PouetBoxSceneOrgTips extends PouetBox {
function PouetBoxSceneOrgTips() {
parent::__construct();
$this->uniqueID = "pouetbox_sceneorgtips";
$this->title = "scene.org viewing tips";
}
function LoadFromDB()
{
$s = new BM_Query("sceneorgrecommended");
$s->AddField("sceneorgrecommended.type");
$s->attach(array("sceneorgrecommended"=>"prodID"),array("prods as prod"=>"id"));
$s->AddOrder("date_format(sceneorgrecommended_prod.releaseDate,'%Y') DESC");
$s->AddWhere("sceneorgrecommended.type = 'viewingtip'");
$this->sceneorg = $s->perform();
$a = array();
foreach($this->sceneorg as $v) $a[] = &$v->prod;
PouetCollectPlatforms($a);
}
function RenderBody()
{
echo "\n\n";
echo "<table class='boxtable'>\n";
$lastYear = 0;
$lastCategory = "";
foreach ($this->sceneorg as $row)
{
if ($lastYear != substr($row->prod->releaseDate,0,4))
{
$lastYear = substr($row->prod->releaseDate,0,4);
echo "<tr id='".$lastYear."'><th colspan='3' class='year'>".$lastYear."</th></tr>\n";
}
$p = $row->prod;
echo "<tr>\n";
echo "<td>\n";
echo $p->RenderTypeIcons();
echo "<span class='prod'>".$p->RenderLink()."</span>\n";
echo "</td>\n";
echo "<td>\n";
echo $p->RenderGroupsShortProdlist();
echo "</td>\n";
echo "<td>\n";
echo $p->RenderPlatformIcons();
echo "</td>\n";
echo "</tr>\n";
}
echo "</table>\n";
}
};
$TITLE = "scene.org awards and viewing tips";
require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");
echo "<div id='content'>\n";
$box = new PouetBoxSceneOrgAwards();
$box->Load();
$box->Render();
$box = new PouetBoxSceneOrgTips();
$box->Load();
$box->Render();
echo "</div>\n";
require("include_pouet/menu.inc.php");
require_once("include_pouet/footer.php");
?>