diff --git a/partials/pagnation.php b/partials/pagnation.php
index b61b256..f6f675c 100644
--- a/partials/pagnation.php
+++ b/partials/pagnation.php
@@ -1,83 +1,52 @@
= $totalTwts ) {
- //echo "Only " . $totalTwts . " so no need for pagnation. (max: ". $twts_per_page . ")
";
+if ( ($maxTwts >= $totalTwts) || ($paginateTwts == false) ) {
+ // echo "Only " . $totalTwts . " so no need for pagnation. (max: ". $maxTwts . ")
";
$paginateTwts = false;
-} else {
- //echo "Over " . $twts_per_page . " so pagnation is needed.
";
- $paginateTwts = true;
-}
-
-$page = 1;
-if (!empty($_GET['page'])) {
- $page = intval($_GET['page']);
-}
-
-// If we should paginate our twts list
-if (!empty($paginateTwts)) {
- $startingTwt = (($page - 1) * TWTS_PER_PAGE);
- $twts = array_slice($twts, $startingTwt, TWTS_PER_PAGE);
-}
-
-# Approach 2: Ignore invalid page numbers, and adjust the number between 1 and the last page
-$currentPage = max(1, min($_GET["page"], $totalPages));
-
-# And then in the HTML template only show the next page link if we are NOT on the last one
-if ($currentPage < $totalPages) {
- $output .= '> Next Page';
-}
-
-$totalTwts = count($twts);
-//echo "pagnation twts: " . $totalTwts;
-
-$totalPages = ceil($totalTwts / $twts_per_page);
-//echo "
total pages: " . $totalPages;
-
-$page_url = $_SERVER['REQUEST_URI'];
-//echo $page_url."
";
-
-if (!empty($_GET['page'])) {
-
- if (preg_match('/\?page=/', $page_url)) {
- //echo "cotains ?page= so reuse that
";
- $page_url = preg_replace('/\?page=\d*/', "", $page_url) . '?page=';
- }
-
- if (preg_match('/&page=/', $page_url)) {
- //echo "cotains &page= so reuse that
";
- $page_url = preg_replace('/&page=\d*/', "", $page_url) . '&page=';
- }
} else {
+ // echo "Over " . $maxTwts . " so pagnation is needed.
";
+ $paginateTwts = true; // for showing pagnation navigation below timeline
- if (!preg_match('/(\?|&)/', $page_url)) {
- //echo "No param, so use ?page
";
- $page_url = $page_url . '?page=';
+ $totalPages = ceil($totalTwts / $maxTwts);
+
+ $currentPage = max(1, min($_GET["page"], $totalPages));
+
+ // Split up twts into pages
+ $startingTwt = (($currentPage - 1) * $maxTwts);
+ $twts = array_slice($twts, $startingTwt, $maxTwts);
+
+ // Fingure out base URL for prev/next links
+ $pageURL = $_SERVER['REQUEST_URI'];
+ //echo $pageURL."
";
+
+ if (!empty($_GET['page'])) {
+
+ if (preg_match('/\?page=/', $pageURL)) {
+ //echo "cotains ?page= so reuse that
";
+ $pageURL = preg_replace('/\?page=\d*/', "", $pageURL) . '?page=';
+ }
+
+ if (preg_match('/&page=/', $pageURL)) {
+ //echo "cotains &page= so reuse that
";
+ $pageURL = preg_replace('/&page=\d*/', "", $pageURL) . '&page=';
+ }
+
+ } else {
+
+ if (!preg_match('/(\?|&)/', $pageURL)) {
+ //echo "No param, so use ?page
";
+ $pageURL = $pageURL . '?page=';
+ }
+
+ if (!preg_match('/(\?|&)page/', $pageURL)) {
+ //echo "other param than _page, so use &page
";
+ $pageURL = $pageURL . '&page=';
+ }
}
-
- if (!preg_match('/(\?|&)page/', $page_url)) {
- //echo "other param than _page, so use &page
";
- $page_url = $page_url . '&page=';
- }
-}
-?>
+}
diff --git a/partials/timeline.php b/partials/timeline.php
index cd4789e..9aeb0fd 100644
--- a/partials/timeline.php
+++ b/partials/timeline.php
@@ -6,7 +6,6 @@
-->
-
- 1) { ?>
-
Previous
+ 1) { ?>
+
Previous
Previous
-
= $page ?>
-
Next
+
= $currentPage /* . " / " . $totalPages */ ?>
+
+
Next
+
+
Next
+
-
+
Comment via email';
+if (!hasValidSession() && isset($config['email']) ) {
+ echo 'Reply via email';
}
\ No newline at end of file
diff --git a/views/profile.php b/views/profile.php
index 915347c..59d269c 100644
--- a/views/profile.php
+++ b/views/profile.php
@@ -1,6 +1,6 @@