I am getting undefined error(s) for $context['latest_post']['link'] and $context['latest_post']['time'].
<p class="inline">
', $context['common_stats']['boardindex_total_posts'], '', !empty($settings['show_latest_member']) ? ' - ' . $txt['latest_member'] . ': <strong> ' . $context['common_stats']['latest_member']['link'] . '</strong>' : '', ' - ', $txt['most_online_today'], ': ', comma_format($modSettings['mostOnlineToday']), '<br />
', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <strong>"' . $context['latest_post']['link'] . '"</strong> ( ' . $context['latest_post']['time'] . ' )' : ''), ' - <a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>
</p>
I can find $context['latest_post'] but how $context['latest_post']['link'] and $context['latest_post']['time'] are defined?
$context['latest_post'] is defined:
// Retrieve the categories and boards.
require_once(SUBSDIR . '/BoardsList.class.php');
$boardIndexOptions = array(
'include_categories' => true,
'base_level' => 0,
'parent_id' => 0,
'set_latest_post' => true,
'countChildPosts' => !empty($modSettings['countChildPosts']),
);
$boardlist = new Boards_List($boardIndexOptions);
$context['categories'] = $boardlist->getBoards();
$context['latest_post'] = $boardlist->getLatestPost();
Any heads up?
My temporary solution is checking whether those $context['latest_post']['link'] and $context['latest_post']['time'] are empty instead.
', (!empty($context['latest_post']['link']) && !empty($context['latest_post']['time']) ? $txt['latest_post'] . ': <strong>"' . $context['latest_post']['link'] . '"</strong> ( ' . $context['latest_post']['time'] . ' )' : ''), ' - <a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>
Should this be fine?