Commit 389a20ab authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

Fixed dates in recent blog entries blocktype. Fixes bug #1856.

parent 00c3d6a6
...@@ -48,7 +48,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype { ...@@ -48,7 +48,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
if (!empty($configdata['artefactids'])) { if (!empty($configdata['artefactids'])) {
$artefactids = implode(', ', array_map('db_quote', $configdata['artefactids'])); $artefactids = implode(', ', array_map('db_quote', $configdata['artefactids']));
if (!$mostrecent = get_records_sql_array( if (!$mostrecent = get_records_sql_array(
'SELECT a.title, a.ctime, p.title AS parenttitle, a.id, a.parent 'SELECT a.title, ' . db_format_tsfield('a.ctime', 'ctime') . ', p.title AS parenttitle, a.id, a.parent
FROM {artefact} a FROM {artefact} a
JOIN {artefact} p ON a.parent = p.id JOIN {artefact} p ON a.parent = p.id
WHERE a.artefacttype = \'blogpost\' WHERE a.artefacttype = \'blogpost\'
...@@ -60,7 +60,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype { ...@@ -60,7 +60,7 @@ class PluginBlocktypeRecentposts extends PluginBlocktype {
} }
// format the dates // format the dates
foreach ($mostrecent as &$data) { foreach ($mostrecent as &$data) {
$data->displaydate = format_date(time($data->ctime)); $data->displaydate = format_date($data->ctime);
} }
$smarty = smarty_core(); $smarty = smarty_core();
$smarty->assign('mostrecent', $mostrecent); $smarty->assign('mostrecent', $mostrecent);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment