Now you can have a small, rectangular adsense ad appear within and directly beneath the content of the first post in each thread specially in the core theme.
You can try this approach:
Find in Display.template.php:
<div class="inner" id="msg_', $message['id'], '"', '>', $message['body'], '</div>
Replace the above with:
<div class="inner" id="msg_', $message['id'], '"', '>';
if ($message['id'] == $context['first_message'])
echo '
<div style="float:right; width:270px;">
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxx";
/* 250x250, created 9/07/11 bforum text */
google_ad_slot = "xxxxxxxxxxxx";
google_ad_width = 250;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>';
echo '
', $message['body'], '</div>
You can see the demo here:
http://www.baqaians.com/bforum/general-physician-desk/myths-about-the-menstrual-periods/
;D ;D ;D ;D ;D ;D thanks
is this possible for the bigger banners ? I want to put the large adsense banner in the first post only ??
@glennk: Yes, that should be possible :)
Also, I don't want to ruin anyone's experience, but this can also be done with Ad Management Mod (http://custom.simplemachines.org/mods/index.php?mod=255), AFAIK. That's a bit simpler for most users, but if you just want it there without installing big mods you can indeed use this :)
Hmmm great
@aamjad2001 - Thank you so much for this tutorial... really useful! :)
i use Ad Management Mod before i don't like and the ads appear at the top of the post not in the post
and @aamjad2001 - Thank you so much for this tutorial... really useful!
-------------------------------------
dead4ever.com
Nice tip.
I started using http://www.smfhacks.com/ad-seller-pro.php some time ago.
It lets you create custom ad locations in the template.
It has also help me learn how to manually edit templates too.
Thanks a lot for this tutorial.We will be benefited more.
I would be very satisfied with the free mod for adsense, thank you for the tutorial
This works just fine. But I would like to put the ad between first and second post, not inside the first. How do I do that?
Ad management mod doesn't work for me, it shows ads only at the top and bottom of the page. Only with this code I was able to put the ad into the post. But I need a little tweek. Thanks in advance, guys. (I have SMF 2, default Core theme)
is it possible to modify this for guests only.
i am gradually switching to ad free forum for members
Zitat von: dimspace in Februar 10, 2013, 10:34:07 NACHMITTAGS
is it possible to modify this for guests only.
i am gradually switching to ad free forum for members
In the "replace with" code in the first post,
Replace:
if ($message['id'] == $context['first_message'])With:
if ($message['id'] == $context['first_message'] && $context['user']['is_guest'])
Zitat von: Yoshi2889 in Februar 11, 2013, 05:30:46 VORMITTAG
Zitat von: dimspace in Februar 10, 2013, 10:34:07 NACHMITTAGS
is it possible to modify this for guests only.
i am gradually switching to ad free forum for members
In the "replace with" code in the first post,
Replace:
if ($message['id'] == $context['first_message'])
With:
if ($message['id'] == $context['first_message'] && $context['user']['is_guest'])
cheers yoshi.
most of my ads i just use simple portal, i dont have many anyway, just two the right in normal mode, or header and footer in mobile mod, but about five months ago i seperated the guest and member ads so i could track each one.
guests are about 70% of my revenue so im not far from having ad free forum for members with the guests funding the server.
That's awesome :)
Do keep in mind that if you get less guests you get less income, so you should be prepared for that.
Thanks so much :D
Thanks for useful info.
Thanks
Thank you, this is great way to add ad in thefirst post without a mod.
how to make this thing work on specific board only?
because the ad management board doesnt work on "Display ads within posts"
or i just dont know how to do it.
Thanks a lot. It does work for my board.
Thanks ;)
Zitat von: ryan_dwight in Mai 13, 2013, 05:48:53 VORMITTAG
how to make this thing work on specific board only?
because the ad management board doesnt work on "Display ads within posts"
or i just dont know how to do it.