mirror of
https://github.com/pikami/palm-paste.git
synced 2024-11-28 06:35:43 +00:00
16 lines
615 B
PHP
16 lines
615 B
PHP
<div class="panel panel-default">
|
|
<div class="panel-body">
|
|
<h4>Newest pastes:</h4>
|
|
<div class="list-group">
|
|
<?php
|
|
include "config/config.php";
|
|
$stmt = $conn->query('SELECT * FROM pastes WHERE exposure=0 ORDER BY id DESC LIMIT 5');
|
|
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
|
$title = htmlspecialchars($row['title'], ENT_QUOTES, 'UTF-8');
|
|
if(strlen($title)>25)$title = substr($title,0,25)."...";
|
|
echo "<a href=\"".htmlspecialchars($row['uid'], ENT_QUOTES, 'UTF-8')."\" class=\"list-group-item\">".$title."</a>";
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</div>
|