'; # Make sure images do not display with a border. echo ''; $default_title = 'Spam'; # If you do not specify a title, this will be your default page. $sourceurl = 'http://de.wikipedia.org/wiki/'; # This URL changes from time to time. If the script stops working suddenly, first check whether Wikipedia.Org changed the URL syntax. $pathfromroot = substr( $_SERVER['REQUEST_URI'], 0, strpos( $_SERVER['REQUEST_URI'], "?" ) ); $title_wiki = $_GET['title']; if ($title_wiki == "") { $title_wiki = $default_title; } $nicetitle = str_replace( "_", " ", stripslashes( $title_wiki ) ); function callback( $buffer ) { global $nicetitle; global $title_wiki; global $sourceurl; # Separate the article content $buffer = substr( $buffer, strpos( $buffer, '' ) ); $buffer = substr( $buffer, 0, strpos( $buffer, '
' ) ); # Replace relative links (use another wiki server) $buffer = str_replace( '"/w/skin', '"http://de.wikipedia.org/w/skin', $buffer ); $buffer = str_replace( '"/skins', '"http://de.wikipedia.org/skins', $buffer ); # Replace relative links (use this server) $buffer = str_replace( '"/wiki/', '"' . $pathfromroot . '?title=', "$buffer ,'/'"); # Remove edit links $buffer = str_replace( ">edit<", "><", $buffer ); $buffer = str_replace( "[<", "<", $buffer ); $buffer = str_replace( ">]", ">", $buffer ); $buffer = str_replace( 'href="/w/index.php?', 'target="_blank" href="http://de.wikipedia.org/w/index.php?', $buffer ); # These are typically links to non-existent pages, so the Wikipedia edit page has to open. if ( $buffer <> '' ) { $buffer = '

' . $nicetitle . ' edit
shit kopiert aus dem Wikipedia, Freies Dingens Bums


 

' . $buffer; } else { $buffer = '

Unfortunately, no content could be extracted!

Return to the previous page or consult the Wikipedia article on "' . $nicetitle . '".'; } return $buffer; } ob_start("callback"); include $sourceurl . $title_wiki; ob_end_flush(); ?>