vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Adsense after first post (https://vborg.vbsupport.ru/showthread.php?t=96249)

ski diva 07-24-2006 04:52 PM

Does this only work in the legacy style?

Snake 07-24-2006 05:22 PM

Yes it does.

Gary King 07-24-2006 09:02 PM

How do I get rid of the Sponsored box that appears when someone uses Quick Reply in conjunction with Ajax to reply to a thread? It shows the box but it's empty.

burntire 07-26-2006 04:52 AM

Quote:

Originally Posted by SHalliday
I now have this working on VB3.54 without any problems. Have tested in IE and Firefox with QuickReply Box on. It displays the Google adsense ad after the last post when there are two or more posts in the thread. It does not display when there is only one post in the thread. Here is the code that I used:

Code:

<!-- Google Ad  -->
<if condition="$post[postcount]!=1 and $post['islastshown']">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
<*** ADSENSE SCRIPT CODE HERE***>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
<!-- Google Ad  -->

Thank you very much for the great hack and to all of you who participated in this thread. "Clicked Install"

.

This works nice.
What is the code to make is display under the first post?
Thanks

Dumi 07-26-2006 06:46 AM

Quote:

Originally Posted by SHalliday
I now have this working on VB3.54 without any problems. Have tested in IE and Firefox with QuickReply Box on. It displays the Google adsense ad after the last post when there are two or more posts in the thread. It does not display when there is only one post in the thread. Here is the code that I used:

Code:

<!-- Google Ad  -->
<if condition="$post[postcount]!=1 and $post['islastshown']">
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
<*** ADSENSE SCRIPT CODE HERE***>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
<!-- Google Ad  -->

Thank you very much for the great hack and to all of you who participated in this thread. "Clicked Install"

.


This has been the only code that has worked on mine w/o messing the tables. Anyway to get it to show after the first post?

Hemanth 07-26-2006 11:04 AM

Cool. This Condition works perfectly o my vB 3.5.4 board. Thanks a lot.

Quote:

<if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))">

burntire 07-28-2006 09:58 PM

Anyone using CMPS with the ad showing after the first post?
If so post up your code. I can't get it to work without messing up the layout on the bottom.
Thanks.

Sim9 07-30-2006 01:33 AM

I think 3.6.0 uses new table code. This is what I'm using now that works well for me (I also only show ads to guests):

PHP Code:

<if condition="!$GLOBALS['FIRSTPOSTID'] && $show['guest']"> <!-- GOOGLE AD -->

<
br>
<
table id="post$post[postid]class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center">
<
tr>
    <
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]colspan="2">        
        
Sponsored Links (Please login to hide these :)
    </
td>
</
tr>
<
tr>
    <
td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
    <
center><script type="text/javascript"><!--
google_ad_client "INSERT YOUR AD CLIENT HERE";
google_alternate_ad_url "INSERT YOUR AD URL HERE";
google_ad_width 728;
google_ad_height 90;
google_ad_format "728x90_as";
google_ad_type "text_image";
google_ad_channel ="";
google_color_border "333333";
google_color_bg "444444";
google_color_link "FFFFFF";
google_color_url "BBBBBB";
google_color_text "AAAAAA";
//--></script>
<script type="text/javascript"
  
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</
script></center>
    </
td>
</
tr>
</
table>

<!-- / 
GOOGLE AD --></if> 


burntire 07-30-2006 10:50 PM

Can someone take a look at this code and tell me why the ad shows up under both the first and last post. I just want it under the first post.
Thanks

Code:

<!-- Google Ad  -->
<if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))"> 
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
 <script type="text/javascript"><!--
google_ad_client = "";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "image";
google_ad_channel ="";
google_color_border = "000000";
google_color_bg = "000000";
google_color_link = "FFFFFF";
google_color_text = "CCCCCC";
google_color_url = "999999";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
<!-- Google Ad  -->


</tr>
</table>

</div>
$spacer_close

</if>


burntire 08-01-2006 08:24 PM

Anyone?

Quote:

Originally Posted by burntire
Can someone take a look at this code and tell me why the ad shows up under both the first and last post. I just want it under the first post.
Thanks

Code:

<!-- Google Ad  -->
<if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))"> 
$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
 <script type="text/javascript"><!--
google_ad_client = "";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "image";
google_ad_channel ="";
google_color_border = "000000";
google_color_bg = "000000";
google_color_link = "FFFFFF";
google_color_text = "CCCCCC";
google_color_url = "999999";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
</tr>
</table>
</div>
$spacer_close
</if>
<!-- Google Ad  -->


</tr>
</table>

</div>
$spacer_close

</if>



l3vi 08-02-2006 06:06 AM

I was doing some searching to find out why Firefox keep hanging on my phpAdsNew code that I had in the header of each post.

After reading most of this thread till page 10 I got an idea of why Firefox hangs when you use the quick reply.

Basically when the AJAX is run Fixfox attemps to run the javascript and hangs. so I added <if condition="!$post['islastshown']"> around my ad code so that it would not attempt to run the code at the time the quick replay was posted and FireFox started working just fine.

Hope that helps anyone who is looking for the information I was looking for!

GoTTi 08-09-2006 09:10 AM

Quote:

Originally Posted by Sim9
I think 3.6.0 uses new table code. This is what I'm using now that works well for me (I also only show ads to guests):

PHP Code:

<if condition="!$GLOBALS['FIRSTPOSTID'] && $show['guest']"> <!-- GOOGLE AD -->
 
<
br>
<
table id="post$post[postid]class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center">
<
tr>
    <
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]colspan="2">        
        
Sponsored Links (Please login to hide these :)
    </
td>
</
tr>
<
tr>
    <
td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
    <
center><script type="text/javascript"><!--
google_ad_client "INSERT YOUR AD CLIENT HERE";
google_alternate_ad_url "INSERT YOUR AD URL HERE";
google_ad_width 728;
google_ad_height 90;
google_ad_format "728x90_as";
google_ad_type "text_image";
google_ad_channel ="";
google_color_border "333333";
google_color_bg "444444";
google_color_link "FFFFFF";
google_color_url "BBBBBB";
google_color_text "AAAAAA";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</
script></center>
    </
td>
</
tr>
</
table>
 
<!-- / 
GOOGLE AD --></if> 


i tried using this and had no luck.

mattyk72 08-09-2006 10:24 PM

Has anyone updated this for 3.6 yet??

Smitty 08-13-2006 05:06 PM

See post above by Gotti - Yes - It works.

azn_romeo_4u 08-13-2006 10:10 PM

it shows in below the PM page as well? Why is that?

obmob 08-14-2006 03:38 PM

Quote:

Originally Posted by azn_romeo_4u
it shows in below the PM page as well? Why is that?

right, right... any idea how to disable it in PM :surprised:

Triggerhappy 08-17-2006 03:02 AM

Can we clear things up here :)

Which post needs to be used on VB3.6.0
What template to put the code in and what bit of code to place it after in that template.

The code and where it needs to go for the user group selection.

This should help allot of people including me :)

greenflag 08-17-2006 12:17 PM

Quote:

Originally Posted by amykhar
What's more fun and challenging - because of ajax issues, is adsense in the last post. ;) That really gets the ad right where the reader's eyes are.

http://www.eaforums.com/forums/364919-post1.html

Find:
Code:

<!-- message -->
                <div id="post_message_$post[postid]">$post[message]</div>
                <!-- / message -->

Add above:
Code:

                <if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))">


<span id="google" style="float:left;margin:2px;" width="340" height="290" align="center" valign="top">
put banner code here
</span></if>


this wont seem to work with 3.6 gold - any suggestions on how to make it work?

Exposed_Bone 08-18-2006 01:28 AM

I have 3.6 version and i have used this code
but the result is this:
Attachment 52249

GoTTi 08-21-2006 05:15 PM

Quote:

Originally Posted by Sim9
I think 3.6.0 uses new table code. This is what I'm using now that works well for me (I also only show ads to guests):

PHP Code:

<if condition="!$GLOBALS['FIRSTPOSTID'] && $show['guest']"> <!-- GOOGLE AD -->
 
<
br>
<
table id="post$post[postid]class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center">
<
tr>
    <
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]colspan="2">        
        
Sponsored Links (Please login to hide these :)
    </
td>
</
tr>
<
tr>
    <
td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
    <
center><script type="text/javascript"><!--
google_ad_client "INSERT YOUR AD CLIENT HERE";
google_alternate_ad_url "INSERT YOUR AD URL HERE";
google_ad_width 728;
google_ad_height 90;
google_ad_format "728x90_as";
google_ad_type "text_image";
google_ad_channel ="";
google_color_border "333333";
google_color_bg "444444";
google_color_link "FFFFFF";
google_color_url "BBBBBB";
google_color_text "AAAAAA";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</
script></center>
    </
td>
</
tr>
</
table>
 
<!-- / 
GOOGLE AD --></if> 


this is showing up after each post, not just the first post. fix?

MissKalunji 08-22-2006 08:39 PM

Quote:

Originally Posted by Sim9
I think 3.6.0 uses new table code. This is what I'm using now that works well for me (I also only show ads to guests):

PHP Code:

<if condition="!$GLOBALS['FIRSTPOSTID'] && $show['guest']"> <!-- GOOGLE AD -->

<
br>
<
table id="post$post[postid]class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="0" border="0" width="100%" align="center">
<
tr>
    <
td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]colspan="2">        
        
Sponsored Links (Please login to hide these :)
    </
td>
</
tr>
<
tr>
    <
td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
    <
center><script type="text/javascript"><!--
google_ad_client "INSERT YOUR AD CLIENT HERE";
google_alternate_ad_url "INSERT YOUR AD URL HERE";
google_ad_width 728;
google_ad_height 90;
google_ad_format "728x90_as";
google_ad_type "text_image";
google_ad_channel ="";
google_color_border "333333";
google_color_bg "444444";
google_color_link "FFFFFF";
google_color_url "BBBBBB";
google_color_text "AAAAAA";
//--></script>
<script type="text/javascript"
  
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</
script></center>
    </
td>
</
tr>
</
table>

<!-- / 
GOOGLE AD --></if> 



works thanks

rickycc 08-27-2006 10:23 PM

Quote:

Originally Posted by MissKalunji
works thanks

I tried this code but it does not work, can someone help....

burntire 08-29-2006 05:46 AM

How do you modify the 3.6.0 code to show under the first post, but only if the thread has at least 3 posts?
Thanks

mugz 08-29-2006 06:53 PM

I just added this code to my site and it set the forum images all over the place i run 3.6.0 the sponser links box did not even match the other posts size?

burntire 08-29-2006 07:14 PM

Quote:

Originally Posted by mugz
I just added this code to my site and it set the forum images all over the place i run 3.6.0 the sponser links box did not even match the other posts size?

did you put it in postbit or postbit legacy

mugz 08-30-2006 12:33 PM

Quote:

Originally Posted by burntire
did you put it in postbit or postbit legacy

I went into postbit and added it at the bottom!

burntire 08-30-2006 06:29 PM

Quote:

Originally Posted by mugz
I went into postbit and added it at the bottom!

I used postbit legacy

Try that

GoTTi 09-02-2006 04:19 PM

any1 got this working for 3.6.0?

Smitty 09-02-2006 04:31 PM

Yes, it works on 3.6 but I can't remember what I changed. Someone in this thread posted the 'fix', I think.

GoTTi 09-03-2006 11:22 AM

yea i used the fix but it is posting itself 3 times in my threads instead of just one time. what code are you using smitty, please post.

Smitty 09-03-2006 11:59 AM

I *think* this is it - I put it at the end of the postbit template:
Code:

<!-- Adsense After First Post -->
<if condition="!$GLOBALS['FIRSTPOSTID']">
<!-- GOOGLE AD -->
 <br>
<table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
    <td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]" colspan="2">       
        Sponsored Links
    </td>
</tr>
<tr>
    <td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="xxxxxxx";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
    </td>
</tr>
</table>
<!-- / GOOGLE AD --></if>
<!-- End Adsense After First Post -->


laskos 09-04-2006 08:37 PM

Hi

i have set this up on my forum http://www.Recycle.co.uk but how do i get it to display ads that are the post topic instead of the page header ?

thanks in advance

LT Mote 09-06-2006 03:33 AM

I can NOT get this to work on my site rofl.

LT Mote 09-06-2006 03:38 AM

Quote:

Originally Posted by laskos
Hi

i have set this up on my forum http://www.Recycle.co.uk but how do i get it to display ads that are the post topic instead of the page header ?

thanks in advance

You edit the "header" template in the style manager....

dougeetx 09-06-2006 04:55 AM

Can someone help me out with this? After I installed this hack, my forum won't load when someone else tries to post after the first post. Thanks!

dougeetx 09-06-2006 07:36 AM

After testing this some more, something weird is happening. It works fine in IE but when I use Firefox, it just continuously tries to load. I can just refresh my page in IE and see that the Firefox post actually worked. I don't know what to try now. Any suggestions?

GoTTi 09-08-2006 05:54 PM

Quote:

Originally Posted by Smitty
I *think* this is it - I put it at the end of the postbit template:
Code:

<!-- Adsense After First Post -->
<if condition="!$GLOBALS['FIRSTPOSTID']">
<!-- GOOGLE AD -->
 <br>
<table id="post$post[postid]" class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
    <td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]" colspan="2">       
        Sponsored Links
    </td>
</tr>
<tr>
    <td class="alt2" style="border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-top: 0px">
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel ="xxxxxxx";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
    </td>
</tr>
</table>
<!-- / GOOGLE AD --></if>
<!-- End Adsense After First Post -->


this works. thanks. :rolleyes:

Silmarillion 09-09-2006 03:32 PM

Quote:

Originally Posted by dsotmoon
is there a way to get this to post after the first post on each page, page2,3.4. etc ?

Any ideas?

Edit: just found the answer.

Quote:

<if condition="$post[postcount] % $vboptions[maxposts] == 1">
mfg

laskos 09-10-2006 09:19 AM

Quote:

Originally Posted by LT Mote
You edit the "header" template in the style manager....

Sorry i dont get what you mean. what i want is when someone posts say they are giving away sofa bed, i would like the adsence after the first post display ads about sofa beds, same if someone posts an ad about a drinks cabinet, again i would like after the first post it display ads about drinks cabinets ?

Is this possible and how can i achieve this

thanks in advance.

Dumi 09-18-2006 08:09 PM

Quote:

Originally Posted by theChronic
hey whats up

I got that code for ya. It works flawlessly on my board, only shows to guests and only shows if there are two posts and it shows in a little sponsored box which looks nice.

PHP Code:

<if condition="$post[postcount] == 1 AND $show[guest]">

$spacer_open
<div style="padding:0px 0px $stylevar[cellpadding]px 0px">

<
table class="tborder" cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
<
tr>
    <
td class="thead" align="left">Sponsored Links</td>
</
tr>
<
tr>
    <
td class="alt1" align="center">
        (
adsense code or whatever other banners/ads you want go here)
    </
td>
</
tr>
</
table>

</
div>
$spacer_close

</if> 

Put this at the very end of your postbit_legacy template. GL :)


This is the best one I have found so far, very simple. Worked in postbit, version 5.4


All times are GMT. The time now is 09:43 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02876 seconds
  • Memory Usage 1,943KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (5)bbcode_php_printable
  • (19)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete