2017-04-02 12:49:39 +01:00
|
|
|
<div class="container">
|
2016-06-12 16:32:25 +01:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
2016-06-09 10:02:09 +01:00
|
|
|
<?php
|
2016-06-11 17:32:49 +01:00
|
|
|
if(isset($uid)){
|
2016-06-16 16:33:16 +01:00
|
|
|
include_once "config/config.php";
|
2016-06-12 16:32:25 +01:00
|
|
|
include_once "includes/user.php";
|
2016-06-16 16:33:16 +01:00
|
|
|
$conn = GetConnectionToDB();
|
2016-06-11 17:32:49 +01:00
|
|
|
$stmt = $conn->query('SELECT * FROM pastes WHERE uid="'.$uid.'"');
|
|
|
|
if($result = $stmt->fetch(PDO::FETCH_ASSOC)){
|
2016-06-12 16:32:25 +01:00
|
|
|
$conn = null;
|
2016-06-16 15:37:18 +01:00
|
|
|
if($result["expire"]!=0 && $result["expire"]<time()){
|
2016-06-16 15:34:00 +01:00
|
|
|
//This paste is expired but not removed
|
2016-06-16 16:33:16 +01:00
|
|
|
echo "<h1>This paste just expired</h1>";
|
|
|
|
include_once "cronjob.php";
|
2016-06-16 15:34:00 +01:00
|
|
|
RemoveExpiredPastes();
|
|
|
|
die();
|
|
|
|
}
|
2016-06-16 16:33:16 +01:00
|
|
|
if($result["exposure"]==2 && $result["owner"]!=0 && isset($_COOKIE["pp_sid"]) && isset($_COOKIE["pp_skey"]) && $result["owner"]!=GetUsersIDBySession($_COOKIE["pp_sid"],$_COOKIE["pp_skey"])){
|
2016-06-12 16:32:25 +01:00
|
|
|
echo "<h1>This paste is private</h1>";
|
|
|
|
die();
|
|
|
|
}
|
2016-06-13 13:49:13 +01:00
|
|
|
echo "<h1>".htmlspecialchars($result["title"], ENT_QUOTES, 'UTF-8')."</h1>";
|
2016-06-15 17:05:42 +01:00
|
|
|
//
|
|
|
|
$owner = GetUserByID($result["owner"]);
|
|
|
|
echo "<h5>";
|
|
|
|
if($owner[1] == -1)
|
|
|
|
echo "Posted by: <b>Guest</b>";
|
2016-06-20 16:13:59 +01:00
|
|
|
else echo "Posted by: <b><a href=\"u/".htmlspecialchars($owner[1])."\">".htmlspecialchars($owner[1])."</a></b>";
|
2016-06-16 15:34:00 +01:00
|
|
|
echo ", at ".date('Y-m-d',$result["created"]).", it will expire <b>";
|
|
|
|
if($result["expire"]==0) printf('Never');
|
|
|
|
else{
|
|
|
|
$expire = ($result["expire"]-time())/3600;
|
|
|
|
if($expire>24){
|
|
|
|
printf(round($expire/24).' days from now');
|
|
|
|
} else if($expire>=1)
|
|
|
|
printf(round($expire).' hours from now');
|
|
|
|
else printf(round($expire*60).' minutes from now');
|
|
|
|
}
|
|
|
|
echo "</b></h5>";
|
2016-06-15 17:05:42 +01:00
|
|
|
//
|
2016-06-13 16:17:14 +01:00
|
|
|
echo "<pre class=\"brush: ".$_HL."\">";
|
|
|
|
echo htmlspecialchars($result["text"], ENT_QUOTES, 'UTF-8')."</pre><pb>";
|
2016-06-15 17:05:42 +01:00
|
|
|
echo "<label for=\"rawtext\">Raw text:</label>";
|
|
|
|
echo "<textarea id=\"rawtext\" class=\"form-control\" rows=\"10\">".htmlspecialchars($result["text"], ENT_QUOTES, 'UTF-8')."</textarea>";
|
2016-06-11 17:32:49 +01:00
|
|
|
}
|
|
|
|
else echo "Paste does not exist";
|
2016-06-12 16:32:25 +01:00
|
|
|
$conn = null;
|
2016-06-09 10:02:09 +01:00
|
|
|
} else echo "Error: id not set";
|
|
|
|
?>
|
2016-06-13 16:17:14 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
SyntaxHighlighter.all()
|
|
|
|
</script>
|
2016-06-12 16:32:25 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-06-09 10:02:09 +01:00
|
|
|
</div>
|