- if ($notice) {
- print('Got a notice, checking for atlinks.');
- $id = $notice->profile_id;
- $r = preg_replace('/\b@([\w-]+)\b/e', "ATLINK*** \\1 ***", $r);
- }
+ $id = $notice->profile_id;
+ $r = preg_replace('@https?://\S+@', '<a href="\0" class="extlink">\0</a>', $r);
+ $r = preg_replace('/(^|\b)@([\w-]+)($|\b)/e', "'\\1@'.common_at_link($id, '\\2').'\\3'", $r);