-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path404.php
53 lines (46 loc) · 1.39 KB
/
404.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
<?php
include("./config.php");
$fl = new TemplatePower("./templates/error.tpl");
require("./header.php");
$fl->assign("_ROOT.SITENAAM", $sitenaam." / Error 404 (File Not Found)");
$query="SELECT id FROM fl_errors WHERE type='404'";
$result=mysql_query($query);
$teller=0;
while($row=mysql_fetch_row($result))
{
$error[$teller]=$row[0];
}
srand ((double) microtime() * 1000000);
$num=rand(0,count($error)-1);
$key=$error[$num];
$query="SELECT error, source FROM fl_errors WHERE id='".$key."'";
$result=mysql_query($query);
$row=mysql_fetch_row($result);
$fl->assign("_ROOT.ERROR", opmaak($row[0]));
$fl->assign("_ROOT.SOURCE", opmaak($row[1]));
$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", opmaak(substr($row[2], 0, 150)."..."));
$aquery="SELECT a.id, a.name 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[1]));
$fl->assign("AID", opmaak($arow[0]));
}
}
else
{
$fl->newBlock("variousauthors");
}
}
$fl->printToScreen();
?>