-
Notifications
You must be signed in to change notification settings - Fork 1
/
view.php
65 lines (65 loc) · 2.02 KB
/
view.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<?php
include 'config.php';
$link = mysql_connect($mysql_host, $mysql_user, $mysql_password) or die('Could not connect: ' . mysql_error());
mysql_select_db($mysql_database) or die('Could not select database');
if(isset($_GET['id'])) {
$id = $_GET['id'];
$query = "SELECT * FROM `minibooru` WHERE `filename` = '$id' LIMIT 1";
$result = mysql_query($query) or die(mysql_error());
if($row = mysql_fetch_array($result)) {
$titleext = $row['tags'];
}
else {
$notfound = true;
$titleext = "Not Found";
}
echo "<title>$title - $titleext";
}
?>
</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="favorite icon" href="favicon.png" />
</title>
</head>
<body id="view">
<div id="header">
<span style="font-size: 25px; font-weight: bold"><?php echo "$title"; ?></span>
<div id="navbar">
<a href="index.php">Home</a>
<a href="search.php?s=new">Newest</a>
<a href="upload.php">Upload</a>
<a href="about.php">About</a>
</div>
</div>
<div id="sidebar">
<form action="search.php" method="get">
<div id="searcharea">
<input id="searchbox" name="q" size="22" type="text" /><br />
<input id="searchbutton" type="submit" value="Search" />
</div>
</form>
<div id="tags">
<?php
$tags = substr($row['tags'], 1, strlen($row['tags']) - 2);
$tags = explode(' ', $tags);
foreach($tags as $tag) {
echo "<a href=\"search.php?q=$tag\">$tag</a><br />\n";
}
?>
</div>
</div>
<div id="content">
<?php
$filename = $row['filename'];
$width = $row['width'];
$height = $row['height'];
echo "<img src=\"$imagedir/$filename\" alt=\"$titleext\" title=\"$titleext\"><br />\n";
echo "Width: $width Height: $height<br />\n";
echo "<a href=\"remove.php?id=$filename\">Remove</a> <a href=\"edit.php?id=$filename\">Edit</a>\n";
?>
</div>
</body>
</html>