Hello All,
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.
I would really appreciate any kind of help. Some API doc, example, etc.
Thank you for your time.
-- Pranav
------------------------------ http://pd.dnsalias.org
On 13/12/06, Pranav Desai pranavadesai@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#ff4a80b81c645f7341878b7a99f7e... for a little more information. The flags themselves are easier to read about directly in includes/Article.php.
Rob Church
On 12/13/06, Rob Church robchur@gmail.com wrote:
On 13/12/06, Pranav Desai pranavadesai@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" );
Thats perfect !! ... I am facing some issue with the first alphabet being capitalized. i.e. if I enter say "test" the page is created with name test, but when I click on it, it refers to Test and asks for editing again. But if I enter "Test" then everything works fine. I am fine with manipulating the user input correctly to get around this, but is there a better way of doing it ?
Thanks a lot for you help.
-- Pranav
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#ff4a80b81c645f7341878b7a99f7e... for a little more information. The flags themselves are easier to read about directly in includes/Article.php.
Rob Church _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org