On 13/12/06, Pranav Desai <pranavadesai(a)gmail.com> wrote:
I would like to create a new page within an extension
and also add it
to the database (just like saving the page). I dont think the inputbox
extension works here. Basically, I am looking for an extended version
of inputbox, which will create 2-3 new pages with some basic text
prefixed with the page name entered in the inputbox. E.g. if I enter
test, it will create test_1, test_2.
To create/update the "Wiki this, wiki that" page with some content in
MediaWiki 1.7.0 or above:
$title = Title::makeTitle( NS_MAIN, "Wiki this, wiki that" );
$article = new Article( $title );
$article->doEdit( "This is some text.", "Programmatic creation,
bwahahaha" );
The first parameter to Article::doEdit() is the text to create; the
second is the edit summary and the third optional parameter is a load
of fancy flags to determine various behaviours. Take a look at
http://svn.wikimedia.org/doc/classArticle.html#ff4a80b81c645f7341878b7a99f7…
for a little more information. The flags themselves are easier to read
about directly in includes/Article.php.
Rob Church