Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
A Neater Google Adsense After First Post Details »»
A Neater Google Adsense After First Post
Version: 1.00, by ShawneyJ ShawneyJ is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.5 Rating:
Released: 05-05-2010 Last Update: Never Installs: 190
Template Edits
Re-useable Code Translations  
No support by the author.

Ok, so i haven't found any google adsence products for vb 4 yet that sit neatly under your first post only, on every page. Credits to Miko and my self for a few tiny edits.

How To Install
Step.1:
GoTo Postbit Templates>>open postbit_legacy and add at the very bottom:

Code:
<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
      REPLACE THIS WITH YOUR ADSENSE CODE HERE
</div>
</li>
</vb:if>

Step.2:
GoTo CSS Templates>>open additional.css and add this code:

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;
}
Feel free to customize to your needs, i had to mess around to suit my custom style. I changed the min-height to 90px for a neater look for 728x90 ads and changed margin-bottom: to 18px. But how the code is above is perfect for Vbulletin 4 Default.
DEMO: Teen Forums
Please Note: im not a coder, i just wanted to share this with others, its VERY easy to add to your styles and looks neat. Good Luck.
This coding is also different than Mod Version: 1.00, by Allan. You shouldn't have any problems with this and it will do you till a product version comes out.

Screenshots

File Type: jpg Neater Google Adsense After First Post.jpg (83.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
acmalin927, farru, sodasusu, SolidSnakeLive, StormBreaker

Comments
  #22  
Old 08-06-2010, 12:14 AM
ifitsmedia ifitsmedia is offline
 
Join Date: Jul 2010
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant, thank you.
Reply With Quote
  #23  
Old 01-06-2011, 07:50 AM
spinnaker spinnaker is offline
 
Join Date: Apr 2010
Location: Poland
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How to add advertisement after last post on the page? It's simple

DEMO here.

You have to make a small change in the pasted code in Postbit Legacy Template (postbit_legacy) (on the color green).

Code:
<vb:if condition="$post['islastshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
      REPLACE THIS WITH YOUR ADSENSE CODE HERE
</div>
</li>
</vb:if>

If you want to have two advertisements simultaneously, the advertisement after the first post and the one after the last, paste this into the previous one. Postbit Legacy Template (postbit_legacy) should look like this (paste this code at the end):

Code:
<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
      REPLACE THIS WITH YOUR ADSENSE CODE HERE
</div>
</li>
</vb:if>

<vb:if condition="$post['islastshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
      REPLACE THIS WITH YOUR OTHER ADVERTISEMENT CODE HERE
</div>
</li>
</vb:if>

When using this code, advertisement after the last post using the same code CSS Template (additional.css) for the first advertisement. Don't change anything in CSS Template. But when changing CSS Template for second advertisement (after last post) must add this code to CSS Template (paste at the end in additional.css)

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

.lastpost_advert {
    with: 100%;
    background: #F1F1FA;
    border: 1px solid #fff;
    min-height: 90px;
    margin: 0;
    padding: 7px;
    text-align: center;
    vertical-align: middle;
}

and change in Postbit Legacy this green text:

Code:
<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
      REPLACE THIS WITH YOUR ADSENSE CODE HERE
</div>
</li>
</vb:if>

<vb:if condition="$post['islastshown']">
<li class="lastpost_advert_container"><div class="lastpost_advert">
      REPLACE THIS WITH YOUR OTHER ADVERTISEMENT CODE HERE
</div>
</li>
</vb:if>

DEMO here.

Happy New Year
Attached Images
File Type: jpg advertisement-last-post.jpg (103.9 KB, 0 views)
Reply With Quote
  #24  
Old 01-06-2011, 09:20 AM
rtyagis rtyagis is offline
 
Join Date: Feb 2009
Posts: 87
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tagged this. For ad in the last post.:up:
Reply With Quote
  #25  
Old 01-10-2011, 08:07 PM
4x4Ham 4x4Ham is offline
 
Join Date: Jan 2010
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you. Added with edits for groups in post #11. Works great.
Reply With Quote
  #26  
Old 01-17-2011, 09:48 PM
jnrdavo jnrdavo is offline
 
Join Date: Aug 2007
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Guys, not sure what I'm doing wrong, but can't get anything to display (in either first post or last post)..

This is the bottom of my postbit_legacy template

{vb:raw template_hook.postbit_end}

<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-753992401340nnnn";
/* slim long one, created 10/18/10 */
google_ad_slot = "444781nnnn";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</li>
</vb:if>
Am I missing something? I've also modded the additional.css templates...

I'm using 4.1.0 Patch Level 2, any help appreciated.

UPDATE: Ok, so I have this running ok one on board, but the other it only shows if I'm logged out... Obviously something to do with permissiong... Any help still appreciated!
Reply With Quote
  #27  
Old 01-19-2011, 01:47 AM
caciocode caciocode is offline
 
Join Date: Apr 2010
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tagged. Might come useful
Reply With Quote
  #28  
Old 01-30-2011, 05:20 PM
jnrdavo jnrdavo is offline
 
Join Date: Aug 2007
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jnrdavo View Post
Hi Guys, not sure what I'm doing wrong, but can't get anything to display (in either first post or last post)..

This is the bottom of my postbit_legacy template

{vb:raw template_hook.postbit_end}

<vb:if condition="$post['isfirstshown']">
<li class="firstpost_advert_container"><div class="firstpost_advert">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-753992401340nnnn";
/* slim long one, created 10/18/10 */
google_ad_slot = "444781nnnn";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
</li>
</vb:if>
Am I missing something? I've also modded the additional.css templates...

I'm using 4.1.0 Patch Level 2, any help appreciated.

UPDATE: Ok, so I have this running ok one on board, but the other it only shows if I'm logged out... Obviously something to do with permissiong... Any help still appreciated!
bump... Still looking for help on this one :-)

I would say something to do with permissioning, but can't find out where :-)
Reply With Quote
  #29  
Old 03-04-2011, 02:54 AM
webmastersitesi webmastersitesi is offline
 
Join Date: Oct 2007
Location: Turkey
Posts: 103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

very nice share thank you
Reply With Quote
  #30  
Old 03-04-2011, 11:23 PM
BlueCheri's Avatar
BlueCheri BlueCheri is offline
 
Join Date: Jul 2009
Posts: 339
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very good one, tagged.
Reply With Quote
  #31  
Old 03-07-2011, 09:36 PM
cpvrx cpvrx is offline
 
Join Date: Jul 2009
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It displays the adsense on the first post, of each page correct? Like, if the thread has multiple pages, does it still show up?
Reply With Quote
Reply


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 06:36 PM.


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.04854 seconds
  • Memory Usage 2,348KB
  • 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
  • (6)bbcode_code
  • (1)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (5)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete