Ok. I got it now. Simply change the whole buffer code to this one:
function STFS_Titles(&$buffer)
{
global $modSettings, $context, $topic, $board_info;
if (isset($_REQUEST['xml']) || $context['current_action'] == 'printpage') return $buffer;
$stfs = array();
// Define the old and the new title
if (!empty($modSettings['stfs_enable'])) {
$title_old = '<title>' . $context['page_title_html_safe'] . '</title>';
$title_new = '<title>' . (empty($context['page_title_html_safe']) ? $context['forum_name'] : $context['page_title_html_safe']) . ' - ' . $context['forum_name']. '</title>';
$stfs[$title_old] = $title_new;
}
if (!empty($modSettings['stfs_enable']) && !empty($topic)) {
// Define the old and the new title
$title_old2 = '<title>' . $context['page_title_html_safe'] . '</title>';
$title_new2 = '<title>' . (empty($context['page_title_html_safe']) ? $context['forum_name'] : $context['page_title_html_safe']) . ' - ' . $board_info['name'] . ' - ' . $context['forum_name']. '</title>';
$stfs[$title_old2] = $title_new2;
}
// Now let's change the title, if we're allowed to
return str_replace(array_keys($stfs), array_values($stfs), $buffer);
}
I will consider to add the following option later in the mod:
1. Board name in topic title as per what you wanted.
2. Option for left to right or right to left. e.g.
Default - Forum Name - Board Name - Topic Name
Other - Topic Name - Board Name - Forum Name
I prefer forum name first as default since I normally search by typing site name followed by the search key.