forked from pouetnet/pouet2.0
-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_watchlist.php
83 lines (65 loc) · 1.88 KB
/
user_watchlist.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
<?
require_once("bootstrap.inc.php");
class PouetBoxUserWatchlist extends PouetBox {
function PouetBoxUserWatchlist() {
parent::__construct();
$this->uniqueID = "pouetbox_userwatchlist";
$this->title = "your watchlist";
}
function LoadFromDB()
{
global $currentUser;
$ids = SQLLib::SelectRows(sprintf_esc("select prodID from watchlist where userID = %d",$currentUser->id));
if (!count($ids)) return;
$i = array();
foreach($ids as $v) $i[] = $v->prodID;
$s = new BM_Query("prods");
$s->AddWhere( sprintf_esc("prods.id in (%s)",implode(",",$i) ) );
$this->prods = $s->perform();
PouetCollectPlatforms($this->prods);
}
function RenderBody()
{
echo "\n\n";
echo "<table class='boxtable'>\n";
echo "<tr>\n";
//echo " <th><img src='".POUET_CONTENT_URL."gfx/rulez.gif'/></th>\n";
echo " <th>name</th>\n";
echo " <th>group</th>\n";
echo " <th>platform</th>\n";
//echo " <th>time</th>\n";
//echo " <th>user</th>\n";
echo "</tr>\n";
foreach ($this->prods as $p)
{
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";
}
};
$TITLE = "your watchlist";
require_once("include_pouet/header.php");
require("include_pouet/menu.inc.php");
if ($currentUser)
{
echo "<div id='content'>\n";
$box = new PouetBoxUserWatchlist();
$box->Load();
$box->Render();
echo "</div>\n";
}
require("include_pouet/menu.inc.php");
require_once("include_pouet/footer.php");
?>