PDA

View Full Version : Help installing ad under first post


MAdotcom
21 Aug 2010, 06:10
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
21 Aug 2010, 15:40
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
22 Aug 2010, 15:03
That sounds good to me but how would I write the code for the condition? Thanks for your response Lynne

Lynne
22 Aug 2010, 15:23
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
22 Aug 2010, 16:01
couldn't they just use one of the ad locations as well?

MAdotcom
22 Aug 2010, 16:13
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
23 Aug 2010, 00:36
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
23 Aug 2010, 23:36
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
24 Aug 2010, 03:48
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
24 Aug 2010, 04:01
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
04 May 2012, 20:10
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
26 May 2012, 14:20
I think this is what you want.

http://www.vbulletin.org/forum/attachment.php?attachmentid=116754&d=1273131515

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