mirror of
https://github.com/sorenpeter/timeline.git
synced 2025-12-17 03:46:59 +00:00
Merge branch 'main' into 34-different-time-zone-is-being-used-in-new-twts-and-in-replies
This commit is contained in:
commit
cc1073b760
2 changed files with 51 additions and 0 deletions
|
|
@ -142,6 +142,7 @@ if (!empty($_GET['hash'])) {
|
||||||
$twts = array_reverse($twts, true);
|
$twts = array_reverse($twts, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pagnation
|
||||||
$page = 1;
|
$page = 1;
|
||||||
if (!empty($_GET['page'])) {
|
if (!empty($_GET['page'])) {
|
||||||
$page = intval($_GET['page']);
|
$page = intval($_GET['page']);
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,56 @@
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<?php }
|
<?php }
|
||||||
|
|
||||||
|
// Pagnation
|
||||||
|
/*
|
||||||
|
|
||||||
|
TODO: Merge with code in base.php / make new pagnation.php
|
||||||
|
TODO: Make pagnation work with profile views
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
$page_url = $_SERVER['REQUEST_URI'];
|
||||||
|
//echo $page_url."<hr>";
|
||||||
|
|
||||||
|
if (!empty($_GET['page'])) {
|
||||||
|
|
||||||
|
if (preg_match('/\?page=/', $page_url)) {
|
||||||
|
//echo "cotains ?page= so reuse that<hr>";
|
||||||
|
$page_url = preg_replace('/\?page=\d*/', "", $page_url) . '?page=';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/&page=/', $page_url)) {
|
||||||
|
echo "cotains &page= so reuse that<hr>";
|
||||||
|
$page_url = preg_replace('/&page=\d*/', "", $page_url) . '&page=';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (!preg_match('/(\?|&)/', $page_url)) {
|
||||||
|
//echo "No param, so use ?page<hr>";
|
||||||
|
$page_url = $page_url . '?page=';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!preg_match('/(\?|&)page/', $page_url)) {
|
||||||
|
//echo "other param than _page, so use &page<hr>";
|
||||||
|
$page_url = $page_url . '&page=';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<center><p>
|
||||||
|
<?php if ($page > 1) { ?>
|
||||||
|
<a href="<?= $page_url . $page-1 ?>">Prev</a>
|
||||||
|
<?php } else { ?>
|
||||||
|
<span style="color: var(--disabled);">Prev</span>
|
||||||
|
<?php } ?>
|
||||||
|
<strong> <?= $page ?> </strong>
|
||||||
|
<a href="<?= $page_url . $page+1 ?>">Next</a>
|
||||||
|
</p></center>
|
||||||
|
|
||||||
|
<?php
|
||||||
require_once 'libs/session.php';
|
require_once 'libs/session.php';
|
||||||
|
|
||||||
if (!hasValidSession()) {
|
if (!hasValidSession()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue