I think that I figured it out.....
I made no changes to the recent.php from the sources directory, but I did change the code in the recent.template.php (from the Core theme, the next step is to try it on the other themes that have a recent.template.php file).
I isolated the following code from the template_unread function
foreach ($context['topics'] as $topic)
{
// Calculate the color class of the topic.
$color_class = '';
if (strpos($topic['class'], 'sticky') !== false)
$color_class = 'stickybg';
if (strpos($topic['class'], 'locked') !== false)
$color_class .= 'lockedbg';
$color_class2 = !empty($color_class) ? $color_class . '2' : '';
echo '
<tr>
<td class="', $color_class, ' icon1 windowbg">
<img src="', $settings['images_url'], '/topic/', $topic['class'], '.gif" alt="" />
</td>
<td class="', $color_class, ' icon2 windowbg">
<img src="', $topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="subject ', $color_class2, ' windowbg2">
<div>
', $topic['is_sticky'] ? '<strong>' : '', '<span id="msg_' . $topic['first_post']['id'] . '">', $topic['first_post']['link'], '</span>', $topic['is_sticky'] ? '</strong>' : '' ,'
<a href="', $topic['new_href'], '" id="newicon', $topic['first_post']['id'], '"><img src="', $settings['lang_images_url'], '/new.gif" alt="', $txt['new'], '" /></a>
<p>
', $txt['started_by'], ' <strong>', $topic['first_post']['member']['link'], '</strong>
', $txt['in'], ' <em>', $topic['board']['link'], '</em>
<small id="pages', $topic['first_post']['id'], '">', $topic['pages'], '</small>
</p>
</div>
</td>
<td class="', $color_class, ' stats windowbg">
', $topic['replies'], ' ', $txt['replies'], '
<br />
', $topic['views'], ' ', $txt['views'], '
</td>
<td class="', $color_class2, ' lastpost windowbg2">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt['last_post'], '" title="', $txt['last_post'], '" style="float: right;" /></a>
', $topic['last_post']['time'], '<br />
', $txt['by'], ' ', $topic['last_post']['member']['link'], '
</td>';
if ($showCheckboxes)
echo '
<td class="windowbg2" valign="middle" align="center">
<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />
</td>';
echo '
</tr>';
and I changed it to the following:
$boards = array();
foreach ($context['topics'] as $topic)
$boards[$topic['board']['id']] = $topic['board'];
foreach ($boards as $board)
{
echo '
<tr class="catbg">
<td colspan="8">', $board['link'], '</td>
</tr>';
foreach ($context['topics'] as $topic)
{
if ($topic['board']['id'] != $board['id'])
continue;
echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="6%">
<img src="' . $settings['images_url'] . '/topic/' . $topic['class'] . '.gif" alt="" />
</td><td class="windowbg2" valign="middle" align="center" width="4%">
<img src="' . $topic['first_post']['icon_url'] . '" alt="" align="middle" />
</td><td class="windowbg' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '3' : '' , '" width="48%" valign="middle">' , $topic['is_locked'] && !empty($settings['seperate_sticky_lock']) ? '
<img src="' . $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" style="margin: 0;" />' : '' , $topic['is_sticky'] && !empty($settings['seperate_sticky_lock']) ? '
<img src="' . $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" style="margin: 0;" />' : '', $topic['first_post']['link'], ' <a href="', $topic['new_href'], '"><img src="', $settings['images_url'], '/', $context['user']['language'], '/new.gif" alt="', $txt[302], '" /></a> <span class="smalltext">', $topic['pages'], '</span></td>
<td class="windowbg2" valign="middle" width="14%">
', $topic['first_post']['member']['link'], '</td>
<td class="windowbg" valign="middle" width="4%" align="center">
', $topic['replies'], '</td>
<td class="windowbg" valign="middle" width="4%" align="center">
', $topic['views'], '</td>
<td class="windowbg2" valign="middle" width="22%">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" style="float: right;" /></a>
<span class="smalltext">
', $topic['last_post']['time'], '<br />
', $txt[525], ' ', $topic['last_post']['member']['link'], '
</span>
</td>';
if ($showCheckboxes)
echo '
<td class="windowbg2" valign="middle" align="center">
<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />
</td>';
echo'
</tr>';
}
This is the same code from my SMF 1.1.11 version of sorting the unread with a few minor tweaks (there is an extra column in there for the checkboxes, and the checkboxes themselves).
And it is appearing to work.....