Thanks. When I added $articleID= Parser::getArticleID(); to my extension code, I got a blank page. I guess I need to declare some other global variable or so... Wht should be that?
Regards,
Jack ----------------------------------------------------------------
"People forget how fast you did a job - but they remember how well you did it"
-----Original Message----- From: mediawiki-l-bounces@lists.wikimedia.org [mailto:mediawiki-l-bounces@lists.wikimedia.org] On Behalf Of Thomas Dalton Sent: Wednesday, October 31, 2007 7:29 PM To: MediaWiki announcements and site admin list Subject: Re: [Mediawiki-l] Checking whether a page existing or not
In an extension function, i want to check whether the current page is new or already existing. which function i can call to get that info?
Parser::getArticleID(), or something like that. A new page will have an ID of 0, existing pages will have positive IDs. (I think.)
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
This electronic mail (including any attachment thereto) may be confidential and privileged and is intended only for the individual or entity named above. Any unauthorized use, printing, copying, disclosure or dissemination of this communication may be subject to legal restriction or sanction. Accordingly, if you are not the intended recipient, please notify the sender by replying to this email immediately and delete this email (and any attachment thereto) from your computer system...Thank You
Jack Eapen C wrote:
Thanks. When I added $articleID= Parser::getArticleID(); to my extension code, I got a blank page. I guess I need to declare some other global variable or so... Wht should be that?
Regards,
Jack
getArticleID() is not a static member function. It must be called from an object. You can call it from $wgParser->getArticleID() but *it's not guaranteed to work*. You should use the parser object which is being passed to your extension.
mediawiki-l@lists.wikimedia.org