vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Guest only Ads (https://vborg.vbsupport.ru/showthread.php?t=73337)

givemeplain 12-26-2004 06:35 PM

Guest only Ads
 
Hey,
Is there a way to make it so that only guests can see advertisements. (one you log in, you do not see advertisements on board)

Thank you!

Gio~Logist 12-26-2004 06:59 PM

Look at this thread on VBT


http://www.vbulletintemplates.com/mo...hread.php?t=25



Hope this helps






Gio

givemeplain 12-26-2004 07:00 PM

thanks a lot! =)!

manguish 12-27-2004 05:01 PM

Why not just use :

PHP Code:

<if condition="!is_member_of($bbuserinfo, X)">
CODE HERE
</if> 

Inserting the number of the usergroup(s) you DON'T want seeing the ads in place of X

givemeplain 12-27-2004 05:19 PM

wow thats a lot simpler! but is there a way to make it so more than one usergroup doesnt see the ad?

when I attempt to put it inside the header I get

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected ';' in /home/shiburao/public_html/includes/adminfunctions_template.php(3055) : eval()'d code on line 33

manguish 12-27-2004 07:12 PM

To use the code just place it wherever you want your ad code to display.

As for your error - it must be your ad code as the code i gave you doesn't have any ; in it.

Post the whole ad code here if you want it to be debugged.

You dont put this into php files by the way - use it in the template you want it to display in.

manguish 12-27-2004 07:17 PM

PHP Code:

if(($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x) OR ($bbuserinfo[usergroupid] == x))
{
CODE HERE


If you must do it in php this'll work.... You get the idea.......

givemeplain 12-27-2004 08:05 PM

I went to style manager and edited templates. Is that what I am supposed to do? It doesn't work and gives me some weird code

if(($bbuserinfo[usergroupid] == 2) OR ($bbuserinfo[usergroupid] == 6) )
{
<script type="text/javascript"><!--
google_ad_client = "pub-4735661945647510";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
}

N8 12-27-2004 09:06 PM

Just do this:
Code:

<if condition="$bbuserinfo['userid'] == 0">
<script type="text/javascript"><!--
google_ad_client = "pub-4735661945647510";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</if>

and if you want something to display to everyone but guests:
Code:

<if condition="$bbuserinfo['userid'] == 0">
<script type="text/javascript"><!--
google_ad_client = "pub-4735661945647510";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_channel ="";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<else>
member code here...
</if>


givemeplain 12-28-2004 12:10 AM

Thanks!

manguish 12-29-2004 08:42 PM

Within the templates you don't need the { }

In the php files themselves you do.

Michael Morris 12-29-2004 09:38 PM

God you guys come up with some convoluted solutions to this problem.

If you want to limit something to guests only then use

Code:

<if condition="is_member_of($bbuserinfo, 1)"> ad </if>

manguish 12-30-2004 08:58 AM

Quote:

Originally Posted by manguish
Why not just use :

PHP Code:

<if condition="!is_member_of($bbuserinfo, X)">
CODE HERE
</if> 

Inserting the number of the usergroup(s) you DON'T want seeing the ads in place of X


Like i said in the first place :p

Michael Morris 12-30-2004 04:53 PM

No, your conditional is !is_member of (Not is member of). The original poster only wants to show the ads to one group only - the guests, so the conditional should be is_member_of

:)

manguish 01-01-2005 12:48 PM

Like i posted within my post though.

If someone doesn't know the ! operator makes it an inverse, should they really be playing with the code ;)


All times are GMT. The time now is 04:47 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.01189 seconds
  • Memory Usage 1,753KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (15)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete