I changed to $wgParser
function renderMedia($input) {
global $wgParser;
return $wgParser->parse('...', $wgParser->mTitle, $wgParser->mOptions,
false, false);
}
Note that $parse in Parser.php is marked as @access private, should I use it
? or should it become public ? my server runs php4 so that's not a problem
now for me.
Ok the page is added to category, but parse() returns an Object, not a
string.
In my older version, return $wgOut->parse(...) returned a string of the HTML
output.
What's wrong ?
2006/5/20, Rob Church <robchur(a)gmail.com>om>:
On 20/05/06, iubito <iubito(a)gmail.com> wrote:
Hi, I've made a little parser extension for
my needs.
I want this extension add automatically the page where it's called to a
category, say Category:Foobar.
In my function, I wrote :
return $wgOut->parse('blabla[[Category:Foobar]]');
but my page isn't added to category Foobar. "blabla" is working very
well.
What is wrong with my code ?
You're using the wrong parser. The parser that $wgOut uses discards
the parser output, which is where things like link table updates come
from.
Something like:
$parser->parse( "...", $parser->mTitle, $parser->mOptions, false,
false);
where $parser is the parser object passed to the hook; should work.
Rob Church
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
--
Sylvain Machefert
http://iubito.free.fr
http://tousauxbalkans.jexiste.fr