On 20/08/06, shardsofmetal <shardsofmetal(a)gmail.com> wrote:
Are there any functions I can use to make a function
create a new
article, then redirect to a special page? The Article::insertNewPage
function is marked as private, and won't let me reidrect to a new page
afterwards anyways. Thanks for any help, Shardsofmetal
Be more specific. "Functions" accessible from where? Within MediaWiki?
Within an extension? External to the software? You need to tell us
what you're attempting to do, and the scope of that problem.
I'm going to hazard a guess that you want to do this from, e.g. a
special page extension. Assuming MediaWiki 1.7 or upwards...
1. Instantiate a Title object corresponding to the title to be created
2. Check that the title doesn't exist ( Title::exists() )
3. Instantiate an Article object using the title
4. Call Article::doEdit() with appropriate flags (see the massive
comment block above the function definition) to perform the edit
5. [To do the redirect afterwards] Call Output::redirect() on the
global output object
Rob Church