Last modified: 2010-05-15 15:33:49 UTC
We have a customization such that we can categorize articles from a drop down list, we do something like this: $t = Title::newFromDBKey("WikiHowCategories"); $a = new Article($t); $cat_array = split("\n", $a->getContent(true, true)); The problem is is that article::LoadContent references "oldid" parameter in the request, so even if you specify an article of "title x" getContent will always return the content of the current old version of the article you're viewing. While this works for Wikipedia, if anyone wants to build on top of the software, it can be a very limiting feature. Possible solutions are adding default parameters to getContent which ignore the values in wgRequest for oldid and redirect. It should be possible to load the content of an arbitrary article from the code when viewing an old version of a particular page.
As of 1.5 you should use the Revision class for this: $rev = Revision::newFromTitle( $t ); if( is_null( $rev ) ) { // no such page } else { $text = $rev->getText(); // fetched current revision text... } If you need to run on 1.4 you might try Article::getContentWithoutUsingSoManyDamnGlobals().
Good to know. Thanks. Feel free to mark as Invalid then.