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)

artonex 09-13-2005 10:00 PM

Adsense after first post
 
Hey guys i think many of you will find this very usefull :)

With the template edit you can display adsense or banner after every 1st post. i have chosen to use my amazon affilite code.

Add this to the bottom of your postbit template.

Demo

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> 


jluerken 09-14-2005 11:26 AM

Hi,

I want to have the adsense stuff for people NOT in specific groups.

For example: Admins, mods, staff etc. should not get the adsense stuff.

Can you give an example how to modify your template to make this possible?

btw. thanks for sharing :D

jugo 09-14-2005 12:01 PM

Didn't Kirby post this somewhere??

Thanks anyway.

Andreas 09-14-2005 12:04 PM

Yup.
https://vborg.vbsupport.ru/showpost....10&postcount=2 :)

Mental Note: Tagging the post was a good idea :D

junkiesnetwork 09-14-2005 04:00 PM

Quote:

<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>
This idea sounds great but i tried using it on my board but it did not work.
i copied this code and pasted at the end of postbit template as you said and i put all the adsense code in this space u provided , if i am not mistaken. (<adsense code here> )
Could you please tell me where i went wrong??
Thanks

sajjid 09-14-2005 05:02 PM

try this one
Code:

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

change the text what ever you want where its says spinzone sponsered links

amykhar 09-14-2005 05:51 PM

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>


Andreas 09-14-2005 06:10 PM

Hmm, keeping database read marking in mind:
Wouldn't the first unread post be the best place?
Cause the last Post doesn't necessarily get read - the first unread post will.

amykhar 09-14-2005 06:22 PM

True. But, is there a conditional for it?

Andreas 09-14-2005 06:24 PM

There must be as Posts carry Icons for Read/Unread.
So if this Icon changes to Unread for the first time it is the right Post.

dieselpowered 09-14-2005 08:12 PM

Quote:

Originally Posted by KirbyDE
Yup.
https://vborg.vbsupport.ru/showpost....10&postcount=2 :)

Mental Note: Tagging the post was a good idea :D

Kirby forgive my ignorance, however, where does this post show how to do a conditional based on the usergroup?

I am going to be adding adsence, however, do not want contributing members or sponsors to see them.

Any help is appreciated!!

Andreas 09-14-2005 08:18 PM

I've posted this often already, but i'll post it once again :)

<if condition="!is_member_of($bbuserinfo, x, y, z) AND !$GLOBALS['FIRSTPOSTID']">

dieselpowered 09-14-2005 08:28 PM

Quote:

Originally Posted by KirbyDE
I've posted this often already, but i'll post it once again :)

<if condition="!is_member_of($bbuserinfo, x, y, z) AND !$GLOBALS['FIRSTPOSTID']">

Sorry, you are going to fly out from Germany and kill me, however, I assume I put the usergroup number of the usergroup I do not want to see this in place of the x, y, z??

Thanks :)

Andreas 09-14-2005 08:29 PM

Yep (regarding the replacement of x, y and z).

dieselpowered 09-14-2005 08:35 PM

Quote:

Originally Posted by KirbyDE
Yep (regarding the replacement of x, y and z).

LOL I thought you were talking about the flying out part ;)

Thanks Kirby!!

Hey I seem to remember a thread one of the vBulletin Devs put out in regards to adding adsense....it had quite a few examples. Do you remember that?

dieselpowered 09-14-2005 08:46 PM

That is odd, I placed the usergroup 1 (admin) in that code and it still shows the adsense?

**edit** disregard, it did remove it, however, completely did something odd with the formatting?? When I get home I will get a screen print.

artonex 09-14-2005 08:47 PM

Quote:

Originally Posted by KirbyDE
I've posted this often already, but i'll post it once again :)

<if condition="!is_member_of($bbuserinfo, x, y, z) AND !$GLOBALS['FIRSTPOSTID']">


Thanks kirby works great :D

Andreas 09-14-2005 08:48 PM

Usergroup 1 is Guest, not Admin?

dieselpowered 09-14-2005 08:51 PM

Quote:

Originally Posted by KirbyDE
Usergroup 1 is Guest, not Admin?

I know....I meant 6....sorry about that.

Somehow it messes up the formatting on the page, I will get a screenshot to show. Thanks as always Kirby!

Gio~Logist 09-14-2005 09:13 PM

Quote:

Originally Posted by jluerken
Hi,

I want to have the adsense stuff for people NOT in specific groups.

For example: Admins, mods, staff etc. should not get the adsense stuff.

Can you give an example how to modify your template to make this possible?

btw. thanks for sharing :D


try replacing

HTML Code:

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

HTML Code:

<if condition="!$GLOBALS['FIRSTPOSTID'] and
$vbulletin->userinfo[usergroupid] != 'x' "
>


Then replace x with the usergroupid that you do NOT want this ad to show for.

dieselpowered 09-14-2005 09:20 PM

Quote:

Originally Posted by gio~logist
try replacing

HTML Code:

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

HTML Code:

<if condition="!$GLOBALS['FIRSTPOSTID'] and
$vbulletin->userinfo[usergroupid] != 'x' "
>


Then replace x with the usergroupid that you do NOT want this ad to show for.

Thank you...unfortunately, it still shows for admin??

artonex 09-14-2005 09:22 PM

you must be doing something crazy xtremeoff-road as kirbys code works for me.

Gio~Logist 09-14-2005 09:23 PM

Keep adding
Code:

and  $vbulletin->userinfo[usergroupid] != 'x'
For every usergroup that you do not want to have to see that.

Andreas 09-14-2005 09:23 PM

I think this Code won't work, as $vbulletin is not within the Scope of the Postbit Class.

Gio~Logist 09-14-2005 09:24 PM

I can be wrong though.

dieselpowered 09-14-2005 09:27 PM

Quote:

Originally Posted by artonex
you must be doing something crazy xtremeoff-road as kirbys code works for me.

Don't get me wrong the code does work, however, throws off the formatting.

I will get a screen shot when I get home.

Xplorer4x4 09-23-2005 08:53 PM

I tried a few methods I found at vb.com and vb.org. This one is the only one that would work for me. Just one problem is that after I make a quick reply, the sponsoered link header apears BUT the ads do not show. In other words it hsouldn't show up at all. Oh well it got ads betwen the first and second post so I'm happy!

joeychgo 09-24-2005 08:27 AM

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




amy - you might want to check with Google. The way you have the ad placed inside the post may violate their TOS. You can email adsense and ask for a review.

Chad F. 09-26-2005 04:38 AM

<a href="http://img339.imageshack.us/img339/1489/bannerproblem0cy.gif" target="_blank">http://img339.imageshack.us/img339/1...problem0cy.gif</a>

^ Does anyone else get this problem after editing a post?..

Marco van Herwaarden 09-26-2005 04:47 AM

I am not using this hack, but something similar i created myself, and i have the same if using quick reply. Doesn't bother me enough to search for a fix.

GrendelKhan{TSU 09-27-2005 01:06 AM

Quote:

Originally Posted by KirbyDE
Hmm, keeping database read marking in mind:
Wouldn't the first unread post be the best place?
Cause the last Post doesn't necessarily get read - the first unread post will.

interestingly, I find I read the last post more often than the first post on many forums (except on this forum...where the first post is the meat and where the download is).

or at least, I read the last post first as that's what shows up on the forumindex, and many threads are ones I follow for new posts.

just making a point. ;)

amykhar 09-27-2005 01:18 AM

Quote:

Originally Posted by MarcoH64
I am not using this hack, but something similar i created myself, and i have the same if using quick reply. Doesn't bother me enough to search for a fix.

Marco, my code fixes the quick reply problem.

trilljester 09-27-2005 09:05 PM

Quote:

Originally Posted by amykhar
Marco, my code fixes the quick reply problem.

Amy, I see on your site you have Adsense in your header, and also in the messages. Do you notice that sometimes the Adsense ads don't show up in the message thread, and are blank?

This happens often when there's multiple Adsense ads on the same page for me.

jribz 09-27-2005 10:00 PM

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.

amykhar 09-27-2005 10:15 PM

Yep. Generally, my adsense goes to my alternate ad broker though.

trilljester 09-27-2005 10:31 PM

Okie doke, I'll do that.

It looks great except when there's a quote in the last message, then it shifts everything off by a little. I'm torn now between using Amy's or the "just after the first post" deal. Hrmmm...decisions decisions... :nervous:

amykhar 09-28-2005 12:01 AM

I tinkered with my quote template to make the div not have a width of 100%. When I removed that, it solved the problem.

Chad F. 09-28-2005 03:55 AM

Quote:

Originally Posted by amykhar
Marco, my code fixes the quick reply problem.

Amy, can you please give me the link to your code? I just searched around and I wasn't able to find it but maybe I'm just overlooking it..

trilljester 09-28-2005 08:51 PM

Quote:

Originally Posted by amykhar
I tinkered with my quote template to make the div not have a width of 100%. When I removed that, it solved the problem.

I set mine to 70% on both the div and table in my quote template and that fixed the problem. Thanks so much Amy! :cheeky:

ukbill69 10-01-2005 01:59 PM

might want to add it to postbit_legacy


All times are GMT. The time now is 04:52 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.01461 seconds
  • Memory Usage 1,837KB
  • 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
  • (4)bbcode_html_printable
  • (1)bbcode_php_printable
  • (15)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
  • (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