r30034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r30033‎ | r30034 | r30035 >
Date:20:54, 21 January 2008
Author:magnusmanske
Status:old
Tags:
Comment:
Patch by Peter Chiocchetti
Modified paths:
  • /trunk/wiki2xml/php/content_provider.php (modified) (history)
  • /trunk/wiki2xml/php/w2x.php (modified) (history)
  • /trunk/wiki2xml/php/xml2odt.php (modified) (history)

Diff [purge]

Index: trunk/wiki2xml/php/xml2odt.php
@@ -491,9 +491,14 @@
492492 } else {
493493 if ( $content_provider->is_an_article ( $this->link_target ) ) {
494494 $link = "SEITEN-INTERNER LINK" ;
495 -/* $lt = $this->internal_id ( trim ( $this->link_target ) ) ;
496 - $lt = str_replace ( "+" , "_" , $lt ) ;
497 - $link = "<link linkend='{$lt}'>{$link}</link>" ;*/
 495+ # dub sez... working internal links
 496+ $lt = ( trim ( $this->link_target ) ) ;
 497+ $lt = str_replace ( "+" , " " , $lt ) ;
 498+ $text = array_pop ( $this->link_parts ) ;
 499+ if (!$text)
 500+ $text = $lt;
 501+ $link = '<text:a xlink:type="simple" xlink:href="#' . $lt . '|outline">' . $text . '</text:a>' ;
 502+ #$link = "<link linkend='{$lt}'>#{$lt}|outline</link>" ;
498503 } else {
499504 $href = $xml2odt->get_url ( $this->link_target ) ;
500505 if ( count ( $this->link_parts ) == 0 ) $text = $this->link_target ;
Index: trunk/wiki2xml/php/w2x.php
@@ -48,7 +48,8 @@
4949 }
5050 $optional = "<br/>" . implode ( "<br/>" , $optional ) ;
5151
52 - if ( $as_extension ) $site = "<input type='hidden' name='site' value=''/>" ;
 52+ # dub sez... working images
 53+ if ( $as_extension ) $site = "<input type='hidden' name='site' value='".$xmlg["site_base_url"]."'/>" ;
5354 else $site = "Site : http://<input type='text' name='site' value='".$xmlg["site_base_url"]."'/>/index.php<br/>" ;
5455
5556 $additional = array() ;
Index: trunk/wiki2xml/php/content_provider.php
@@ -54,7 +54,14 @@
5555 $target = $dir . "/" . $fname ;
5656 if ( !file_exists ( $target ) && !$this->block_file_download ) {
5757 @mkdir ( $dir ) ;
58 - @copy ( $url , $target ) ;
 58+ # dub sez... use cURL
 59+ $ch = curl_init();
 60+ curl_setopt($ch, CURLOPT_URL, $url);
 61+ $fh = @fopen($target, 'w');
 62+ curl_setopt($ch, CURLOPT_FILE, $fh);
 63+ curl_exec($ch);
 64+ curl_close($ch);
 65+ @fclose($fh);
5966 }
6067 return $fname ;
6168 }

Status & tagging log