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)

unitedpunjab 02-27-2007 10:00 PM

Adsense Inside the Post
 
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']">

bollie 02-28-2007 04:49 AM

Nice ;) instal

3dsoft 03-02-2007 06:01 PM

Hi, this looks cool. Will adsense show up only in 1st post (thread start) or in all posts? Because I would not like it to show up in all posts. Also, I think that googles rules say that no more than 3 ads per page.

unitedpunjab 03-02-2007 06:03 PM

Quote:

Originally Posted by 3dsoft (Post 1194298)
Hi, this looks cool. Will adsense show up only in 1st post (thread start) or in all posts? Because I would not like it to show up in all posts. Also, I think that googles rules say that no more than 3 ads per page.

Only in the First and Last post and only to guests,if you want in a different way then let me know.

2 FN LOW 03-03-2007 02:11 AM

so this actually shows up in the users posts and not in a post of its own?

BigJimTheLug 03-03-2007 02:16 AM

This is a nice modification, but you will run into problems when you or someone at your site uses the "quote" option.

It will screw things up, watch.

unitedpunjab 03-03-2007 02:34 AM

Quote:

Originally Posted by 2 FN LOW (Post 1194561)
so this actually shows up in the users posts and not in a post of its own?

yes its shown in user posts,

Quote:

Originally Posted by MARKETPROFITS (Post 1194562)
This is a nice modification, but you will run into problems when you or someone at your site uses the "quote" option.

It will screw things up, watch.

Ads are shown only to guest,even if ads are shown to members there will be no problem.Ads will not get 'quoted' along with the post.

BigJimTheLug 03-03-2007 02:50 AM

Quote:

Originally Posted by unitedpunjab (Post 1194571)
yes its shown in user posts,



Ads are shown only to guest,even if ads are shown to members there will be no problem.Ads will not get 'quoted' along with the post.

No, an ad won't get quoted. However, if someone wraps "quotes" around the post they make, then the blending efficiency of the mod will vanish. I used this ad implementation at first, but when it came time to wrap quotes around posts, this modification was inefficient.

unitedpunjab 03-03-2007 02:59 AM

I See...

3dsoft 03-03-2007 09:27 PM

Quote:

Only in the First and Last post and only to guests,if you want in a different way then let me know.
Sounds perfect to me. :)

banuchi2 03-04-2007 03:29 AM

For some reason, the ad is only showing in the first post and not the last. I have 2 questions...

1) How can I get this to show in the last post?
Update: Ahhh....Google states: "Please place only one link unit on any content page. This number does not affect the current limit of 3 regular ad units on any page - you may still place up to 3 regular ad units in addition to a single link unit on any content page"
U
2) If I wanted it to show in every post, what changes are necessary.
Answered my own question...there's a limit of 3
Thanks!

perju 03-04-2007 10:43 PM

It works great, but QUOTES and IMGs generate undesirable results. I had to uninstall because of this. :(

--
Edit: I'm guessing the only way this mod would work would be if it checks to see if the post contains a quote or an img. If neither of those elements are present, then the adsense code would appear.

soletrader 03-05-2007 12:01 AM

Is there a way to limit the ads to show only if there are greater than X words on that post?

kontrabass 03-08-2007 01:59 PM

Great hack and just in time - have been talking to a Google Adsense rep about optimizing my site, the rectangle in the first post is their top suggestion. And for guests only, this is perfect.

Stupid question: How do I modify it so that the ad is only displayed in the first post and not the last?

[installed]

Zia 03-08-2007 02:18 PM

nice to see u here unitedpanjab :)
looks promising modification..
will use it..if the adsense only shown in last post & shown to every one..& without any conflict along with [quote] & [img] tags..seems it will generate more clicks...

clicks install to get future notification/update...

valdet 03-16-2007 01:14 PM

Did anyone check whether this works with Yahoo Publishers Network YPN?

unitedpunjab 03-16-2007 01:39 PM

I don't see why it should not work.

magnaromagna 03-19-2007 10:32 PM

great hack.
how to put it at the top of the message? The ads is on the middle of the first message, I'd like to put it at the top. Adding vAlign=top ?

4x4 Mecca 03-20-2007 04:21 AM

It was a simple install, but it's not working... any ideas? I know that's vauge, but it's just not working?!?

Here is what I have
Code:

<!-- / icon and title -->
                </if>
               
        <!-- message -->
<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and ($show['guest'])">
<span style="margin: 2px; float: right; width: 301px; height: 251px;">
<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXX";
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = "300x250_as";
google_ad_type = "text_image";
//2007-03-19: Forum
google_ad_channel = "2290601347";
google_color_border = "F5F7F9";
google_color_bg = "F5F7F9";
google_color_link = "003265";
google_color_text = "000000";
google_color_url = "0066CC";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</span>
</if>

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


Zia 03-21-2007 11:32 AM

no news yet ???

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

kpascal 04-06-2007 12:18 PM

I understand your directions and have used the following:
Code:

<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and !is_member_of($bbuserinfo,10,11,12,14)">
I have tested with a user subscribed to the 'Custom Usergroup' 12 and they were able to see the ads. I thought it might be because four group IDs were separated by commas so I tried this:
Code:

<if condition="(($post[postcount] % $vboptions[maxposts] == 1)) and !is_member_of($bbuserinfo,12)">
The user was still able to see the ads. Does the code you have provided only work for 'Default Usergroups'? If so, would it be possible to do this with 'Custom Usergroups'?

kpascal 04-06-2007 12:26 PM

My baad.. I did not provide clear direction to the user that was testing for me and they were looking at an ad in the header and reporting that it was still visible. The last code I posted is working well and I am now testing the multiple usergroup version. I will report once it is tested.

Very sorry for the confusion an inconvenience.

kpascal 04-06-2007 12:30 PM

Your posted code suggestions work perfectly. Thank you for your help and again please accept my apologies for the confusion.

ggiersdorf 04-07-2007 10:58 AM

has a fix for images and quotes been made? I would love to use this but almost all my first posts consist of images being a gaming forum. We heavly use images and quotes

kpascal 04-07-2007 11:21 AM

I changed the placement of this mod when I applied it. (link to example) With the ad placed under the post, instead of beside it, I have not experienced an [img] or [quote] problem.

notrious 04-10-2007 01:00 AM

s.s pha jee

i want to use this mod as adsance in all posts

unitedpunjab 04-10-2007 08:24 AM

Quote:

Originally Posted by notrious (Post 1223726)
s.s pha jee


i want to use this mod as adsance in all posts

SSA,
Adsense doesn't allow more than three Ads on a page,So that wont work.

notrious 04-13-2007 08:30 PM

but still on soem sites i have seen this they have adsance in header like 2 sets and adsance in posts also

may be they are more smarter kid then me

NightShado 04-13-2007 11:34 PM

nice :) Thanx man :)

popowich 04-15-2007 12:06 AM

If this is targeted for guests what about adding text under the ad such as "Register today to remove this ad!" with the Register being a link to the forums registration page?

-Raymond


All times are GMT. The time now is 06:15 PM.

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.01387 seconds
  • Memory Usage 1,830KB
  • 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
  • (14)bbcode_code_printable
  • (7)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