2015-05-05 03:00:01 +02:00
|
|
|
<?php defined('BLUDIT') or die('Bludit CMS.');
|
2015-03-08 18:02:59 +01:00
|
|
|
|
2016-01-12 03:18:20 +01:00
|
|
|
class Post extends Content {
|
|
|
|
|
2015-06-30 05:23:29 +02:00
|
|
|
function __construct($key)
|
2015-03-08 18:02:59 +01:00
|
|
|
{
|
2015-06-30 05:23:29 +02:00
|
|
|
// Database Key
|
|
|
|
$this->setField('key', $key);
|
2015-03-08 18:02:59 +01:00
|
|
|
|
2016-01-12 03:18:20 +01:00
|
|
|
// Set filterType
|
|
|
|
$this->setField('filterType', 'post');
|
2015-06-28 01:28:22 +02:00
|
|
|
|
2016-01-12 03:18:20 +01:00
|
|
|
parent::__construct(PATH_POSTS.$key.DS);
|
2015-03-08 18:02:59 +01:00
|
|
|
}
|
|
|
|
|
2016-05-30 02:50:48 +02:00
|
|
|
// Returns the post slug
|
2016-01-12 03:18:20 +01:00
|
|
|
public function slug()
|
2015-07-07 03:05:17 +02:00
|
|
|
{
|
2016-01-12 03:18:20 +01:00
|
|
|
return $this->getField('key');
|
2015-08-26 05:42:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Returns TRUE if the post is scheduled, FALSE otherwise.
|
|
|
|
public function scheduled()
|
|
|
|
{
|
2015-09-02 02:42:21 +02:00
|
|
|
return ($this->getField('status')==='scheduled');
|
2015-07-07 03:05:17 +02:00
|
|
|
}
|
2016-05-29 19:21:11 +02:00
|
|
|
|
2016-01-12 03:18:20 +01:00
|
|
|
}
|