-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpaste.php
More file actions
62 lines (53 loc) · 2.4 KB
/
paste.php
File metadata and controls
62 lines (53 loc) · 2.4 KB
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
<?php
require "./include/autoload.php";
if(!isset($_GET['id']) || empty($_GET['id'])){
header("Location: " . getLink("/"));
exit;
}
$paste = getPaste($_GET['id']);
if(!$paste){
header("Location: " . getLink("/"));
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paste - <?= $paste['paste_title']; ?></title>
<link rel="stylesheet" href="<?= getRawLink("/styles/main.min.css") ?>">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/monokai-sublime.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/highlightjs-line-numbers.js/2.8.0/highlightjs-line-numbers.min.js"></script>
</head>
<body>
<?php require "./include/views/nav.php"; ?>
<div class="container">
<center>
<h1 class="page-title"><?= $paste['paste_title']; ?></h1>
<p class="page-overview">Store large code & text online and share with the world.</p>
</center>
<div class="paste-wrap">
<div class="paste-head">
<div class="paste-action">
<a href="<?= getLink("/raw")."?id=".$paste['paste_id'] ?>">
<button class="alt" name="button" type="submit">Raw</button>
</a>
<a href="<?= getLink("/") ?>">
<button name="button" type="submit">New Paste</button>
</a>
</div>
</div>
<?php if($paste['paste_syntax'] === "text"): ?>
<textarea name="content" readonly><?= $paste['paste_content']; ?></textarea>
<?php else: ?>
<pre><code class="language-<?= $paste['paste_syntax']; ?>"><?= htmlspecialchars($paste['paste_content']); ?></code></pre>
<?php endif; ?>
</div>
</div>
<?php require "./include/views/footer.php"; ?>
<script src="<?= getRawLink("/js/main.js") ?>"></script>
<script>hljs.highlightAll();hljs.initLineNumbersOnLoad();</script>
</body>
</html>