Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Adsense Inside the Post Details »»
Adsense Inside the Post
Version: 1.01, by unitedpunjab unitedpunjab is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.8 Rating:
Released: 02-27-2007 Last Update: 03-02-2007 Installs: 171
Template Edits
 
No support by the author.

This little template modification allows you to put an Ad inside the post with Text wrapped around the Ad.

See Screenshot.

In postbit template replace
Code:
 <!-- message -->
  <div id="post_message_$post[postid]">$post[message]</div>
   <!-- / message -->
With
Code:
        <!-- message -->
<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and ($show['guest'])">
<span style="margin: 2px; float: right; width: 301px; height: 251px;">
        ADSENSE CODE HERE
</span>
</if>
    <div id="post_message_$post[postid]">$post[message]</div>
              <!-- / message -->
  • you will have to replace ADSENSE CODE HERE with the actual code.
  • The code is for 300 * 250 Medium Rectangle Format,Edit width & height parameters if you want to use any other format.
  • Ad is shown on the first and last post (modify if you want)
  • Ad is shown to guests Only ( remove "and ($show['guest'])" to show to all)
Version History:
v 1.0.1 :Ads displayed after the first post on every page (instead of just the first page)

Tip: To remove quote button for guests.
Replace
Code:
<if condition="$post['replylink']
with
Code:
<if condition="$post['replylink'] AND $show['member']">

Show Your Support

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

Comments
  #22  
Old 03-23-2007, 01:28 PM
Rick Rick is offline
 
Join Date: Nov 2001
Location: Wittmann, AZ
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for an excellent mod.

I would like to disable the ad in the last post. What do I need to do??
Reply With Quote
  #23  
Old 03-27-2007, 09:07 PM
bryandailey bryandailey is offline
 
Join Date: Mar 2007
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I found this hack and thought it was pretty cool but for my needs, I dont use AdSense so I wanted to be able to put pre-defined, targeted ad tags from AdvertPRO (or AdCycle or PHP AdsNew etc) onto each forum. In other words, if the forum topic is electronics, I only want electronics based ads on those pages, and if the topic of the forum is Cooking, i only want cooking ads to show up. Google Adsense does that automatically by scanning for words on the page but my ad system doesnt

What I did was create a 300x250 ad placement for each form and then i made a large series of if/else commands and it in my postbit (in my case the postbit_legcy). It says "if its this forum, show the corresponding ad". Here is the code for ya'll to check out and use if you want. It's a modified version of unitedpunjab's "Adsense Inside the Post". I always give credit where credi is due!

Here be the code. Of course fill in your own ad code that corrsponds with what ads you want to show up in each forum. It's very important that you have the correct number if </if> tags at the end, one for each "if/else". Mine has 17 of em (I only show 4 here). Anyone think this will cause major problems or load issues?

<!-- message -->

<if condition="(($post[postcount] % $vboptions[maxposts] == 1) and
$forum[forumid] ==1)">
<span style="margin: 2px; float: right; width: 301px; height: 251px;">

<!-- BEGIN ADVERTPRO CODE BLOCK -->
CODE FOR FORUM #1 ADS GO HERE
<!-- END ADVERTPRO CODE BLOCK -->

</span>

<else />
<if condition="(($post[postcount] % $vboptions[maxposts] == 1) and
$forum[forumid] ==2)">
<span style="margin: 2px; float: right; width: 301px; height: 251px;">

<!-- BEGIN ADVERTPRO CODE BLOCK -->
CODE FOR FORUM #2 ADS GO HERE
<!-- END ADVERTPRO CODE BLOCK -->

</span>

<else />
<if condition="(($post[postcount] % $vboptions[maxposts] == 1) and
$forum[forumid] ==3)">
<span style="margin: 2px; float: right; width: 301px; height: 251px;">

<!-- BEGIN ADVERTPRO CODE BLOCK -->
CODE FOR FORUM #3 ADS GO HERE
<!-- END ADVERTPRO CODE BLOCK -->

</span>

<else />
<if condition="(($post[postcount] % $vboptions[maxposts] == 1) and
$forum[forumid] ==4)">
<span style="margin: 2px; float: right; width: 301px; height: 251px;">

<!-- BEGIN ADVERTPRO CODE BLOCK -->
CODE FOR FORUM #4 ADS GO HERE
<!-- END ADVERTPRO CODE BLOCK -->

</span>
</if>
</if>
</if>
</if>

<div id="post_message_$post[postid]">$post[message]</div>


<!-- / message -->
Reply With Quote
  #24  
Old 03-29-2007, 05:45 PM
prophecydude prophecydude is offline
 
Join Date: Jan 2007
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks you 2 (guy above me and mod author!
Reply With Quote
  #25  
Old 03-29-2007, 06:14 PM
BigJimTheLug BigJimTheLug is offline
 
Join Date: Nov 2006
Posts: 354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is a nifty tip to increase your CTR while using this modification.
This ad placement is good to blend in with the post content, but it also, when someone or you make a post, try not to place any links inside the post. For example, instead of using http://www.yoursite.com or www.yoursite.com , just use yoursite.com. This way, the only links available for someone to click on are links to Google Adsense, YPN, or whatever publishing program you use.

Keep in mind that you are not forcing others to click your links, you are simply eliminating other "clickable" links while making your publisher links the only "clickable" links inside the post.


This is a great modification, thanks.
Reply With Quote
  #26  
Old 04-06-2007, 10:43 AM
kpascal kpascal is offline
 
Join Date: Mar 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would like to show the ads to guests and registered users (sponsors will not see ads). What would I alter in the code to show ads to registered users as well?

[INSTALLED]
Reply With Quote
  #27  
Old 04-06-2007, 10:47 AM
unitedpunjab unitedpunjab is offline
 
Join Date: Feb 2006
Location: Scotland
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Replace

Code:
<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and ($show['guest'])">
with

Code:
<if condition="(($post[postcount] % $vboptions[maxposts] == 1))">
Reply With Quote
  #28  
Old 04-06-2007, 10:51 AM
kpascal kpascal is offline
 
Join Date: Mar 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the quick reply. Your suggestion would have the ads viewable by all visitors regardless of their usergroup. I would like to specify an additional usergroup (guests & registered).

Can you suggest the code?
Reply With Quote
  #29  
Old 04-06-2007, 10:58 AM
unitedpunjab unitedpunjab is offline
 
Join Date: Feb 2006
Location: Scotland
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and !is_member_of($bbuserinfo,XX)">
Replace XX with the usergroup id you do not want to show ads.
Reply With Quote
  #30  
Old 04-06-2007, 11:11 AM
kpascal kpascal is offline
 
Join Date: Mar 2007
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by unitedpunjab View Post
Code:
<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and !is_member_of($bbuserinfo,XX)">
Replace XX with the usergroup id you do not want to show ads.

For more than one usergroup I would separate by commas? i.e.
Code:
<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and !is_member_of($bbuserinfo,2,7,12)">
And please confirm that this will be the groups that will or will not see the ads. Thanks for your help.
Reply With Quote
  #31  
Old 04-06-2007, 11:53 AM
unitedpunjab unitedpunjab is offline
 
Join Date: Feb 2006
Location: Scotland
Posts: 286
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

will not see the ads..

replace

Code:
!is_member_of($bbuserinfo,2,7,12)
with

Code:
is_member_of($bbuserinfo,2,7,12)
if you want the other way
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 10:15 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.04467 seconds
  • Memory Usage 2,316KB
  • 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
  • (11)bbcode_code
  • (1)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
  • (4)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