-
Notifications
You must be signed in to change notification settings - Fork 1
/
image.php
48 lines (40 loc) · 3.24 KB
/
image.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
<!DOCTYPE HTML>
<html lang="en">
<head>
<?php include 'common/head.php'; ?>
</head>
<body>
<?php include 'common/header.php'; ?>
<div class="container">
<div class="image">
<?php
$target_file = htmlspecialchars($_GET['i']);
if (!file_exists($target_file)) {
echo '<div class="imageError"><p><strong>WAT DID YOU DO??? Your file is not here!</strong></p><p><a href="/img/">See all your images</p></div>';
} else {
$directory = pathinfo($target_file, PATHINFO_DIRNAME);
$filename = pathinfo($target_file, PATHINFO_FILENAME);
$extension = pathinfo($target_file, PATHINFO_EXTENSION);
echo '<div class="imageSingle">';
echo '<img src="' . $directory . '/' . $filename . '-m.' . $extension . '">';
echo '</div>';
echo '<div class="imageLinks">';
echo '<div class="imageType"><strong>Small (~200px)</strong></div>';
echo '<div class="imageDirectLink"><strong>Direct Image:</strong> <span><a href="http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-s.' . $extension . '">http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-s.' . $extension . '</a></span></div>';
echo '<div class="imageEmbed"><strong>Forum Embed:</strong> <span>[img]http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-s.' . $extension . '[/img]</span></div>';
echo '<div class="imageType"><strong>Medium (~600px)</strong></div>';
echo '<div class="imageDirectLink"><strong>Direct Image:</strong> <span><a href="http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-m.' . $extension . '">http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-m.' . $extension . '</a></span></div>';
echo '<div class="imageEmbed"><strong>Forum Embed:</strong> <span>[img]http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-m.' . $extension . '[/img]</span></div>';
echo '<div class="imageType"><strong>Large (~1200px)</strong></div>';
echo '<div class="imageDirectLink"><strong>Direct Image:</strong> <span><a href="http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-l.' . $extension . '">http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-l.' . $extension . '</a></span></div>';
echo '<div class="imageEmbed"><strong>Forum Embed:</strong> <span>[img]http://www.roadraceautox.com/img/' . $directory . '/' . $filename . '-l.' . $extension . '[/img]</span></div>';
echo '<div class="imageType"><strong>Original (~2000px)</strong></div>';
echo '<div class="imageDirectLink"><strong>Direct Image:</strong> <span><a href="http://www.roadraceautox.com/img/' . $target_file . '">http://www.roadraceautox.com/img/' . $target_file . '</a></span></div>';
echo '<div class="imageEmbed"><strong>Forum Embed:</strong> <span>[img]http://www.roadraceautox.com/img/' . $target_file . '[/img]</span></div>';
echo '</div>';
}
?>
</div>
</div>
</body>
</html>