commit 2d9d7ef3118744c37acbdf07454d5e935c8839c9
parent c04c976595bd89938983c1d926426bb3979bd435
Author: markseu <mark2011@mayberg.se>
Date: Sat, 29 Jul 2017 11:14:34 +0200
System update (custom date for Steffen)
Diffstat:
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/system/plugins/core.php b/system/plugins/core.php
@@ -706,11 +706,11 @@ class YellowPage
}
// Return page meta data as language specific date
- function getDate($key, $dateFormat = "")
+ function getDate($key, $format = "")
{
- if(!empty($dateFormat))
+ if(!empty($format))
{
- $format = $this->yellow->text->get($dateFormat);
+ $format = $this->yellow->text->get($format);
} else {
$format = $this->yellow->text->get("dateFormatMedium");
}
@@ -718,11 +718,23 @@ class YellowPage
}
// Return page meta data as language specific date, HTML encoded
- function getDateHtml($key, $dateFormat = "")
+ function getDateHtml($key, $format = "")
{
- return htmlspecialchars($this->getDate($key, $dateFormat));
+ return htmlspecialchars($this->getDate($key, $format));
+ }
+
+ // Return page meta data as custom date
+ function getDateFormatted($key, $format)
+ {
+ return $this->yellow->text->getDateFormatted(strtotime($this->get($key)), $format);
}
+ // Return page meta data as custom date, HTML encoded
+ function getDateFormattedHtml($key, $format)
+ {
+ return htmlspecialchars($this->getDateFormatted($key, $format));
+ }
+
// Return page content, HTML encoded or raw format
function getContent($rawFormat = false, $sizeMax = 0)
{
@@ -2047,7 +2059,7 @@ class YellowText
return $text;
}
- // Return human readable date, custom date format
+ // Return human readable date, custom date
function getDateFormatted($timestamp, $format)
{
$dateMonths = preg_split("/\s*,\s*/", $this->get("dateMonths"));