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)

caliman 12-03-2005 07:07 PM

This rules!
Works great with phpadsnew.

THANK YOU.
(INSTALLED)

Xplorer4x4 12-03-2005 08:11 PM

Quote:

Originally Posted by romow
As this thread gets bigger with many updates, it's kinda difficult to find out what the most up-to-date and error-free version for this mod is.
Can someone post the clean version?
Is the one posted in the original thread most up-to-date?

Thought you didn;t want to compromise the loading time for member.:rolleyes: There is a search feature, or try readonf from the last page backwards. ;)

MissKalunji 12-03-2005 09:38 PM

Quote:

Originally Posted by Xplorer4x4
Thought you didn;t want to compromise the loading time for member.:rolleyes: There is a search feature, or try readonf from the last page backwards. ;)


i used an iframe so the whole page loads then th iframe loads up so the loading isnt a problem

Xplorer4x4 12-03-2005 09:52 PM

I would like to see that code just out of curiosity. :)

Either way your are still making vB calculate where to place the Ad(s), and the ads have to be loaded, so what diffrence does it make? It is still loading thesame amount of data.

Teegtahn 12-04-2005 03:15 PM

Thanks man, Great help to me & my site - And I've adapted the code to put it in other locations as well.

Thanks again

*Installs

MissKalunji 12-04-2005 09:47 PM

Quote:

Originally Posted by Xplorer4x4
I would like to see that code just out of curiosity. :)

Either way your are still making vB calculate where to place the Ad(s), and the ads have to be loaded, so what diffrence does it make? It is still loading thesame amount of data.


its true but it will loads the forum first (wich lets u do what u want) then loads the add....i tried both and i saw a diff

but then again im not using it with adsense im using iwth another add company....

Slapyo 12-09-2005 12:28 AM

what would be the conditional so it doesn't display on the private messages pages?

THIS_SCRIPT != '???????'

Xplorer4x4 12-09-2005 03:58 AM

Quote:

Originally Posted by MissKalunji
its true but it will loads the forum first (wich lets u do what u want) then loads the add....i tried both and i saw a diff

but then again im not using it with adsense im using iwth another add company....

I might try that method although I am thinking to make it work I would have to add my google ads code into a PHP or HTML script. Which I am curious as to which would be the better format to use?

I would like to test it. :)

Xplorer4x4 12-09-2005 05:25 AM

Quote:

Originally Posted by Slapyo
what would be the conditional so it doesn't display on the private messages pages?

THIS_SCRIPT != '???????'

It seems to me as it would be impossible to display ads in your PMs without editng any of PM templates.

Slapyo 12-09-2005 01:25 PM

Quote:

Originally Posted by Xplorer4x4
It seems to me as it would be impossible to display ads in your PMs without editng any of PM templates.

Are you saying it doesn't display by default and that to make them show up you have to edit PM templates? If so good ... I just didn't want them showing up in there.

Xplorer4x4 12-09-2005 03:31 PM

Quote:

Originally Posted by Slapyo
Are you saying it doesn't display by default and that to make them show up you have to edit PM templates? If so good ... I just didn't want them showing up in there.

Yes thats what I am saying, but the hack is adsence after first post, not after first PM, or in PMs...

Slapyo 12-10-2005 12:33 AM

Quote:

Originally Posted by Xplorer4x4
Yes thats what I am saying, but the hack is adsence after first post, not after first PM, or in PMs...

Awesome.

WhatChaMissin 12-14-2005 04:27 PM

Quote:

Originally Posted by xtremeoff-road
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

Thanks this worked perfectly for my site

Areku 12-15-2005 04:15 AM

I know its a shame, but can this hack be adapted to a vb2.x?

Warrior 12-15-2005 01:09 PM

This hack still does not work with the quick reply for me... only the first post's quick reply icon functions... using this:

Code:

<!-- Sponsored Links -->
<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">

AMAZON AFFILIATE CODE

GOOGLE AFFILIATE CODE


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

</div>
$spacer_close

</if>


Warrior 12-15-2005 04:30 PM

Here is a quick reply compatible version ...

kau 12-18-2005 07:05 AM

Does this not work with 3.5.2? Does nothing after I add it to the bottom of postbit

harpez 12-18-2005 09:39 AM

This still works perfectly for me! (like it did with 3.5.0 and 3.5.1) I have honestly NEVER had a problem with it!

Xplorer4x4 12-18-2005 12:43 PM

Quote:

Originally Posted by jluerken
Ok its working for me now.

It seems that it had something to do with the <div> Tags.

Here my solution:

At the end of the postbit template at:

PHP Code:

<!-- ADs after first forum post -->
<if 
condition="!is_member_of($bbuserinfo, 5,7) AND !$GLOBALS['FIRSTPOSTID']">  
<if 
condition="$show['spacer']">
    <
div>
    
$spacer_open
</if>
  <
table class="tborder" id="post$post[postid]cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
    <
tr
<
td class="alt2" width="17%" nowrap>
$vbphrase[google_ads_hint]
</
td>
<
td class="alt2" width="83%">
<
center>

YOUR AD HERE

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

<if 
condition="$show['spacer']">
    </
div>
    
$spacer_close
</if>
</if> 

Create a global phrase called "google_ads_hint" to get some text beside your ads like on my screenshot.
Remove the whole TD tag if you don't want this.

Hmm i changed it slightly. There was a few extra code in there i think. $spacer_open is being procesed but $spacer_close is not.
PHP Code:

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

    
$spacer_open
  
<table class="tborder" id="post$post[postid]cellpadding="$stylevar[cellpadding]cellspacing="$stylevar[cellspacing]border="0" width="100%" align="center">
    <
tr
<
td class="alt2" width="17%" nowrap>
$vbphrase[google_ads_hint]
</
td>
<
td class="alt2" width="83%">
<
center>

YOUR AD HERE

</center>
</
td>


</
div>
$spacer_close

</if> 

Even with your code it is still not spacing properley.

kau 12-18-2005 04:41 PM

What am I missing then?

I even simplified it to:

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

In my postbit and even that doesn't work. Nothing shows up!!

kau 12-18-2005 05:10 PM

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

That doesn't do anything either.

kau 12-18-2005 06:18 PM

So I found out that it's not postbit anymore you have to add it to it's postbit legacy

ConqSoft 12-18-2005 06:20 PM

It can be postbit or postbit_legacy, depending on which option you have chosen for your site.

croportal 12-23-2005 08:15 PM

what a weird problem

when i put this code:

Quote:

<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%" <td align="center">
<tr>
<td class="thead" align="left">SpinZone Sponsored Links</td>
</tr>
<tr>
<td class="alt1" align="center">
ADSENSE CODE HERE

</td>

</tr>
</table>

</div>
$spacer_close

</if>
all work fine

but when i put this code:

Quote:

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

$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 here>
</if>
</td>
</tr>
</table>

</div>
$spacer_close

</if>


when i go to post, after post open blank page

Moncal 12-26-2005 01:28 PM

Quote:

Originally Posted by Xplorer4x4
https://vborg.vbsupport.ru/showpost....9&postcount=78
I fixed it by changing the IF conidtion. If you read the thread everyone tried many diffrent variables for the IF condition but it was always the IF condition causing it to hang.

Here is the proper code:
PHP Code:

<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="thead" align="left">Sponsored Links</td
</
tr
<
tr
    <
td class="alt1" align="center"
        <
adsense code here
</if> 
    </
td
</
tr
</
table

</
div
$spacer_close 

</if> 


Thanks a lot. You really should release this in it's own thread because it took me ages to find. :)

Xplorer4x4 12-26-2005 01:35 PM

Quote:

Originally Posted by croportal
but when i put this code:

PHP Code:

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

$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 here>
</if>
    </
td>
</
tr>
</
table>

</
div>
$spacer_close

</if> 



when i go to post, after post open blank page

As stated earlier there is a second if condition in there causing the hang. In other words remove the if here:
PHP Code:

<adsense code here>
 </if> 


Treasure Quest 01-01-2006 03:09 PM

Hello,
I installed this hack and it works great.

I would also like to have this displayed after the last post. Where do I add the code?

Greg

Xplorer4x4 01-01-2006 03:18 PM

Quote:

Originally Posted by Treasure Quest
Hello,
I installed this hack and it works great.

I would also like to have this displayed after the last post. Where do I add the code?

Greg

You would need to combine the if condition from this hack to the one here:
PHP Code:

<if condition="$post['islastshown']"


http://www.vbulletin.com/forum/showthread.php?t=157022
Offers several varations.

Treasure Quest 01-01-2006 03:36 PM

Thanks,

Then would the code look like this to display the adsense on first and last posts?

Code:

<if condition="!$GLOBALS['FIRSTPOSTID']">
<if condition="$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 code here>
</if>
    </td>
</tr>
</table>

</div>
$spacer_close

</if>


Treasure Quest 01-01-2006 07:37 PM

I keep getting an error, is there another option I could try?

Greg

Orcun 01-02-2006 09:16 PM

Which file should I put this hack ? I cant find postbit_legacy

Xplorer4x4 01-02-2006 10:38 PM

@Treasure Quest, please provide the error as that might hel resolve the problem.

@Orcun, postbit_legacy is a template, not a file.

Treasure Quest 01-03-2006 12:04 AM

Now when I add this code to the bottom of postbit I'm not getting any banners at all.

Code:

<if condition="!$GLOBALS['FIRSTPOSTID']">
<if condition="$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 code here>
</if>
    </td>
</tr>
</table>

</div>
$spacer_close

</if>


Rukas 01-05-2006 02:09 AM

I keep getting the blank page after the quick reply problem, and Ive removed the second </if> tag. Any ideas?

bashy 01-07-2006 02:06 PM

Hi peeps

How can i center this as its to the left atm..?

Regards

Bashy

Matt_270581 01-08-2006 02:31 AM

Quote:

Originally Posted by Rukas
I keep getting the blank page after the quick reply problem, and Ive removed the second </if> tag. Any ideas?

Firefox problem. Works fine in IE. I had to remove this as some of my members were complaining about this firefox issue.

There's also an issue with Ad's appearing multiple times after submitting a post and Appearing after Every usernote.

iizeusii 01-08-2006 11:54 AM

Quote:

Originally Posted by Matt_270581
Firefox problem. Works fine in IE. I had to remove this as some of my members were complaining about this firefox issue.

There's also an issue with Ad's appearing multiple times after submitting a post and Appearing after Every usernote.


They also appear after every comment in photopost gallery.

FinestFaces 01-17-2006 06:16 AM

I'm having the same problem. I removed it as well, it was taking awhile to load.

Snake 01-25-2006 02:39 PM

How can I show the adsense below the LAST post?

amykhar 01-25-2006 06:49 PM

Find my code snippet in here and it will tell you how to see which post is last. Then, it's a matter of putting it where you like it.

The other option is to put it in the showthread template right after the posts.


All times are GMT. The time now is 09:54 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.03350 seconds
  • Memory Usage 1,881KB
  • 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
  • (4)bbcode_code_printable
  • (6)bbcode_php_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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