-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmywantlist.php
55 lines (51 loc) · 1.69 KB
/
mywantlist.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
<?php
include("./config.php");
$fl = new TemplatePower("./templates/mywantlist.tpl");
require("./header.php");
if(isset($login)&&$login==1 || isset($authenticated)&&$authenticated==1)
{
$fl->assign("_ROOT.SITENAAM", $sitenaam." / My Wantlist");
$selectid=get_uid($username);
$query="SELECT b.id, b.title, b.publisher, p.name FROM fl_books b, fl_publishers p, fl_wanted c WHERE c.user='".$selectid."' AND c.book=b.id AND b.publisher=p.id AND b.approved!='0000-00-00 00:00:00' ORDER BY title";
$result=mysql_query($query);
if(mysql_num_rows($result)>0)
{
$fl->newBlock("wantlist");
while($row=mysql_fetch_row($result))
{
$fl->newBlock("item");
$fl->assign("BID", opmaak($row[0]));
$fl->assign("TITLE", opmaak($row[1]));
$fl->assign("PID", opmaak($row[2]));
$fl->assign("PUBLISHER", opmaak($row[3]));
$aquery="SELECT a.id, a.name, a.firstname FROM fl_authors a, fl_author_book b WHERE b.book='".$row[0]."' AND b.author=a.id AND a.approved='1'";
$aresult=mysql_query($aquery);
if(mysql_num_rows($aresult)==1)
{
while($arow=mysql_fetch_row($aresult))
{
$fl->newBlock("author");
$fl->assign("AID", opmaak($arow[0]));
$fl->assign("AUTHOR", opmaak($arow[2].' '.$arow[1]));
}
}
else
{
$fl->newBlock("variousauthors");
}
}
}
else
{
$fl->newBlock("feedback");
$fl->assign("FEEDBACK", "There are no items in your wantlist at this moment");
}
}
else
{
$fl->newBlock("feedback");
$fl->assign("FEEDBACK", "You need to be logged in to use the personal account pages. If you don't have an account yet, you can <a href=\"signup.php\">sign up for an account here</a>");
$fl->assign("_ROOT.SITENAAM", $sitenaam." / Please log in");
}
$fl->printToScreen();
?>