Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications

Reply
 
Thread Tools
Google AdSense (or other) after post... Details »»
Google AdSense (or other) after post...
Version: 1.00, by goranbaxy goranbaxy is offline
Developer Last Online: Apr 2013 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.6.8 Rating:
Released: 01-28-2008 Last Update: Never Installs: 58
Template Edits
Re-useable Code Translations  
No support by the author.

I found this cod on vublletin.org and did some customization, I found this very useful and good place for ads.

Show a banner/ad after first (or somewhere else) post, show it to guests | register users | users with less then X posts...

This is what I have:
- It will show ad/banner after first post on every page (instead of just the first page) but only to guests.


Admin CP -> Styles & Templates -> Style Manager -> ? ? -> Postbit Templates ->
Edit postbit or postbit_legacy (depending on which layout you are using)

Find:
Code:
<!-- / post $post[postid] popup menu -->
After ad:

Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid]">
<div style="padding: $stylevar[cellpadding]px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
	<td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
	<td class="alt1" align="center">
		BANNER CODE HERE
	</td>
</tr>
</table>
</div>

</if>
Here is how it will look like: demo ads

Here are several other conditions you can use in the above code to show the banner in different places. Simply replace the first "if" statement.

...after the first post on every page (instead of just the first page):
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1">
...after the first post, but only for guests:
Code:
<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">
...after the first post, but only if the thread has at least 2 replies (so you never see a banner and only 1 post):
Code:
<if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2">
...after the first post, but only in specific forums (where X,Y,Z is a comma list of forumids):
Code:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
...after every X posts (replace X with a number):
Code:
<if condition="$post[postcount] % X == 0">
...after the last post on every page:
Code:
<if condition="$post['islastshown']">
...between the last and second to last post on every page (need to move the above code to the very top of the template instead of the bottom, then use the same condition as above):
Quote:
<if condition="$post['islastshown']">
You can use pieces of these conditions to do different combinations. For example, this condition will show the banner after the first post on every page (instead of just the first page), but only for guests, and only in certain forums (where X,Y,Z is a comma list of forumids):
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))">
Please click to "Mark as Installed"

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #32  
Old 05-31-2008, 09:35 AM
goranbaxy goranbaxy is offline
 
Join Date: Jan 2008
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just don't put any condition
Reply With Quote
  #33  
Old 05-31-2008, 10:08 AM
Suicide BULLET Suicide BULLET is offline
 
Join Date: Sep 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks man .. *installed*
Reply With Quote
  #34  
Old 05-31-2008, 11:48 AM
Suicide BULLET Suicide BULLET is offline
 
Join Date: Sep 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sorry .. but after i removed the codition the ads appeared after every post
i want it to be visible to all groups
and after the 1st post only
Reply With Quote
  #35  
Old 06-04-2008, 05:33 PM
Leo Brazil's Avatar
Leo Brazil Leo Brazil is offline
 
Join Date: Dec 2007
Location: Brazil
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does it work for 3.7 ?
Reply With Quote
  #36  
Old 06-17-2008, 11:47 PM
ArnyVee's Avatar
ArnyVee ArnyVee is offline
 
Join Date: Mar 2008
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Working for me on 3.7.1 P1
Reply With Quote
  #37  
Old 06-18-2008, 05:27 AM
goranbaxy goranbaxy is offline
 
Join Date: Jan 2008
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Suicide BULLET View Post
sorry .. but after i removed the codition the ads appeared after every post
i want it to be visible to all groups
and after the 1st post only
Sorry, try this one:


PHP Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1"
Reply With Quote
  #38  
Old 06-18-2008, 10:30 AM
ArnyVee's Avatar
ArnyVee ArnyVee is offline
 
Join Date: Mar 2008
Posts: 944
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I originally had it on the 1st page of every thread (between first and second post), but I changed it to every page because it just wasn't enough exposure for the 'long' threads. Most people jumped to the last page and missed the ad. Just a tip
Reply With Quote
  #39  
Old 07-25-2008, 06:18 PM
ehsanix ehsanix is offline
 
Join Date: Oct 2003
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks installed but has problem with quich reply issue for me
it redirects poster to advertises included after last posts
Reply With Quote
  #40  
Old 07-25-2008, 06:29 PM
ehsanix ehsanix is offline
 
Join Date: Oct 2003
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AFTER A LITTLE SEARCH I FOUND THIS :
Code:
<if condition="($post['islastshown'] and !$GLOBALS['vbulletin']->GPC['ajax'])">
Reply With Quote
  #41  
Old 07-26-2008, 12:03 PM
goranbaxy goranbaxy is offline
 
Join Date: Jan 2008
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

where di you put that code?
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 06:10 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.13210 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (10)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • 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