Log in

View Full Version : Help installing ad under first post


MAdotcom
08-21-2010, 04:10 AM
I want to add a text ad under the first post of every page on my site. Where in the template do I paste the code?

TIA

Lynne
08-21-2010, 01:40 PM
What about putting it in your postbit(_legacy) template at the bottom with a condition around it so it only shows in the first post?

MAdotcom
08-22-2010, 01:03 PM
That sounds good to me but how would I write the code for the condition? Thanks for your response Lynne

Lynne
08-22-2010, 01:23 PM
Did you try looking in the postbit to figure it out? The condition is actually already written for you and used in there:
<vb:if condition="$post['isfirstshown']">stuff</vb:if>

Brandon Sheley
08-22-2010, 02:01 PM
couldn't they just use one of the ad locations as well?

MAdotcom
08-22-2010, 02:13 PM
No I didn't Lynne. Sorry :( Thank you for your help though, I would have never figured that out

--------------- Added 1282494126 at 1282494126 ---------------

I am getting this message.

adding child to non-existent node!

This is what the code looks like after I paste it in.

<vb:if condition="$post['isfirstshown']"><script type="text/javascript"><!--
google_ad_client = "pub-2629802984303117";
/* 728x15, created 8/22/10 */
google_ad_slot = "3512815801";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></vb:if>

Lynne
08-22-2010, 10:36 PM
The only time I see that error is if there is a condition that isn't closed. Make sure all your <if> have </if>

MAdotcom
08-23-2010, 09:36 PM
Hi Lynne, you were right about the error. I added another </if> when I shouldn't have but I want the ad underneath the 1st post box, not under the actual post inside the box.

Lynne
08-24-2010, 01:48 AM
Then put divs around it and style the divs how you want them?

Where in the template are you adding the code? If you look at html for the posts, they all start/end with <li> - you did that, right?

Videx
08-24-2010, 02:01 AM
couldn't they just use one of the ad locations as well?I used to use ad_showthread_firstpost , but it didn't show in Manage Ads so you had to edit the template directly. However, it inexplicably stopped working in 406. :(

addamroy
05-04-2012, 06:10 PM
Hi Lynne, you were right about the error. I added another </if> when I shouldn't have but I want the ad underneath the 1st post box, not under the actual post inside the box.

I know this is and old thread, but I found it looking for the same answer, and I happen to have the answer for this so figured I'd drop in with an update.

Paste the code Lynne showed you, under EVERYTHING in the postbit_legacy template and it will show under the first post and not inside it.

Again that code Lynne showed you should literally be the last bit of code in that template.

Good luck!

mathforum
05-26-2012, 12:20 PM
I think this is what you want.

https://vborg.vbsupport.ru/attachment.php?attachmentid=116754&d=1273131515

See this very useful mod (www.vbulletin.org/forum/showthread.php?t=241944).