diff options
Diffstat (limited to 'htdocs/src/PostIterator.inc.php')
-rw-r--r-- | htdocs/src/PostIterator.inc.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/htdocs/src/PostIterator.inc.php b/htdocs/src/PostIterator.inc.php index 43c1a05..a269853 100644 --- a/htdocs/src/PostIterator.inc.php +++ b/htdocs/src/PostIterator.inc.php @@ -37,6 +37,16 @@ class PostIterator implements Iterator { $this->where[] = "category_id='$category_id'"; } + public function filterCreated($after, $before = false) { + $sqlafter = date('Y-m-d H:i:s', $after); + $this->where[] = "created > '$sqlafter'"; + + if ($before !== false) { + $sqlbefore = date('Y-m-d H:i:s', $before); + $this->where[] = "created < '$sqlbefore'"; + } + } + public function orderBy($order) { $this->order = $order; } |