Re: [ADDON] QRR - Quick Reply Reposition
Reply #1 –
Your code wouldn't work, the comma is a valid way to concatenate only when you use echo.
In this case you'd have to use parenthesis:
// Show a link to the member's profile.
$poster_div .= '
<a class="linklevel1 name"' . (empty($message['member']['id']) ? '' : ' href="' . $scripturl . '?action=profile;u=' . $message['member']['id'] . '"') . '>
' . $message['member']['name'] . '
</a>';
That said, I think it is done that way because it seems (at least to me) easier to read than the ternary operator ( xx ? yy : zz ).
It's a bit of repetition, yeah.