More stuff. Was just checking Subs.php.
Not sure we need this any more, since subjects don't usually have a huge byte count and the text-overflow attribute can deal with visual shortening without needing any PHP functions.
function shorten_subject($subject, $len)
{
global $smcFunc;
// It was already short enough!
if ($smcFunc['strlen']($subject) <= $len)
return $subject;
// Shorten it by the length it was too long, and strip off junk from the end.
return $smcFunc['substr']($subject, 0, $len) . '...';
}
Also, this is the old js resize for avatars, alias crud mentioned in the OP.
// Resize avatars the fancy, but non-GD requiring way.
if ($modSettings['avatar_action_too_large'] == 'option_js_resize' && (!empty($modSettings['avatar_max_width_external']) || !empty($modSettings['avatar_max_height_external'])))
{
// @todo Move this over to script.js?
addInlineJavascript('
var smf_avatarMaxWidth = ' . (int) $modSettings['avatar_max_width_external'] . ';
var smf_avatarMaxHeight = ' . (int) $modSettings['avatar_max_height_external'] . ';' . (!isBrowser('ie') ? '
window.addEventListener("load", smf_avatarResize, false);' : '
var window_oldAvatarOnload = window.onload;
window.onload = smf_avatarResize;'));
}
Plus I don't know where you've gone and hidden it now
but this stuff (2.0.x example) could be ditched too, since these days it's easy to break words up with CSS.
$open_tags = array();
$message = strtr($message, array("\n" => '<br />'));
// The non-breaking-space looks a bit different each time.
$non_breaking_space = $context['utf8'] ? ($context['server']['complex_preg_chars'] ? '\x{A0}' : "\xC2\xA0") : '\xA0';
// This saves time by doing our break long words checks here.
if (!empty($modSettings['fixLongWords']) && $modSettings['fixLongWords'] > 5)
{
if ($context['browser']['is_gecko'] || $context['browser']['is_konqueror'])
$breaker = '<span style="margin: 0 -0.5ex 0 0;"> </span>';
// Opera...
elseif ($context['browser']['is_opera'])
$breaker = '<span style="margin: 0 -0.65ex 0 -1px;"> </span>';
// Internet Explorer...
else
$breaker = '<span style="width: 0; margin: 0 -0.6ex 0 -1px;"> </span>';
// PCRE will not be happy if we don't give it a short.
$modSettings['fixLongWords'] = (int) min(65535, $modSettings['fixLongWords']);
}