2016-06-09 18:03:23 +01:00
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
|
|
|
<h4>Newest pastes:</h4>
|
|
|
|
<div class="list-group">
|
|
|
|
<?php
|
2016-06-16 16:33:16 +01:00
|
|
|
include_once "config/config.php";
|
|
|
|
$conn = GetConnectionToDB();
|
2016-06-12 16:32:25 +01:00
|
|
|
$stmt = $conn->query('SELECT * FROM pastes WHERE exposure=0 ORDER BY id DESC LIMIT 5');
|
2016-06-09 18:03:23 +01:00
|
|
|
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
2016-06-13 13:49:13 +01:00
|
|
|
$title = htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8');
|
2016-06-09 18:03:23 +01:00
|
|
|
if(strlen($title)>25)$title = substr($title,0,25)."...";
|
2016-06-13 13:49:13 +01:00
|
|
|
echo "<a href=\"".htmlspecialchars($row['uid'], ENT_QUOTES, 'UTF-8')."\" class=\"list-group-item\">".$title."</a>";
|
2016-06-09 18:03:23 +01:00
|
|
|
}
|
2016-06-16 16:33:16 +01:00
|
|
|
$conn = null;
|
2016-06-09 18:03:23 +01:00
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|