X-Git-Url: https://git.bts.cx/cx.git/blobdiff_plain/a33491c3a25cf858b67f279c10d93e0eb863ad92..HEAD:/cx/lib/posts.php 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 .= ';';