if ($context['SPortal']['core_compat'])
template_boardnews($return, $per_page, $page_index, $avatars);
return;
if ($context['SPortal']['core_compat'])
The code below needs to be added to the end of the "Portal.template.php" file (before the "?>") for every theme that has one (probably just the curve theme and your custom theme), otherwise you will get a fatal error for the theme that doesn't have this code (when you view the portal). You can then edit the template as required for a specific theme, you may also want to edit the portal.css file.
function template_boardnews($data, $per_page, $page_index, $avatars)
{
global $context, $txt;
if ($context['SPortal']['core_compat'])
{
foreach ($data as $news)
{
echo '
<div class="tborder">
<table class="sp_block">
<tr class="catbg">
<td class="sp_middle">', $news['icon'], '</td>
<td class="sp_middle sp_regular_padding sp_fullwidth"><a href="', $news['href'], '" >', $news['subject'], '</a> | ', $news['timeyear'], '</td>
</tr>
<tr class="windowbg">
<td class="sp_regular_padding" colspan="2">';
if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" style="float: right;" />
<div class="middletext">', $news['timeday'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['timeday'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
echo '
<div class="post"><hr />', $news['body'], '<br /><br /></div>
</td>
</tr>
<tr>
<td class="windowbg2" colspan="2">
<div class="sp_right sp_regular_padding">', $news['link'], ' ', $news['new_comment'], '</div>
</td>
</tr>
</table>
</div>
<br />';
}
}
else
{
foreach ($data as $news)
{
echo '
<h3 class="catbg"><span class="left"></span>
<span class="sp_float_left sp_article_icon">', $news['icon'], '</span><a href="', $news['href'], '" >', $news['subject'], '</a> | ', $news['timeyear'], '
</h3>
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="sp_content_padding">';
if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
echo '
<img src="', $news['avatar']['href'], '" alt="', $news['poster']['name'], '" width="30" class="sp_float_right" />
<div class="middletext">', $news['timeday'], ' ', $txt['by'], ' ', $news['poster']['link'], '<br />', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
else
echo '
<div class="middletext">', $news['timeday'], ' ', $txt['by'], ' ', $news['poster']['link'], ' | ', $txt['sp-articlesViews'], ': ', $news['views'], ' | ', $txt['sp-articlesComments'], ': ', $news['replies'], '</div>';
echo '
<div class="post"><hr />', $news['body'], '</div>
<div class="sp_right">', $news['link'], ' ', $news['new_comment'], '</div>
</div>
<span class="botslice"><span></span></span>
</div>
<br />';
}
}
if (!empty($per_page))
echo '
<div class="sp_page_index">', $txt['sp-articlesPages'], ': ', $page_index, '</div>';
echo '
<br />';
}