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)

ukbill69 10-01-2005 02:27 PM

Also easier if you make the <adsense code here> into a phrase like $vbphrase[postadvert]

and then it would be easy to update and not search through code everytime to change.

thenetbox 10-02-2005 03:07 AM

I put this in postbit_legacy and when I use firefox to post a quick reply it goes to a Blank page. Now that I have removed it from postbit_legacy it has started working fine again.
It happens with KirbyDEs code as well.

Is there another way to get this working? or do we know why this is happening?

This was working okay before I updated.

thanks :)

Aceman 10-03-2005 12:26 PM

After getting this running.. I've noticed that my QUICK EDIT no longer works?

I used the following code:

Code:

<!-- Google Ads for NON members -->

<if condition="!is_member_of($bbuserinfo, 2,5,6,7,8,11,18) AND !$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> 


<!-- END Google Ads for NON Members -->

Anyone know why this would be happening?

Aceman 10-03-2005 12:30 PM

Question: Why does the </if> go before the </td> rather then placing it after the </div> tag?? would this fix this?

(I'll test and see)

Aceman 10-03-2005 12:37 PM

PUT THE </if> after $spacer_close and everything is working fine now.

PS: postbit_legacy template.

dastar 10-03-2005 01:27 PM

Never mind.

Xplorer4x4 10-03-2005 01:58 PM

Quote:

Originally Posted by Aceman
PUT THE </if> after $spacer_close and everything is working fine now.

PS: postbit_legacy template.

THANK YOU! I didn;t know what hack was causing the problem. Thank you!

This still has not fixed the issue when you save though.

Mijae 10-04-2005 12:49 AM

One thing that I noticed is that if you use the quick reply, you'll get a second instante of the Sponsored Links table, but without the google adsense code. It goes away when you refresh.

Not a big deal, but something I discovered. Probably just my forums :P

dieselpowered 10-04-2005 01:11 AM

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

talkhost 10-05-2005 06:10 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>



Do you know how to put the ads in the first and last post of each page of the thread, instead of just the first post of the first page..

I'm also having a problem with using the quick reply. The ads don't show in the last post unless the page is refreshed..

hivelord 10-05-2005 09:42 PM

Yes, you have an extra </if> in the code. Just take it out like so:
HTML 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 HERE
    </td>
</tr>
</table>

</div>
$spacer_close

</if>

Works great. I was having a small Template issue with the old code.

Shoemoney 10-07-2005 01:32 PM

are you guys using quick reply? My forum seems to hang with this code and quick reply..

dsotmoon 10-07-2005 01:39 PM

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

dieselpowered 10-07-2005 02:57 PM

Quote:

Originally Posted by Shoemoney
are you guys using quick reply? My forum seems to hang with this code and quick reply..

The Javascript in the adsense is messing it up.

If you notice, you can probably click on the quick reply in the first post, however, everything after the first post will not work.

If your thread has multiple pages, you will notice that you can click on the quick reply of the first post of every page and it will work. All others do not :(

dsotmoon 10-07-2005 03:20 PM

Quote:

Originally Posted by xtremeoff-road
If you notice, you can probably click on the quick reply in the first post, however, everything after the first post will not work.

QR works on every post on my forums with the code you posted above

dieselpowered 10-07-2005 03:27 PM

Quote:

Originally Posted by dsotmoon
QR works on every post on my forums with the code you posted above

Do you have it set up that the user must click to use quick reply?

Or can they just start typing?

dsotmoon 10-07-2005 09:00 PM

Quote:

Originally Posted by xtremeoff-road
Do you have it set up that the user must click to use quick reply?

Or can they just start typing?

its always at the bottom or they can click QR from any post to go to it

dieselpowered 10-07-2005 09:14 PM

Quote:

Originally Posted by dsotmoon
its always at the bottom or they can click QR from any post to go to it

I understand that....my question was can they just start typing in the Quick Reply or do they need to hit the QR button?

dsotmoon 10-07-2005 09:27 PM

Quote:

Originally Posted by xtremeoff-road
I understand that....my question was can they just start typing in the Quick Reply or do they need to hit the QR button?

oh sorry, they can just start typing in it

dastar 10-07-2005 11:45 PM

Try this code to eliminate the problem with the quick reply button not working.

After submitting a reply via the QR box, FireFox hangs on me unless I use the smaller, "link unit" google ads.



Code:


<if condition="$post[postcount] % 10 == 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">
    Adsene Code here.
    </td>
</tr>
</table>

</div>
$spacer_close

</if>


dsotmoon 10-09-2005 04:23 PM

i have confirmed now too that the following code hangs in firefox using the quick reply, anyone know a way to fix it?

Code:

<if condition="!is_member_of($bbuserinfo, 6, 7, 17, 18) AND !$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        </td>
</tr>
</table>

</div>
$spacer_close

</if>


Funchiestz 10-10-2005 03:48 PM

Quote:

Originally Posted by dsotmoon
i have confirmed now too that the following code hangs in firefox using the quick reply, anyone know a way to fix it?

Code:

<if condition="!is_member_of($bbuserinfo, 6, 7, 17, 18) AND !$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        </td>
</tr>
</table>

</div>
$spacer_close

</if>


so do i can not work... nothing changes, thanx anyway

UK Jimbo 10-10-2005 06:09 PM

Similar hack but does random positioning
https://vborg.vbsupport.ru/showthread.php?t=98057

Aaron RV 10-12-2005 07:02 AM

not work. :disappointed:

nobita 10-12-2005 11:55 AM

Quote:

Originally Posted by Aaron RV
not work. :disappointed:

it works very good :)>-

Demo: http://www.vimaru.org/forum/showthre...7120#post27120

jluerken 10-12-2005 12:58 PM

Hi,

I agree to Funchiestz and dsotmoon, Quick Reply is not working after the adsense for all usergroups who 'must' see it :D
In the first post its working fine, the ads quick reply stops working.

I removed the adsense code to test if it has something to do with this but it has not.

I tested with IE and Firefox and in both Quick Reply is not working after the first post.

Must have something to do with:

PHP Code:

<if condition="!is_member_of($bbuserinfo, 5,6,7) AND !$GLOBALS['FIRSTPOSTID']"

I will ask KirbyDE if he can help. He is a genius in vB Coding.

Andreas 10-12-2005 01:13 PM

Untested, but what about
Code:

<if condition="!is_member_of($bbuserinfo, 5,6,7) AND !$GLOBALS['FIRSTPOSTID'] AND !$_POST['ajax']">

jluerken 10-12-2005 03:18 PM

Quote:

Originally Posted by KirbyDE
Untested, but what about
Code:

<if condition="!is_member_of($bbuserinfo, 5,6,7) AND !$GLOBALS['FIRSTPOSTID'] AND !$_POST['ajax']">

No that did not solve the problem.
I deleted the whole IF statement and only entered a simple text line.
Even then then quick reply is not working anymore after the first post.

Seems to be deeper in vBulletin

jluerken 10-12-2005 03:28 PM

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:

HTML 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.

cedced 10-12-2005 04:28 PM

have version for vbb 3.03 ?

dsotmoon 10-12-2005 04:41 PM

that code still hangs up on QR for me in firefox :ermm:

oezer 10-12-2005 06:58 PM

Quote:

Originally Posted by jribz
trilljester, not to answer for Amy, but I don't think that's an issue related to the hack, if there aren't enough ads to display or google adsense bot has not picked the page up yet, which is rare, it will display the alternate color or alternate ad you have in place. So just specify an alternate ad in your adsense code for those times when it doesn't show up.

i did another alternate type of adsense, but it displays me nothing.. have you any ideas?

regards

Xplorer4x4 10-20-2005 08:22 AM

Good news and bad news. I have a fix, but it does not stop at the first post! If you use this be advised it will place Ads between EVERY post!

REPLACE
PHP Code:

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

with
PHP Code:

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

So maybe with this some one can get a fix to make this stop AFTER the first post?

EDIT:On second notice, it places full ads under the first 3 posts. Then it apears to form a empty sponsored link table under the rest of the post. This happen in FireFox.

IN IE..it apers after the first post, and using the quick reply forms an empty table under the last post.

Arto 10-22-2005 01:43 PM

Quote:

Originally Posted by Xplorer4x4
Good news and bad news. I have a fix, but it does not stop at the first post! If you use this be advised it will place Ads between EVERY post!

EDIT:On second notice, it places full ads under the first 3 posts. Then it apears to form a empty sponsored link table under the rest of the post. This happen in FireFox.

No surprise there, as the AdSense Terms of Service explicitly limits you to 3 AdSense blocks per page ;) ...I suspect trying to display more than 3 ads is in fact a good way to get your account flagged for inspection :ermm:

oezer 10-22-2005 10:42 PM

Quote:

Originally Posted by Arto
I suspect trying to display more than 3 ads is in fact a good way to get your account flagged for inspection :ermm:

on my forum i have 2 different views of adsense but they display only one ad.. have you any ideas?

regards

Arto 10-23-2005 11:22 AM

Quote:

Originally Posted by oezer
on my forum i have 2 different views of adsense but they display only one ad.. have you any ideas?

That can happen when Google doesn't have enough targeted ads to fill your page view inventory. You can either try to improve the AdSense targeting on the forum, show less ad blocks per page (to ensure there's enough ads for the one you do show), or configure an Alternate URL in AdSense to show ads or banners from another ad network in cases when Google won't serve you.

Improving your AdSense targeting and revenue is really a science unto itself; I recommend you read up on the topic on forums such as Digital Point or Site Point.

Xplorer4x4 10-24-2005 11:45 PM

Quote:

Originally Posted by Arto
No surprise there, as the AdSense Terms of Service explicitly limits you to 3 AdSense blocks per page ;) ...I suspect trying to display more than 3 ads is in fact a good way to get your account flagged for inspection :ermm:

True but atleast its a start for getting this firefox bug fixxed.

Xplorer4x4 10-25-2005 03:06 AM

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' "


banshee 10-25-2005 01:18 PM

**Installed**

Works great thanks, has anyone notices an increas in revenue from this add-in? I average only $5 a day right now not sure if that is good or bad but I will be curious if I get more revenue because of this or not. I know I get ads on some threads that have nothing to do with my site because of some off-topic threads.

Slapyo 10-25-2005 02:45 PM

i've been going through this thread but can't seem to find code that works. :/ i see a bunch of different versions posted up.

i'm just looking to place 1 ad after the first post.


All times are GMT. The time now is 04:20 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.01665 seconds
  • Memory Usage 1,867KB
  • 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
  • (9)bbcode_code_printable
  • (2)bbcode_html_printable
  • (6)bbcode_php_printable
  • (16)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