Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Google Adsense After first post (with scrolling option) Details »»
Google Adsense After first post (with scrolling option)
Version: 1.00, by xMrCanadax xMrCanadax is offline
Developer Last Online: Sep 2020 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.x.x Rating:
Released: 09-10-2011 Last Update: Never Installs: 36
Template Edits
Re-useable Code  
No support by the author.

How To Install
Step.1:
GoTo Styles & Templates>Search in Templates>your style then search for "postbit_legacy" without quotations.

at the very bottom before "{vb:raw template_hook.postbit_end}"
add :

Code:
<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
   Your Google Adsense code here
</li>
</vb:if>
Step 2: (centering and coloring your adsense)
GoTo Styles & Templates>Search in Templates>your style then search for additional.css and anywhere add :

Code:
.firstpost_advert_container {
    clear: both;
    display: block;
    float: left;
    margin-bottom: 12px;
    position: relative;
    width: 100%;
    border: 1px solid #E5E6F4;
}

.firstpost_advert {
    with: 100%;
    background: #F1F1FA;
    border: 1px solid #fff;
    min-height: 90px;
    margin: 0;
    padding: 7px;
    text-align: center;
    vertical-align: middle;
}
Step 3: (IF YOU WANT SCROLL ONLY)
Code:
<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert"><marquee>
   Your Google Adsense code here
</marquee></li>
</vb:if>
Only add this if you want your banner to scroll. This can be used for others things other then adsense also.

You are finished! you can see a Demo Here

Customize the CSS as you wish. Hope this helped.

To exempt usergroups :

To exempt usergroups just do this

Replace :
<vb:if condition="$post['isfirstshown']

With :
<vb:if condition="$post['isfirstshown'] AND !in_array($bbuserinfo[usergroupid], array(X,Y,A))">

X,Y,A Being Usergroup ID's

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
AttalaEA, BlueCheri, goxy63

Comments
  #22  
Old 11-25-2011, 03:37 AM
xMrCanadax xMrCanadax is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by goxy63 View Post
Works juts great, my only problem is that adsense is showing after second post

Probably it is cause I use mod "first post on every page"
https://vborg.vbsupport.ru/showthrea...=239282&page=9

Any ideas, for now I left it under second post but I would like it under first as it is better like that I think.
Maybe to put it above "first post" in my case, lol ? (how to do that)

Thanks
Try disabling your other mod, it should work then?
Reply With Quote
  #23  
Old 11-25-2011, 09:42 AM
goxy63 goxy63 is offline
 
Join Date: Oct 2008
Location: its like another planet:D
Posts: 657
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xMrCanadax View Post
Try disabling your other mod, it should work then?
Yes, after disabling mentioned mod its just as it should be, that is GREAT

But my users already got use to this option (first post on every page), even I did...its kinda natural to have first one.... specially on forums where you have 100-200... pages

Not a coder just dont know how to fix this


Thanks
Reply With Quote
  #24  
Old 12-09-2011, 11:31 AM
datoneer datoneer is offline
 
Join Date: Jul 2011
Posts: 453
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I cannot see adsense ad. I have vb 4.1.8. Where's the problem?
Reply With Quote
  #25  
Old 12-17-2011, 06:20 AM
xMrCanadax xMrCanadax is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you show me what you see @datoneer?
Reply With Quote
  #26  
Old 03-09-2012, 11:42 AM
BlueCheri's Avatar
BlueCheri BlueCheri is offline
 
Join Date: Jul 2009
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working fine with upgrade.

G!
Reply With Quote
  #27  
Old 03-17-2012, 05:38 PM
chrisngrod's Avatar
chrisngrod chrisngrod is offline
 
Join Date: Oct 2010
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to mark this as installed. I am pretty sure I used your post to help me configure my pages.

I really hate the sites where it looks like they had some postbot insert the ads btw.

This is the code I inserted in my forum just in case people want to do something similar.

Quote:

<!--begin ads after first post-->

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

<vb:if condition="is_member_of($bbuserinfo, 1)">

<li class="firstpost_advert_container">
<div class="firstpost_advert">

<script type="text/javascript"><!--
google_ad_client = "ca-pub-1026739116117253";
/* CricketUsers (300 x 250 In Thread Box Ad) */
google_ad_slot = "6476112708";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<script type="text/javascript"><!--
google_ad_client = "ca-pub-1026739116117253";
/* CricketUsers (300 x 250 In Thread Box Ad) */
google_ad_slot = "6476112708";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<center>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-1.6.2-min.js'></script>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-ui-min.js'></script>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script>
<script charset="utf-8" type="text/javascript">
document.write('\x3Cscript type="text/javascript" charset="utf-8" src="http://adn.ebay.com/cb?programId=1&campId=5337045326&toolId=10026&cust omId=Thread&keyword=bad+esn&width=605&height=90&fo nt=4&textColor=000000&linkColor=373C6B&arrowColor= 8BBC01&color1=058A13&color2=FFFFFF&format=Html2&co ntentType=TEXT_AND_IMAGE&enableSearch=n&useeBayT=n &usePopularSearches=n&freeShipping=n&topRatedSelle r=n&itemsWithPayPal=n&descriptionSearch=n&showKwCa tLink=n&excludeCatId=&excludeKeyword=&catId=15032& disWithin=200&ctx=n&flashEnabled=' + isFlashEnabled + '&pageTitle=' + _epn__pageTitle + '&cachebuster=' + (Math.floor(Math.random() * 10000000 )) + '">\x3C/script>' );
</script>
</center>

<center>
<a href="/payments.php">Remove this advertisement</a>.
</center>

</div>
</li>


<vb:if condition="$adsshown[] = 2"></vb:if></vb:if><vb:if condition="is_member_of($bbuserinfo, 2)">

<li class="firstpost_advert_container">

<div class="firstpost_advert">

<script type="text/javascript"><!--
google_ad_client = "ca-pub-1026739116117253";
/* CricketUsers (300 x 250 In Thread Box Ad) */
google_ad_slot = "6476112708";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<script type="text/javascript"><!--
google_ad_client = "ca-pub-1026739116117253";
/* CricketUsers (300 x 250 In Thread Box Ad) */
google_ad_slot = "6476112708";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<br />


<script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-1.6.2-min.js'></script>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-ui-min.js'></script>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script>
<script charset="utf-8" type="text/javascript">
document.write('\x3Cscript type="text/javascript" charset="utf-8" src="http://adn.ebay.com/cb?programId=1&campId=5337045326&toolId=10026&cust omId=Thread&keyword=bad+esn&width=605&height=90&fo nt=4&textColor=000000&linkColor=373C6B&arrowColor= 8BBC01&color1=058A13&color2=FFFFFF&format=Html2&co ntentType=TEXT_AND_IMAGE&enableSearch=n&useeBayT=n &usePopularSearches=n&freeShipping=n&topRatedSelle r=n&itemsWithPayPal=n&descriptionSearch=n&showKwCa tLink=n&excludeCatId=&excludeKeyword=&catId=15032& disWithin=200&ctx=n&flashEnabled=' + isFlashEnabled + '&pageTitle=' + _epn__pageTitle + '&cachebuster=' + (Math.floor(Math.random() * 10000000 )) + '">\x3C/script>' );
</script>


</div>

<br />

<center>

<script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-1.6.2-min.js'></script>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/jquery-ui-min.js'></script>
<script type="text/javascript" src='http://adn.ebay.com/files/js/min/ebay_activeContent-min.js'></script>
<script charset="utf-8" type="text/javascript">
document.write('\x3Cscript type="text/javascript" charset="utf-8" src="http://adn.ebay.com/cb?programId=1&campId=5337045326&toolId=10026&cust omId=Thread&keyword=bad+esn&width=605&height=90&fo nt=4&textColor=000000&linkColor=373C6B&arrowColor= 8BBC01&color1=058A13&color2=FFFFFF&format=Html2&co ntentType=TEXT_AND_IMAGE&enableSearch=n&useeBayT=n &usePopularSearches=n&freeShipping=n&topRatedSelle r=n&itemsWithPayPal=n&descriptionSearch=n&showKwCa tLink=n&excludeCatId=&excludeKeyword=&catId=15032& disWithin=200&ctx=n&flashEnabled=' + isFlashEnabled + '&pageTitle=' + _epn__pageTitle + '&cachebuster=' + (Math.floor(Math.random() * 10000000 )) + '">\x3C/script>' );
</script>
</center>

<center>
<a href="/payments.php">Remove</a> this advertisement.
</center>

</li>

<vb:if condition="$adsshown[] = 12"></vb:if></vb:if><vb:if condition="is_member_of($bbuserinfo, 5, 6, 7, 10, 12, 15, 16, 17, 18, 19, 24)">

<vb:if condition="$bbuserinfo['field13'] == 'No'">

<vb:else />

<li class="firstpost_advert_container">

<div class="firstpost_advert">

<script type="text/javascript"><!--
google_ad_client = "ca-pub-1026739116117253";
/* CricketUsers (300 x 250 In Thread Box Ad) */
google_ad_slot = "6476112708";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<script type="text/javascript"><!--
google_ad_client = "ca-pub-1026739116117253";
/* CricketUsers (300 x 250 In Thread Box Ad) */
google_ad_slot = "6476112708";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


</div>

</li>

</vb:if>

</vb:if>

</vb:if>

<!--end ads after first post-->

So after the first post it gives guests and registered members 3 ads. Two adsense and one eBay.

For supporting members, it gives them two adsense by default. If they go into their profile and turn off the in post ads (field13), it will remove them.

By turning ads back on for my supporting members be default, I have received no complaints, yet have increased my ad revenue.


Yes I used depreciated <center> tags. One day when I'm not lazy or this becomes a real issue, I'll put it all in a div.
Reply With Quote
  #28  
Old 05-27-2012, 03:16 PM
g00gl3r g00gl3r is offline
 
Join Date: Sep 2005
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I'm trying to get this to work and it just doesn't seem to do anything at all with the newer versions of vBulletin.

Any help?
Reply With Quote
  #29  
Old 05-27-2012, 03:19 PM
g00gl3r g00gl3r is offline
 
Join Date: Sep 2005
Posts: 174
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by chrisngrod View Post
I'm going to mark this as installed. I am pretty sure I used your post to help me configure my pages.

I really hate the sites where it looks like they had some postbot insert the ads btw.

This is the code I inserted in my forum just in case people want to do something similar.




So after the first post it gives guests and registered members 3 ads. Two adsense and one eBay.

For supporting members, it gives them two adsense by default. If they go into their profile and turn off the in post ads (field13), it will remove them.

By turning ads back on for my supporting members be default, I have received no complaints, yet have increased my ad revenue.


Yes I used depreciated <center> tags. One day when I'm not lazy or this becomes a real issue, I'll put it all in a div.
I tried to add this before the last line in postbit, and nothing shows at all.

What am I doing wrong?
Reply With Quote
  #30  
Old 06-03-2012, 02:55 AM
Naijasite's Avatar
Naijasite Naijasite is offline
 
Join Date: Mar 2012
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks alot its working fine on my Forum http://www.naijafinder.com/forum.php
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:16 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09303 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (3)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete