fix pager and dates

This commit is contained in:
biglyderv 2024-12-11 01:54:38 -05:00
parent e53df98880
commit 1f56e6df3c
2 changed files with 18 additions and 5 deletions

View file

@ -70,7 +70,6 @@ pre {
.avatar {
display: flex;
width: 200px;
align-items: center;
margin-bottom: 5px;
}

View file

@ -13,13 +13,27 @@
array('key' => 'Attachments', 'type' => 'file', 'name' => 'file', 'default' => '')
),'/index.php');
}
$qs = parse_url($_SERVER['REQUEST_URI']);
if (is_null($qs)) $qs = array('query' => '?');
$qsq = $qs['query'];
$qss = array();
parse_str($qsq,$qss);
$qss['page'] = $page + 1;
$qs_next = http_build_query($qss);
$qss['page'] = $page - 1;
$qs_prev = http_build_query($qss);
?>
<div>
<?php if ($page > 0) { ?>
<a class="form-button" href="?id=<?php echo htmlspecialchars($_GET['id'])?>&page=<?php echo $page - 1 ?>">Previous</a>
<a class="form-button" href="?<?php echo $qs_prev ?>">Previous</a>
<?php } ?>
<a class="form-button" href="?id=<?php echo htmlspecialchars($_GET['id'])?>&page=<?php echo $page + 1 ?>">Next</a>
<a class="form-button" href="?<?php echo $qs_next ?>">Next</a>
</div>
<?php
@ -44,7 +58,7 @@
</a>
</b></div>
<div><b>
<?php echo date(DATE_ATOM,$post['date'] + $ref) ?>
<?php echo date(DATE_RFC2822,$post['date'] + $ref) ?>
</b></div>
</div>
</div>