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)

farooqaaa 09-25-2006 10:58 AM

I tried this but its not working for me :(

DementedMindz 09-25-2006 11:35 AM

try this im using the last one tweaked a bit.
http://www.vbulletin.com/forum/showthread.php?t=157022

karrerax 09-27-2006 05:40 AM

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 in 3.6!
Thanks

oldfan 09-29-2006 03:28 AM

Quote:

Originally Posted by Xplorer4x4
Well I finally have found the fix. This is tested and working in firefox, and does not create any more of those anoying empty tables when you edit.

REPLACE
PHP Code:

<if condition="!$GLOBALS['FIRSTPOSTID']"

WITH
PHP Code:

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

If you need to exclude a user group form seeing them,
PHP Code:

<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND $vbulletin->userinfo[usergroupid] != 'x' "


thank you

Cajun 10-01-2006 03:42 PM

I can not get this to work with vb 3.6.1 on postbit_legacy. This is the code I am using:

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>

Can someone tell me what I can be doing wrong?

GrendelKhan{TSU 10-01-2006 05:23 PM

Quote:

Originally Posted by karrerax
This Works in 3.6!
Thanks

yup that's the one I got to work too. :)

smsmasters 10-01-2006 06:26 PM

Thanks, works great here!

oldfan 10-02-2006 01:30 AM

seems that all usergroups can still see that ads

soletrader 10-08-2006 09:22 AM

Hi, I would like to receive some help.

I use a fluid template with a 90% width. When I place this code in the postbit the adsense will distort the template and will stick out to 100%

Is there a way I can change this? Thank you

Greek76 11-26-2006 01:25 PM

This does not work for me period. any ideas? I did the code exactly as it was shown and added my google code inbetween no luck though. IM using 3.6.2

burntire 11-26-2006 04:19 PM

[COLOR="Black"]
Quote:

Originally Posted by Greek76 (Post 1125531)
This does not work for me period. any ideas? I did the code exactly as it was shown and added my google code inbetween no luck though. IM using 3.6.2

This the the code I use to place the ad after the last post. I don't like it after the first post. I feel it aggravates my members.

Place this code at the very end of your Postbit_legacy template.

This works in all versions of 3.6

Code:


<!-- Adsense After LAST Post -->
<if condition="$post[postcount]!=1 and $post['islastshown']">
<!-- 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>


Paste you Google Adsense Code Here


</td>
</tr>
</table>
</div>
$spacer_close
</if>
<!-- Google Ad  -->


Greek76 11-26-2006 06:14 PM

Great thanks alot. The problem was is that Im using postbit legacy as opposed to postbit template. Thanks for the code as well for keeping it in the bottom of the posts...

burntire 11-26-2006 09:53 PM

Quote:

Originally Posted by Greek76 (Post 1125734)
Great thanks alot. The problem was is that Im using postbit legacy as opposed to postbit template. Thanks for the code as well for keeping it in the bottom of the posts...


Glad it works

tansu 12-07-2006 01:21 AM

Quote:

Originally Posted by amykhar (Post 773130)
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 worked for me.. Thanks.
I tried to make it only visible to guests.. But couldn't
The starting is like this: What should I add to make it only visible to guests.
Code:

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

Nuguru 12-13-2006 09:05 PM

Hello Everyone,

I know this has been asked before, but no one has seemed to answer it, so I am going to ask it again. Besides, I am sure that are still several people including myself that is experiencing this issue.

This is a really good hack other than the fact that after it's installed, it also shows up in the personal message due to it being in the postbit_legacy file. It's not that it shows up in the personal message that is the problem, the problem is, is that it does not fit properly in the personal message page (below the message box itself).

However, if I change the formatting code to make it fit in the personal message page, then it does not show up properly after the 1st post in a thread. A catch 22 situation.

Therefore, I either need to find a way to fix the formatting so that it fits in both sitiuations or make it so that it does not show up in the personal message.

I do want to use the code and not want to have to delete it because it won't show up properly in the personal message, so I need some help.

Anyone know how to fix the code for either situations?


Thank You,

Nuguru :)

Kesmai 12-30-2006 07:47 PM

The code for adsense within the first and last post is not working. I added it below <!-- / message -->

Quote:

<if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))">
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = "468x15_0ads_al";
google_ad_channel = "5534775962";
google_color_border = "E2ECEF";
google_color_bg = "E2ECEF";
google_color_link = "E1771E";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
</if>

I'm using 3.6.4

Kesmai 12-30-2006 07:50 PM

OK, it worked perfect in postbit but it is DOA when you put it in postbit_legacy

Nuguru 01-02-2007 10:49 PM

Quote:

Originally Posted by Nuguru (Post 1138054)
Hello Everyone,

I know this has been asked before, but no one has seemed to answer it, so I am going to ask it again. Besides, I am sure that are still several people including myself that is experiencing this issue.

This is a really good hack other than the fact that after it's installed, it also shows up in the personal message due to it being in the postbit_legacy file. It's not that it shows up in the personal message that is the problem, the problem is, is that it does not fit properly in the personal message page (below the message box itself).

However, if I change the formatting code to make it fit in the personal message page, then it does not show up properly after the 1st post in a thread. A catch 22 situation.

Therefore, I either need to find a way to fix the formatting so that it fits in both sitiuations or make it so that it does not show up in the personal message.

I do want to use the code and not want to have to delete it because it won't show up properly in the personal message, so I need some help.

Anyone know how to fix the code for either situations?


Thank You,

Nuguru :)



Hello and Happy New Year from WebbinZine.com,

Again, does anyone know how to fix this sizing and spacing issue between the PM and after the 1st post?


Thank You,

Nuguru :)

BigJimTheLug 01-05-2007 12:33 AM

Hello,
I'm having a slight problem with the Adsense displayed in the first post. I'm using this code to display the ads:
<if condition="$post[postcount] % $vboptions[maxposts] == 1">

But then it gives me an alignment problem when the post is short. How can I fix this problem? Thanks.

http://i116.photobucket.com/albums/o...nseproblem.jpg

Webs007 01-05-2007 07:29 AM

Hi,

I am using the code as specified on Page 1 - Works fine - only problem is it puts the code under every post when you click to read a pm - and because of this - pushs he design out, is there a way not to show it when reading messages in the pm center?

Hope someone can help.

Webs :)

amykhar 01-05-2007 11:55 AM

Marketprofits, I use clear in the style for the post button alignment problem.

Webs, there is a conditional you can use to determine if it's a postbit or a pm. If you look at the code for showing the quote or quick reply icons, you'll see the conditional and can use it to wrap around the banner code.

BigJimTheLug 01-28-2007 04:45 PM

Quote:

Originally Posted by amykhar (Post 1151277)
Marketprofits, I use clear in the style for the post button alignment problem.

Where can I change this?
How can I change this?

Thank you.

wtrk 02-05-2007 01:06 AM

works for me in postbit_legacy in 3.6.4 BUT.. the width isnt 100% (even though it says 100% in the table).

wtrk 02-06-2007 01:20 AM

Quote:

Originally Posted by xtremeoff-road (Post 785704)
Use this code:

Code:

</div>
<!-- / post $post[postid] popup menu -->

<if condition="$show['spacer']">
        </div>
        $spacer_close
</if>
<!-- / post #$post[postid] -->

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

$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">
                BANNER CODE HERE
        </td>
</tr>
</table>

</div>
$spacer_close

</if>

You can see an example HERE

after going through the tread again trying everybody examples, this one fixed my problem with the box not being the whole 100% width even though the table says 100% width.. go figure.. thanks :)

pedrambayat 02-12-2007 06:34 PM

can not flash!!!!

varkjie 02-12-2007 11:14 PM

I just added this and it's applying ads after every single post... I want it just after the 1st post what did I do wrong?

varkjie 02-12-2007 11:30 PM

nevermind I forgot to copy the first sentence... duh me!

Silmarillion 03-26-2007 08:16 AM

Hmmm...i`ll give it a try. (Ads within Post) But with the following Code....

Code:

  <if condition="$show['guest']">
<span style="float:right;margin:2px;" width="301" height="251">
<if condition="!$GLOBALS['FIRSTPOSTID']">
===YOUR AD CODE===
</if></span></if>

...the Ads isn`t placed correctly in all posts...example:

http://img412.imageshack.us/img412/8...probwi6.th.gif

(have a look at the "quote"- "up"- and "down"-buttons...same problem to some signatures)
Any ideas to resolve those (optical) problems?

CORSO 07-26-2007 10:21 PM

Quote:

Originally Posted by Smitty (Post 1066866)
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 -->


I use this code, but don?t work, blank page again...

junkeeper 08-04-2007 03:44 AM

I just found out if you use this code you will have problem if member change the sorting to Linear Newest !! The ads will moved to the last post and not after the 1st post anymore

HTML Code:

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

But this code worked great

HTML Code:

<if condition="!$GLOBALS['FIRSTPOSTID']">
Can anyone tell me why the first code is preferable?

mcyates 08-12-2007 09:12 AM

Are there any fixes for this problem.

offline 09-18-2007 09:28 PM

I have set this up so that it does not show up on private messages and that it shows after the 1st, 5th and 10th post, so that I get 3 ads on each full page of posts. Here is my code...


Code:

<!-- Start Sponsors -->
<if condition="(THIS_SCRIPT!='private') && (((($post[postcount]-1)%10 == 0)|(($post[postcount]-5)%10 == 0)))">

$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" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-right: 0px" $post[scrolltothis] width="100%">
Sponsors<br /><br />
</td>
</tr>
<tr>
        <td class="alt1" align="center">

<script type="text/javascript"><!--
google_ad_client = "xxxxxxxxxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-09-17: Chattanoogans-POSTBIT
google_ad_channel = "xxxxxxxxx";
google_color_border = "F0F1FF";
google_color_bg = "F0F1FF";
google_color_link = "0000FF";
google_color_text = "5B5B5B";
google_color_url = "5B5B5B";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
</tr>
</table>

</div>
$spacer_close
</if>
<!-- End Sponsers -->

You can view it in action at http://www.chattanoogans.com/forums/...tanoogans.html .

The PROBLEM I am having is in the postbit_legacy, for whatever reason this breaks mutiquoting and quick reply buttons. If anyone has a clue how to fix those I would appreciate any help.

offline 09-18-2007 10:08 PM

I figured it our finally, I took the spacer_open and close out of the equation and it works. Here is my final code...

Code:

<!-- / post $post[postid] popup menu -->

<!-- Start Sponsors -->
<if condition="(THIS_SCRIPT!='private') && (((($post[postcount]-1)%10 == 0)|(($post[postcount]-5)%10 == 0)))">


<div style="padding:6px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-right: 0px" $post[scrolltothis] width="100%">
Sponsors<br /><br />
</td>
</tr>
<tr>
        <td class="alt1" align="center">

<script type="text/javascript"><!--
google_ad_client = "xxxxxxxxxxxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-09-17: Chattanoogans-POSTBIT
google_ad_channel = "xxxxxxxxxxxxxxxxx";
google_color_border = "F0F1FF";
google_color_bg = "F0F1FF";
google_color_link = "0000FF";
google_color_text = "5B5B5B";
google_color_url = "5B5B5B";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
</tr>
</table>
</div>
</if>
<!-- End Sponsers -->

I am running 3.6.8 with the postbit legacy template, works like a champ now.

hollyboy 08-16-2008 10:40 AM

Code:

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

this helps all the ones with the FF problem of the blank page after the quick reply ;)

Riccardo83 02-02-2009 10:23 AM

Guys, do u have any idea how about the problem when u place the Large Rectange or any ad in the last or first post, and you have quotes in there?

It messes up the design...?

Michael.A 05-09-2009 09:59 PM

Code:

<!-- Start Sponsors -->
<if condition="(THIS_SCRIPT!='private') && (((($post[postcount]-1)%10 == 0)|(($post[postcount]-5)%10 == 0)))">


<div style="padding:6px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="thead" style="font-weight:normal; border: $stylevar[cellspacing]px solid $stylevar[tborder_bgcolor]; border-right: 0px" $post[scrolltothis] width="100%">
Sponsored Ads</td></tr>
<tr>
        <td class="alt1" align="center">

<google adds goes here>

</td>
</tr>
</table>
</div>
</if>
<!-- End Sponsers -->

use this

rtyagis 10-30-2009 01:16 PM

Code:

<!-- Start Sponsors -->
<if condition="!in_array($forum[forumid], array(1,2,3))">
<if condition="$post[postcount] % $vboptions[maxposts] == 1">
$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="alt1" align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-846432XXXXXXXX";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
//2007-09-17: Chattanoogans-POSTBIT
google_ad_channel = "xxxxxxxxx";
google_color_border = "F0F1FF";
google_color_bg = "F0F1FF";
google_color_link = "0000FF";
google_color_text = "5B5B5B";
google_color_url = "5B5B5B";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

</td>
</tr>
</table>

</div>
$spacer_close
</if>
</if>
<!-- End Sponsers -->

With out heading - Sponsors


All times are GMT. The time now is 04:21 AM.

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.01553 seconds
  • Memory Usage 1,873KB
  • 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
  • (14)bbcode_code_printable
  • (2)bbcode_html_printable
  • (3)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)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