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 - A Neater Google Adsense After First Post (https://vborg.vbsupport.ru/showthread.php?t=241944)

ShawneyJ 05-05-2010 10:00 PM

A Neater Google Adsense After First Post
 
1 Attachment(s)
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.

Sotagamer 05-20-2010 10:17 PM

Wow this is AMAZING THANK YOU SOOO MUCH!!! :D

joomla 05-20-2010 10:55 PM

was very good. Thanks

YouTubeVZ 05-24-2010 12:42 AM

Thanks :)

tommac3 05-25-2010 11:20 PM

Is there a way to limit this to certain groups?

ShawneyJ 05-26-2010 04:17 AM

Quote:

Originally Posted by tommac3 (Post 2043405)
Is there a way to limit this to certain groups?

no, sorry, not until someone releases a product which shouldnt be to far off.

YankForum 05-26-2010 04:01 PM

what's the difference compared to other adsense after first post codes ?

Boko577 05-27-2010 03:12 AM

Is it possible to make only guests and regular members see this ad unit?

ShawneyJ 05-29-2010 01:10 AM

Quote:

Originally Posted by YankForum (Post 2043692)
what's the difference compared to other adsense after first post codes ?

the other adsense add it's inside the attachment div, was Kinda breaking the layout on a lot of styles, also it was joining to the post for some members.



Quote:

Originally Posted by Boko577 (Post 2043899)
Is it possible to make only guests and regular members see this ad unit?

as said above, this should be possible when the product is out, im actually surprised one is not released yet.

strudinox 06-02-2010 04:42 PM

Any way to exclude a certain group? A have a certain usergroup that does not view ads. I'd use this for sure if it's possible. :)

Xencored 06-02-2010 07:48 PM

Quote:

Originally Posted by strudinox (Post 2047172)
Any way to exclude a certain group? A have a certain usergroup that does not view ads. I'd use this for sure if it's possible. :)

Code:

<vb:if condition="is_member_of($bbuserinfo,1,2,3,4,5,6) AND $post['isfirstshown']" >
<li class="firstpost_advert_container"><div class="firstpost_advert">
      REPLACE THIS WITH YOUR ADSENSE CODE HERE
</div>
</li>
</vb:if>

1,2,3,4,5,6 = usergroups you want to see the AD

kavehch 06-02-2010 09:13 PM

hi

a want google ads add after first post and 5 10 15 20 and ...... post what this ?

thanks

AURFSCAN 06-02-2010 11:08 PM

thx jaycob, I'll use your code (modded a bit) to display random linkable banners


Add multiple Images (banners) with links corresponding to Image and display them randomly after first post on every page


Code:


<vb:if condition="is_member_of($bbuserinfo,6,7) AND $post[postcount] % $vboptions[maxposts] == 1" >
<li class="firstpost_advert_container"><div class="firstpost_advert">

<script language="JavaScript">

<!--

//store the quotations in arrays

images = new Array(3);

images[0] = "<a href = 'http://www.link.php'><img src='/images/adred.jpg' alt='adred' ></a>";

images[1] = "<a href = 'http://www.link.php'><img src='/images/adblue.jpg' alt='adblue'></a>";

images[2] = "<a href = 'http://www.link.php'><img src='/images/adgreen.jpg' alt='adgreen'></a>";


index = Math.floor(Math.random() * images.length);

document.write(images[index]);

//done

// -->

</script>


</div>
</li>
</vb:if>


red - usergroups you want to show
green - image/banner link
blue - location of Image

add more arrays for more Images

AURFSCAN 06-03-2010 12:28 AM

geez, after looking around here for conditionals theres a million of these ad placement threads.
have to say yours is the neatest jaycob due to the css thx :)

and sorry also for going nuts with the code in your thread

kavehch 06-03-2010 10:40 PM

hi

a want google ads add after first post and 5 10 15 20 and ...... post what this ?

thanks

rmani84 07-23-2010 07:32 PM

perfect ... exactly what i was looking for ... Thanks a ton

Numenorean7 07-26-2010 09:16 PM

This mod owns! :)

dzinerfusion 07-29-2010 03:01 AM

Hi, would there be a way to exclude this ad for certain boards?

ShawneyJ 08-02-2010 10:27 AM

thanks guys, works for vB Version: 4.0.5.

Seb@ 08-05-2010 09:07 PM

thanks

ifitsmedia 08-06-2010 12:14 AM

Brilliant, thank you.

spinnaker 01-06-2011 07:50 AM

1 Attachment(s)
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 :)

rtyagis 01-06-2011 09:20 AM

Tagged this. For ad in the last post.:up:

4x4Ham 01-10-2011 08:07 PM

Thank you. Added with edits for groups in post #11. Works great.

jnrdavo 01-17-2011 09:48 PM

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!

caciocode 01-19-2011 01:47 AM

Tagged. Might come useful

jnrdavo 01-30-2011 05:20 PM

Quote:

Originally Posted by jnrdavo (Post 2150695)
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 :-)

webmastersitesi 03-04-2011 02:54 AM

very nice share thank you

BlueCheri 03-04-2011 11:23 PM

Very good one, tagged.

cpvrx 03-07-2011 09:36 PM

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

beckham_250 03-09-2011 10:39 AM

thanks

jamunkala1 03-14-2011 11:33 PM

Thanks, one of the most useful codes, I have found on this site other than vbulletin itself ;)

XiTCLUB 03-17-2011 10:23 AM

Thanks..

davidg 06-21-2011 11:12 PM

works just fine

Habsy 07-01-2011 10:27 PM

Does this work on 4.1.4?

I only get colored boxes

Habsy 07-01-2011 10:36 PM

nm,

works great in 4.1.4

thecore762 07-03-2011 03:59 PM

Thanks for sharing! I really like it :)

Hawkmaster 09-12-2011 10:37 PM

Working well on (vBulletin 4.1.5 Patch Level 1)

Can someone please be so kind as to tell me how to get mine aligned in the centre? It is over to the left right now:(

victorvu 09-13-2011 01:21 AM

1 Attachment(s)
Hi jaycob:

Thanks for the mode. It works great for me. I saw a few thing that I like on your attachment, as shown below. Please share the code for that mod? greatly appreciated.

Attachment 132879

Vic

bosken 09-13-2011 05:18 AM

Q: Are you allowed to have the Google AdSense for Search field after first post in this mod?

Think that is a great place to earn som extra... they read first post and might get the idea to search...


All times are GMT. The time now is 02:40 AM.

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.01420 seconds
  • Memory Usage 1,829KB
  • 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
  • (8)bbcode_code_printable
  • (5)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