Alright, so this is linked to a previous question I had. I am very new to PHP in general, and simply only need it to fix something someone else did to work for a forum of mine.
This is what I currently have:
// Alter post output to create links to user profiles
$post->message = preg_replace(
'/@ *('.preg_quote($speak['username'], '/').')[:,.]? */i',
'[url=\''.PAGE_URL.RELATIVE_WBB_DIR.'/index.php?'
. 'page=User&userID='.$speak['toID'].'\']@'.$ speak['username'].':[/url]',
$post->message);
This should change:
@JamesNorris, @JamesNorris: @JamesNorris
to user profile links, and it does. The only problem is that the other change it makes is this:
@JamesNorris:@JamesNorris:@JamesNorris:
That is the output from that line given before. Apparently it is removing the ',' and whitespace, and placing a ':'.
Does anyone have any ideas on how to fix this problem?