1 (edited by batiatus 2016-10-14 13:25)

Topic: [Mod] Adsense in First Post / Only For Guests

Hey guys!
I'll show you how to place adsense code or any ads in first posts row, between or after message. You can also show ads only to guests or everyone by this method easily. Here's the code:

Open viewtopic.php and find this code:

<?php echo implode("\n\t\t\t\t\t\t", $forum_page['message'])."\n" ?>

Place this code before or after this code. This is up to you:

if($forum_page['page'] == '1' && $forum_page['item_count'] == '1' && $forum_user['is_guest'])
{
    echo '
YOUR ADSENSE CODE HERE
    ';
}

If you want to show ads to everyone, no matter if user is registered or not, just delete && $forum_user['is_guest'] part and you are ready to go! smile

You can see a demo here if you want: Bilgi
Just visit any topic.

By the way, it would be better if you choose a responsive adsense ads.

Have fun!

Re: [Mod] Adsense in First Post / Only For Guests

Thanks thats neat