mirror of
https://github.com/pikami/palm-paste.git
synced 2024-11-24 20:55:42 +00:00
Added newest pastes panel
This commit is contained in:
parent
8dfcd52e7e
commit
0c79aa1cb0
@ -1,11 +1,11 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-9">
|
||||||
<?php include "NewPastePanel.php"; ?>
|
<?php include "NewPastePanel.php"; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6" style="background-color:pink;">
|
<div class="col-sm-3">
|
||||||
<p>Placeholder</p>
|
<?php include "NewestPastes.php"; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
16
NewestPastes.php
Normal file
16
NewestPastes.php
Normal file
@ -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
Block a user