Maybe I missed something important but why is function template_build_poster_div() (related file is Display.template.php) build using a concatenated string $poster_div = .'blablabla'...
function template_build_poster_div($message, $ignoring)
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
$poster_div = '';
// Show information about the poster of this message.
$poster_div .= '
<ul class="dropmenu">
<li>';
I think it's far better readable to just echo the output than to write the whole html into a concatenated string and do a return at the end?
function template_build_poster_div($message, $ignoring)
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
// Show information about the poster of this message.
echo '
<ul class="dropmenu">
<li>';
Could be that a javascript could use the string for its container - not uncommon in displaying a popup for example. But here it seems the return isn't cached.
If custom themes needs this, they prob. rewrite the subtemplate anyway. I vote for making it output it directly.
Same here... templates should output, not return. Actually, that should be a rule, if it starts with template_ it should have no return value. Just because it is in a template file, doesn't mean it needs to start with template_ though. If it is a template helper, maybe start it with helper_
Yay, that's it :) Thank you. It's aparantly the box, if you hover over the username. Will add it to the function's doc.
Still though, it should output and not return
No, it can't output then...it has to wait until echoed within the javascript code, which often comes afterwards. But, in this instance it isn't afaics, unless that variable is global'ed somewhere else?