Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
A Neater Google Adsense After First Post Details »
A Neater Google Adsense After First Post
Mod Version: 1.00, by ShawneyJ (Coder/Designer) ShawneyJ is offline
Developer Last Online: Oct 2020 I like it Show Printable Version Email this Page

vB Version: 4.0.5 Rating: (25 votes - 4.92 average) Installs: 190
Released: 06 May 2010 Last Update: Never Downloads: 0
Not Supported Template Edits Re-usable Code Translations  

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


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


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	Neater Google Adsense After First Post.jpg
Views:	5337
Size:	83.6 KB
ID:	116754  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Show Thread Enhancements Google Adsense after first post (or other advertisements) Allan vBulletin 4.x Add-ons 97 23 Aug 2018 23:00
Mini Mods Google Adsense (or other) in a Block like an Individual Post Leo Brazil vBulletin 4.x Template Modifications 15 25 Sep 2013 17:17
Forum Display Enhancements Google AdSense (or other) after post... goranbaxy vBulletin 3.6 Template Modifications 46 10 Sep 2010 04:04

  #76  
Old 28 May 2014, 18:12
409industries 409industries is offline
 
Join Date: Jan 2008
Originally Posted by RichieBoy67 View Post
You can fix the curly error with

<vb:literal> tag--Just surround Google script with it
Thank you for this great tip. I too get a bit annoyed with the "curly error" and this took care of the problem. I followed spinnaker's suggestion and have AdSense ads displaying after the first post AND after the last post.

Great simple mod that only requires an easy addition of code. Great work!

One last question:

If you have edited the code to display ads on threads both after the first post AND the last post... when a thread is brand new and there is ONLY one post you get two Google AdSense ads back to back. Is there a way to disable the "second" or "last" container so that it does not show an ad if there is only one post in a thread?

Last edited by 409industries; 28 May 2014 at 18:20.
Reply With Quote
  #77  
Old 28 May 2014, 20:26
tbworld tbworld is offline
 
Join Date: Oct 2008
Try this, I have not tested the code, so please let me know.

(Alter the post count ($tbworld_postbit_postcount >= 3) to what suits you.)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Create Plugin to keep track of post counts per page.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Should help.
Reply With Quote
  #78  
Old 29 May 2014, 17:53
409industries 409industries is offline
 
Join Date: Jan 2008
Originally Posted by tbworld View Post
Try this, I have not tested the code, so please let me know.

(Alter the post count ($tbworld_postbit_postcount >= 3) to what suits you.)


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Create Plugin to keep track of post counts per page.

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Should help.
Where does the PHP code go, at the bottom of additional.css?

So far what i am seeing is that it is no longer showing the "last_post_advert" on single post threads, but it is also not showing it on ones that have 3+ posts.
Reply With Quote
  #79  
Old 29 May 2014, 19:18
tbworld tbworld is offline
 
Join Date: Oct 2008
Originally Posted by 409industries View Post
Where does the PHP code go?
See ... Admin Control Panel --> Plugins and Products (Sidebar Menu) --> Add New Plugin.

Product: vbulletin
Hook Location: postbit_display_complete
Title: Postbit Post-Per-Page Counter <-- or whatever
Execution Order: 5

Plugin PHP Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Plugin is Active : Yes

This is just a simple counter that counts post per page.
Reply With Quote
  #80  
Old 29 May 2014, 19:23
tbworld tbworld is offline
 
Join Date: Oct 2008
So what should be happening is that in the "islastshown" conditional, I have added an additional check to see if the post count on that page is equal or greater than 3. If it is not then do not show the ad. Simple.
Reply With Quote
  #81  
Old 29 May 2014, 21:47
409industries 409industries is offline
 
Join Date: Jan 2008
Originally Posted by tbworld View Post
See ... Admin Control Panel --> Plugins and Products (Sidebar Menu) --> Add New Plugin.

Product: vbulletin
Hook Location: postbit_display_complete
Title: Postbit Post-Per-Page Counter <-- or whatever
Execution Order: 5

Plugin PHP Code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Plugin is Active : Yes

This is just a simple counter that counts post per page.
Originally Posted by tbworld View Post
So what should be happening is that in the "islastshown" conditional, I have added an additional check to see if the post count on that page is equal or greater than 3. If it is not then do not show the ad. Simple.
Brilliant! This is working perfectly.

Until now, I have not used plugins in this manner. I've tested this in a thread, and have verified that if there were less than 3 posts only the single ad was shown. For anyone else considering making their ads work the way mine here, here's the complete code below.

These are my conditions:

1) The ads will ONLY be shown to unregistered / guest users and a couple other groups - as indicated by the <vb:if condition="is_member_of($bbuserinfo,1,3,4,8) section

2) There are TWO Google AdSense ads created, "vBulletin Forum Ad after First Post" which is shown after the opening post and "vBulletin Forum Ad Before Last Post" which is shown ONLY in a thread if there are 3 posts.

In postbit_legacy:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Also, ad the "containers" that will show the ads in the threads (add this to additional.css in your style). Your border colors and sizes may vary.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Lastly, in order for the part where only threads with several replies will show BOTH the firstpost_advert and the lastpostadvert, add the plugin that tbworld provided above.
Reply With Quote
  #82  
Old 31 May 2014, 07:00
jacobin jacobin is offline
 
Join Date: May 2013
Good evening [mornig]

I love the mod greatly however i have a problem with it .. It dispaly the same AD after every single post.

Can anybidy help with that ...THx in advance !
Reply With Quote
  #83  
Old 31 May 2014, 17:11
409industries 409industries is offline
 
Join Date: Jan 2008
Originally Posted by jacobin View Post
Good evening [mornig]

I love the mod greatly however i have a problem with it .. It dispaly the same AD after every single post.

Can anybidy help with that ...THx in advance !
You may need to make multiple ad units via the Google AdSense control panel

Content > Ad units > New ad unit
Reply With Quote
  #84  
Old 01 Jun 2014, 03:58
jacobin jacobin is offline
 
Join Date: May 2013
Originally Posted by 409industries View Post
You may need to make multiple ad units via the Google AdSense control panel

Content > Ad units > New ad unit
I do have different Ad untis, what I am saying...The AD banner is displaying after each and every single post... I thought it was for One time AFTER the frist post ??
Reply With Quote
  #85  
Old 01 Jun 2014, 12:16
ramesh_umk3's Avatar
ramesh_umk3 ramesh_umk3 is offline
 
Join Date: Jul 2010
Real name: Wiston Book
Refer this post http://www.vbulletin.org/forum/showp...8&postcount=74
ads are showed only in 1 post of a page
Reply With Quote
  #86  
Old 01 Jun 2014, 20:27
409industries 409industries is offline
 
Join Date: Jan 2008
Originally Posted by jacobin View Post
I do have different Ad untis, what I am saying...The AD banner is displaying after each and every single post... I thought it was for One time AFTER the frist post ??
Yeah it should just be a single ad after the first post. Double check the code in postbit_legacy and additional.css
Reply With Quote
  #87  
Old 06 Aug 2015, 21:49
Vintum Vintum is offline
 
Join Date: Jan 2013
Just in case anyone else is having trouble like I was with this on vbulletin 4.2.2, this wasn't working for me and I spent a good while trying to figure out why. Turns out the problem was I was using the wrong template.

I was using "postbit_legacy" as all instructions said to use. but I needed to just use "postbit".

After adding the code to "postbit" template, and then also changing the plugin mentioned above to reflect the same template - it now works brilliantly for me.

So, if your having trouble, try using the "postbit" template instead.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

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


New To Site? Need Help?

All times are GMT. The time now is 14:39.

Layout Options | Width: Wide Color: