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
  #2  
Old 09-11-2011, 04:01 PM
AttalaEA AttalaEA is offline
 
Join Date: Apr 2011
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works perfect. Marked as installed, nominated, and rated 5 stars.
Thank you for this nice and clean modification.
Reply With Quote
2 благодарности(ей) от:
ellinofatsa, xMrCanadax
  #3  
Old 09-11-2011, 04:22 PM
xMrCanadax xMrCanadax is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AttalaEA View Post
Works perfect. Marked as installed, nominated, and rated 5 stars.
Thank you for this nice and clean modification.
Thank you! anything you might need let me know!
Reply With Quote
  #4  
Old 09-12-2011, 10:56 AM
p@ndu p@ndu is offline
 
Join Date: Jan 2009
Posts: 260
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works great thanks for the modification
Reply With Quote
  #5  
Old 09-12-2011, 10:51 PM
xMrCanadax xMrCanadax is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Np! Enjoy it.
Reply With Quote
  #6  
Old 09-13-2011, 04:40 PM
BlueCheri's Avatar
BlueCheri BlueCheri is offline
 
Join Date: Jul 2009
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works fine, how to exempt usergroup?
Reply With Quote
  #7  
Old 09-26-2011, 02:28 PM
fionix fionix is offline
 
Join Date: Apr 2007
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is that similar to what they have over at the DP forum, the AD pulls up right on the first post?
Reply With Quote
  #8  
Old 10-11-2011, 05:31 AM
xMrCanadax xMrCanadax is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BlueCheri View Post
Works fine, how to exempt usergroup?
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

Quote:
Originally Posted by fionix View Post
Is that similar to what they have over at the DP forum, the AD pulls up right on the first post?
yes it does
Reply With Quote
  #9  
Old 10-11-2011, 05:33 AM
xMrCanadax xMrCanadax is offline
 
Join Date: Aug 2011
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #10  
Old 10-15-2011, 01:52 PM
shoppingtelly shoppingtelly is offline
 
Join Date: Apr 2002
Location: Blackpool
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to use this under third post?

Many thanks
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:12 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.04574 seconds
  • Memory Usage 2,315KB
  • Queries Executed 26 (?)
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
  • (3)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
  • (5)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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