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)
-   -   Show Thread Enhancements - Adsense as second post. 2 Sizes - Big for guests, small for members (https://vborg.vbsupport.ru/showthread.php?t=136743)

Alien 02-14-2007 12:17 AM

I found the resolution...

In order to not show this to a particular group (difference here being this works even if it's not their MAIN group), insert this code instead..

Code:

<!-- Google AdSense in Posts for Members -->
<if condition="THIS_SCRIPT == 'showthread' AND  $post[postid] == $GLOBALS['qrfirstpostid'] AND ($show[member]) AND !is_member_of($bbuserinfo, X, X, X)">

Where X, X, X is the usergroup id's you DON'T want to see the ads. Mine is 14, which is my premium group, and I also added my staff groups. I want everyone else to see them. Of course if a person is a guest, he'll still see the large format ads.

Hope that helps someone...

StarBuG 02-14-2007 07:05 AM

Yes, that works as well

Glad you figured it out ;)

If you lose the ! before "is_member_of", the statement will only include the usergroups you named (X) by the way ;)

Cheertobi 02-20-2007 06:39 PM

What is this condition good for?!

Code:

<if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>
Tobi

StarBuG 02-21-2007 06:14 PM

This code is copied from the "postbit_wrapper" template.

Here it does not serve any purpose.
I just forgot to take it out.
You can delete it if you want.

It is just an html comment that is added when the the above post is followed by another one.

StarBuG

2 FN LOW 02-27-2007 08:32 PM

how do you know what postbit you use?

StarBuG 02-28-2007 02:30 PM

If you are asking that, then you are using the "postbit" template ;)

To use the "postbit_legacy" template you have to copy the content from that template to "Postbit" ;)

ccmoon 03-17-2007 03:55 AM

Thanks for this great hack. However, I don't like guest to see the "wide" ad, it looks early that way. How do I make guest will see ads the same way as registered users?
Thanks

StarBuG 03-17-2007 07:05 AM

If you want everyone to see the same ad you don't need the coditions.
Simply only use the member code and get rid of all the rest.

use this:
Code:

<if condition="$show['spacer']">
    </div>
    $spacer_close
</if>

<if condition="$show['spacer']">
    $spacer_open
    <div id="edit$post[postid]" style="padding:0px 0px $stylevar[cellpadding]px 0px">
    <if condition="!$post['islastshown']"><!-- this is not the last post shown on the page --></if>   
</if>

<table class="tborder" id="post$post[postid]" align="center" border="0" cellpadding="6" cellspacing="1" width="100%">
<tbody><tr>
    <td class="thead" id="td_post_$post[postid]">
  <div class="normal">
        &nbsp;
    </div>
    </td>
</tr>
<tr>
    <td class="alt1" align="center">
        <div>
    <!-- Adsense standard banner start -->
      <script type="text/javascript"><!--
      google_ad_client = "pub-5988350962952956";
      google_ad_width = 468;
      google_ad_height = 60;
      google_ad_format = "468x60_as";
      google_ad_type = "text";
      google_ad_channel = "5238041056";
      //--></script>
      <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
    <!-- Adsense standard banner End -->
        </div>
    </td>
</tr>
</tbody>
</table>

then everyone including members, guests, admins, mods etc are seeing your ad as second post.

DiSpy 03-31-2007 04:50 PM

Hi,

How can I change this so that it shows up as the last post on a page? (instead of the second post)

THANKS! :D

tsptom 03-31-2007 05:12 PM

use this as your 1st IF statement:

Code:

<if condition="$post[postcount] == 10">


All times are GMT. The time now is 09:35 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.01192 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)bbcode_code_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