Post scheduler

This commit is contained in:
dignajar 2015-08-26 00:49:15 -03:00
parent 66bcaa33e3
commit 12fe1779af
2 changed files with 8 additions and 3 deletions

View File

@ -22,7 +22,7 @@ $_newPages = $dbPages->regenerate();
$_draftPosts = array(); $_draftPosts = array();
foreach($posts as $Post) foreach($posts as $Post)
{ {
if(!$Post->published()) { if($Post->draft()) {
array_push($_draftPosts, $Post); array_push($_draftPosts, $Post);
} }
} }
@ -34,4 +34,3 @@ foreach($pages as $Page)
array_push($_draftPages, $Page); array_push($_draftPages, $Page);
} }
} }

View File

@ -74,6 +74,12 @@ class Post extends fileContent
return ( ($this->getField('status')==='published') && ($this->getField('date')>$currentDate) ); return ( ($this->getField('status')==='published') && ($this->getField('date')>$currentDate) );
} }
// Returns TRUE if the post is draft, FALSE otherwise.
public function draft()
{
return ($this->getField('status')=='draft');
}
public function username() public function username()
{ {
return $this->getField('username'); return $this->getField('username');