do you just replace for newposts or are you changing the bbcode parsing functions?
depending on your answer you'd have to use caching or not of course
as for the general:
PHP Code:
$textlinks = $DB_site->query("SELECT * FROM Textlink");
$find = array();
$replace = array();
while ($link = $DB_site->fetch_array($textlinks))
{
$find[] = $link['text'];
$replace[] = '[url=' . $link['link'] . ']' . $link['text'] . '[/url]';
}
$post['message'] = str_replace($find, $replace, $post['message']);
as said, that's the general idea, actually using preg_replace would be better but mor complicated, as it would also allow you to ignore cases and you have to make sure not to replace text which is already a code or url or something like