vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Google Adsense After first post (with scrolling option) (https://vborg.vbsupport.ru/showthread.php?t=270066)

xMrCanadax 09-10-2011 10:00 PM

Google Adsense After first post (with scrolling option)
 
1 Attachment(s)
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

AttalaEA 09-11-2011 04:01 PM

Works perfect. Marked as installed, nominated, and rated 5 stars.
Thank you for this nice and clean modification. :)

xMrCanadax 09-11-2011 04:22 PM

Quote:

Originally Posted by AttalaEA (Post 2244617)
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!

p@ndu 09-12-2011 10:56 AM

works great thanks for the modification

xMrCanadax 09-12-2011 10:51 PM

Np! Enjoy it.

BlueCheri 09-13-2011 04:40 PM

Works fine, how to exempt usergroup?

fionix 09-26-2011 02:28 PM

Is that similar to what they have over at the DP forum, the AD pulls up right on the first post?

xMrCanadax 10-11-2011 05:31 AM

Quote:

Originally Posted by BlueCheri (Post 2245437)
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 (Post 2250217)
Is that similar to what they have over at the DP forum, the AD pulls up right on the first post?

yes it does :)

xMrCanadax 10-11-2011 05:33 AM

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

shoppingtelly 10-15-2011 01:52 PM

Is it possible to use this under third post?

Many thanks


All times are GMT. The time now is 03:48 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.01073 seconds
  • Memory Usage 1,738KB
  • 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
  • (3)bbcode_code_printable
  • (3)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
  • (10)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