quote:
Originally posted by -dt-
code:
$string = preg_replace('/\[\[wiki(?:\:|)([a-zA-Z]+|)\]([a-zA-z0-9_]+)\]/e', 'defL("$1","$2")',$string);
function defL($lang,$title){
if($lang=='')$lang='en';
$title1 = str_replace("_", " ", $title);
return '<a href="http://'.$lang.'.wikipedia.org/wiki/'.$title.'">'.$title1.'</a>';
}
Found a little error, fixed it
Instead of using the parts defined in the tag it made a link like this:
<a href="$lang.wikipedia.org/wiki/$title">$title1</a>