-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
46 lines (40 loc) · 1.27 KB
/
index.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
<?php
include("./config.php");
$fl = new TemplatePower("./templates/index.tpl");
require("./header.php");
$fl->assign("_ROOT.SITENAAM", $sitenaam);
$query="SELECT UNIX_TIMESTAMP(datetime), title, message FROM fl_news ORDER BY datetime DESC LIMIT 5";
$result=mysql_query($query);
while($row=mysql_fetch_row($result))
{
$fl->newBlock("news");
$fl->assign("DATETIME", date("d M Y", $row[0]));
$fl->assign("TITLE", opmaak($row[1]));
$fl->assign("MESSAGE", stripslashes($row[2]));
}
$query="SELECT b.id, b.title, b.summary FROM fl_books b ORDER BY b.approved DESC LIMIT 3";
$result=mysql_query($query);
while($row=mysql_fetch_row($result))
{
$fl->newBlock("latestbooks");
$fl->assign("BOOK", opmaak($row[1]));
$fl->assign("ID", $row[0]);
$fl->assign("SUMMARY", strip_tags(stripslashes(substr($row[2], 0, 150)."...")));
$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";
$aresult=mysql_query($aquery);
if(mysql_num_rows($aresult)==1)
{
while($arow=mysql_fetch_row($aresult))
{
$fl->newBlock("authors");
$fl->assign("AUTHOR", opmaak("$arow[2] $arow[1]"));
$fl->assign("AID", opmaak($arow[0]));
}
}
else
{
$fl->newBlock("variousauthors");
}
}
$fl->printToScreen();
?>