OK, This version takes care of edits too:
Code:
// HACK : START : ME
global $post;
if ('' == $post[username]) {
global $reputation;
if ('' == $reputation[username]) {
global $pm;
if ('' == $pm[fromusername]) {
global $postinfo;
if ('' == $postinfo[username]) {
$meUsername = ''; // Can't determine username
} else {
$meUsername = $postinfo[username];
}
} else {
$meUsername = $pm[fromusername];
}
} else {
$meUsername = $reputation[username];
}
} else {
$meUsername = $post[username];
}
$bbcode = preg_replace('#^/me (.*)$#im', "<span class=\"postAction\">*$meUsername \\1*</span>", $bbcode);
// HACK : END : ME
Remember to strip my formatting
I think new replies are already dealt with by the $post one are they not?
I can't find a scenario in which it no longer works on mine.