]> git.bts.cx Git - cx.git/blobdiff - cx/lib/url.php
Centralise permalink generation
[cx.git] / cx / lib / url.php
index 1ace5393017db3a523cd2bd892d99416a4faa16c..0bcef4c30ed48db3c755d7f9a30c9a81da679a0a 100644 (file)
@@ -13,3 +13,12 @@ function cx_url_admin($path) {
 function cx_url_site($path) {
        return cx_site_url() . cx_url($path);
 }
 function cx_url_site($path) {
        return cx_site_url() . cx_url($path);
 }
+
+function cx_url_page($number, $delta = 0) {
+       $next_number = $number + $delta;
+       if ($next_number <= 0) {
+               return cx_url_site('/');
+       } else {
+               return cx_url_site('/page/' . $next_number );
+       }
+}