Thread:Project:Support desk/Hooks and Parsers duplicate pages/reply (4)

(I've tidied up your code a smidge with indention and such.)

What is the difference between this code and the next one you pasted?

I haven't dealt a lot with the two hooks you're focusing on here, but I do think you could go with the ArticleAfterFetchContentObject  hook instead of the one you're using. You just have to check it and make sure you're dealing with the right sort of content. And you'd have to put the text back into the content object rather than just "returning" text.

That said, I noticed that you are using the DB via mysql_connect instead of re-using MediaWiki's connection. Any reason why?