X-Git-Url: https://git.bts.cx/cx.git/blobdiff_plain/af380ed734795855fb40fbb311c3a85d052d3a83..refs/heads/mainline:/cx/lib/posts.php?ds=sidebyside diff --git a/cx/lib/posts.php b/cx/lib/posts.php index 988d00e..7b13166 100644 --- a/cx/lib/posts.php +++ b/cx/lib/posts.php @@ -127,7 +127,7 @@ function cx_posts_delete_post($post_id) { cx_db_exec($sql, $post_id); } -function cx_posts_get(int $limit = 0, bool $include_drafts = false) { +function cx_posts_get(int $limit = 0, int $offset = 0, bool $include_drafts = false) { $sql = 'SELECT post_id, post_slug, @@ -147,6 +147,10 @@ function cx_posts_get(int $limit = 0, bool $include_drafts = false) { if ($limit > 0) { $sql .= ' LIMIT ' . $limit; } + + if ($offset > 0) { + $sql .= ' OFFSET ' . $offset; + } $sql .= ';';