On 02/11/2007, Jack Eapen C <jackec(a)suntecgroup.com> wrote:
Hmm.. Unluckily I'm not a programmer. I thought my requirement is
simple.
In my extension I want to display the output of a function only while
editing existing pages.
Something like
If ($articleId !=" ") {
Myfunction
}
I suppose if the currently editing page is a new one, it still don't hv
an ID
The hook you are using includes a parser object as a parameter (the
third, I think, but check in docs/hooks.txt to be sure). Call
getArticleID() on that object (eg. $parser->getArticleID()). If you
get a positive number, it's an existing page. If you get 0, it's a new
page (or possibly something which isn't a page at all, I'm not
entirely sure - you might get NULL then instead, if the hook is even
called).