mirror of https://github.com/pikami/palm-paste.git
Added newest pastes panel
This commit is contained in:
parent
8dfcd52e7e
commit
0c79aa1cb0
|
@ -1,11 +1,11 @@
|
|||
<div class="container">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="col-sm-9">
|
||||
<?php include "NewPastePanel.php"; ?>
|
||||
</div>
|
||||
<div class="col-sm-6" style="background-color:pink;">
|
||||
<p>Placeholder</p>
|
||||
<div class="col-sm-3">
|
||||
<?php include "NewestPastes.php"; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
<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 ORDER BY id DESC LIMIT 5');
|
||||
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$title = $row['title'];
|
||||
if(strlen($title)>25)$title = substr($title,0,25)."...";
|
||||
echo "<a href=\"".$row['id']."\" class=\"list-group-item\">".$title."</a>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Loading…
Reference in New Issue