get_results("select $name_column as link_name".($url_column?", $url_column as link_url":"").($target_column?", $target_column as link_target":"").($description_column?", $description_column as link_description":"")." from $tablename") as $row) {
$replace = "link_url."\" target=\"".$row->link_target."\" title=\"".$row->link_description."\">".$row->link_name."";
$text = preg_replace ( '#(.*'.$row->link_name.'.*)|('.$row->link_name.')#Uie', "'$1'?stripslashes('$1'):'".$replace."'", $text);
}
//return output text;
return trim($text);
}
add_filter('the_content', 'wplink_replace');
?>