Thread:Project:Support desk/Adding Adsense into articles only/Включение Adsense только в страницы со статьями

Hello. Since my wiki's attendance grows terrifyingly fast it is very possible that in a couple of months paying for the server can become really problematic. So I decided to place ads for unregistreted users into articles. Here is the code, it is placed in Monobook.php right below FirstHeading:

Registrated users don't see them, but for some reason ads appear only on pages having discussion pages and on discussion pages themselves, while pages without discussions don't have ads at all, which is absolutely inacceptable. What am I doing wrong? How to fix that?