mirror of
https://github.com/pikami/palm-paste.git
synced 2025-12-20 01:09:48 +00:00
Users now have the ability to delete their own pastes
This commit is contained in:
11
MyPastes.php
11
MyPastes.php
@@ -19,12 +19,16 @@ if($stmt->rowCount()>0){
|
||||
printf('<thead><th data-dynatable-column="name" style="text-align: left;">Title</th>
|
||||
<th style="text-align: left;">Added</th>
|
||||
<th style="text-align: left;">Expires</th>
|
||||
<th style="text-align: left;">ID</th></thead>');
|
||||
<th style="text-align: left;">ID</th>
|
||||
<th style="text-align: left;">Actions</th></thead>');
|
||||
printf('<tbody>');
|
||||
while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$title = $row['title'];
|
||||
//Paste title
|
||||
printf('<tr><td style="text-align: left;">'.htmlspecialchars($row["title"], ENT_QUOTES, 'UTF-8').'</td>');
|
||||
//Creation date
|
||||
printf('<td style="text-align: left;">'.date('Y-m-d',$row["created"]).'</td>');
|
||||
//Expire date
|
||||
if($row["expire"]==0) printf('<td style="text-align: left;">Never</td>');
|
||||
else{
|
||||
$expire = ($row["expire"]-time())/3600;
|
||||
@@ -34,7 +38,10 @@ if($stmt->rowCount()>0){
|
||||
printf('<td style="text-align: left;">'.round($expire).' hours from now</td>');
|
||||
else printf('<td style="text-align: left;">'.round($expire*60).' minutes from now</td>');
|
||||
}
|
||||
printf('<td style="text-align: right;"><a href="'.htmlspecialchars($row["uid"], ENT_QUOTES, 'UTF-8').'">'.htmlspecialchars($row["uid"], ENT_QUOTES, 'UTF-8').'</a></td></tr>');
|
||||
//Paste url
|
||||
printf('<td style="text-align: right;"><a href="'.htmlspecialchars($row["uid"], ENT_QUOTES, 'UTF-8').'">'.htmlspecialchars($row["uid"], ENT_QUOTES, 'UTF-8').'</a></td>');
|
||||
//Actions
|
||||
printf('<td style="text-align: right;"><a href="delete/'.htmlspecialchars($row["uid"], ENT_QUOTES, 'UTF-8').'"><span class="glyphicon glyphicon-trash" aria-hidden="true"></span></s></td></tr>');
|
||||
}
|
||||
printf('</tbody></talbe>');
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user