-------- Original-Nachricht --------
Datum: Tue, 30 Oct 2007 21:08:53 +1100
Von: "Andrew Garrett" <andrew(a)epstone.net>
An: "Wikimedia developers" <wikitech-l(a)lists.wikimedia.org>
Betreff: Re: [Wikitech-l] How to get the article content?
On 10/30/07, "Marcus Schäfer"
<magggus(a)gmx.de> wrote:
Even if I call the global $wgArticle variable the
same error-message
appears. For this reason
I thought there were any changes in the code e.g.
Because like I
mentioned: it worked on
older releases!?!
Where are you calling it?
--
Andrew Garrett
I call it within a parser function, like this:
function wfRenderArticleSectionCheck_Magic(&$parser) {
global $wgArticle, $wgTitle, $wgParser, $wgLang, $wgLanguageCode;
$lan = $wgLang->getCode();
$text = $wgArticle->getContent();
$regex = "'(<section lan=$lan>)(.*)(</section>)'";
preg_match_all($regex, $text, $matches);
for($i=0;$i<count($matches[0]);$i++) {
$output = $parser->parse($matches[0][$i], $parser->mTitle, $parser->mOptions,
true, false);
return $output->getText();
continue;
}
return true;
}
--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen:
http://www.gmx.net/de/go/multimessenger