Yo, Bloc.
I gave a quick look at one of the files, TPortalBlocks.template.php, and found something that could be optimized a bit. I didn't check the other functions, but will later if you want.
It's about the TPortal_leftbar() and TPortal_rightbar() functions. They are the same, except for the side, so I put them together in one. Just specify left/right in the call.
I didn't test it, though, so I leave that to you. HIH.
// TPortal side bar, left or right.
function TPortal_sideBar($side)
{
global $context;
foreach ($context['TPortal'][$side . 'block']['blocks'] as $block)
{
$theme = $block['frame'] == 'theme';
echo '<div', ($theme ? ' class="tborder"' : ''), ' style="margin-bottom: 5px;">';
if ($theme || $block['frame'] == 'title')
echo '<div class="titlebg" style="padding: 4px; font-weight: bold;">', $block['title'], '</div>';
echo '<div', ($theme ? ' class="windowbg"' : ''), ' style="padding: 4px;">';
$func = 'TPortal_' . $block['type'];
if (function_exists($func))
$func();
else
echo doUBBC($block['body']);
echo '</div></div>';
}
}