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;
|
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)
|
public static function timeago($time)
|
||||||
{
|
{
|
||||||
$time = time() - $time;
|
$time = time() - $time;
|
||||||
|
|
|
@ -296,6 +296,7 @@ class Page {
|
||||||
$tmp['contentRaw'] = $this->contentRaw(); // No Markdown parsed
|
$tmp['contentRaw'] = $this->contentRaw(); // No Markdown parsed
|
||||||
$tmp['description'] = $this->description();
|
$tmp['description'] = $this->description();
|
||||||
$tmp['date'] = $this->dateRaw();
|
$tmp['date'] = $this->dateRaw();
|
||||||
|
$tmp['dateUTC'] = Date::convertToUTC($this->dateRaw(), DB_DATE_FORMAT, DB_DATE_FORMAT);
|
||||||
$tmp['permalink'] = $this->permalink(true);
|
$tmp['permalink'] = $this->permalink(true);
|
||||||
|
|
||||||
if($returnsArray) {
|
if($returnsArray) {
|
||||||
|
|
|
@ -155,12 +155,12 @@ class Url
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNotFound()
|
public function setNotFound($notFound=true, $httpCode=404, $httpMessage='Not Found')
|
||||||
{
|
{
|
||||||
$this->setWhereAmI('page');
|
$this->setWhereAmI('page');
|
||||||
$this->notFound = true;
|
$this->notFound = $notFound;
|
||||||
$this->httpCode = 404;
|
$this->httpCode = $httpCode;
|
||||||
$this->httpMessage = 'Not Found';
|
$this->httpMessage = $httpMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function httpCode()
|
public function httpCode()
|
||||||
|
|
Loading…
Reference in New Issue