{
global $monthname;
return implode(' ', array_filter([
- intval(@$parts[3]), $parts[2] > 0 ? $monthname[intval($parts[2])] : '', $parts[1],
- count($parts) > 6 ? "$parts[4]:$parts[5]" : '',
+ intval(@$parts[2]), $parts[1] > 0 ? $monthname[intval($parts[1])] : '', $parts[0],
+ count($parts) > 5 ? "$parts[3]:$parts[4]" : '',
]));
}
function dateparts()
{
preg_match('< / (\d{4}) [/-] (\d{2}) (?:- (\d{2}) )? - >x', $this->page, $ymd);
+ array_shift($ymd);
return $ymd;
}
function dateiso()
{
- return implode('-', $this->dateparts());
+ return implode('-', $this->dateparts()) . 'T12:00:00+02:00';
}
function date()
function thumb($size = '300x')
{
if (!$this->image or $this->image[0] !== '/') return;
- return preg_replace('{^(?:/thumb/[^/]*)?}', "thumb/$size", $this->image);
+ return preg_replace(
+ ['{^(?:/thumb/[^/]*)?}', '/\.groot(?=\.\w+$)/'], ["thumb/$size", ''],
+ $this->image
+ );
}
}
$html = $article->safetitle;
$dateparts = $article->dateparts;
if ($class) {
- $dateparts[1] = NULL; # omit year
+ $dateparts[0] = NULL; # omit year
}
$html .= sprintf(' <small class="date">%s</small>', showdate($dateparts));
if ($class == 'gallery' and $article->img) {