vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Mini Mods - Adsense Inside the Post (https://vborg.vbsupport.ru/showthread.php?t=140664)

Rick 03-23-2007 01:28 PM

Thanks for an excellent mod.

I would like to disable the ad in the last post. What do I need to do??

bryandailey 03-27-2007 09:07 PM

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 -->

prophecydude 03-29-2007 05:45 PM

Thanks you 2 (guy above me and mod author!

BigJimTheLug 03-29-2007 06:14 PM

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.

kpascal 04-06-2007 10:43 AM

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]

unitedpunjab 04-06-2007 10:47 AM

Replace

Code:

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

Code:

<if condition="(($post[postcount] % $vboptions[maxposts] == 1))">

kpascal 04-06-2007 10:51 AM

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?

unitedpunjab 04-06-2007 10:58 AM

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.

kpascal 04-06-2007 11:11 AM

Quote:

Originally Posted by unitedpunjab (Post 1220964)
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. :)

unitedpunjab 04-06-2007 11:53 AM

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


All times are GMT. The time now is 11:25 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.01225 seconds
  • Memory Usage 1,745KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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