set not found parameters, and changes on date class
This commit is contained in:
parent
e162c03392
commit
981dc9ffb4
@ -35,6 +35,13 @@ class Date {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static function convertToUTC($date, $currentFormat, $outputFormat)
|
||||
{
|
||||
$Date = DateTime::createFromFormat($currentFormat, $date);
|
||||
$Date->setTimezone(new DateTimeZone('UTC'));
|
||||
return $Date->format($outputFormat);
|
||||
}
|
||||
|
||||
public static function timeago($time)
|
||||
{
|
||||
$time = time() - $time;
|
||||
|
@ -296,6 +296,7 @@ class Page {
|
||||
$tmp['contentRaw'] = $this->contentRaw(); // No Markdown parsed
|
||||
$tmp['description'] = $this->description();
|
||||
$tmp['date'] = $this->dateRaw();
|
||||
$tmp['dateUTC'] = Date::convertToUTC($this->dateRaw(), DB_DATE_FORMAT, DB_DATE_FORMAT);
|
||||
$tmp['permalink'] = $this->permalink(true);
|
||||
|
||||
if($returnsArray) {
|
||||
|
@ -155,12 +155,12 @@ class Url
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function setNotFound()
|
||||
public function setNotFound($notFound=true, $httpCode=404, $httpMessage='Not Found')
|
||||
{
|
||||
$this->setWhereAmI('page');
|
||||
$this->notFound = true;
|
||||
$this->httpCode = 404;
|
||||
$this->httpMessage = 'Not Found';
|
||||
$this->notFound = $notFound;
|
||||
$this->httpCode = $httpCode;
|
||||
$this->httpMessage = $httpMessage;
|
||||
}
|
||||
|
||||
public function httpCode()
|
||||
|
Loading…
Reference in New Issue
Block a user