vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Conditional Statement Help! (https://vborg.vbsupport.ru/showthread.php?t=116240)

tommyxv 05-21-2006 06:43 AM

Conditional Statement Help!
 
Can someone give me an example conditional to wrap my google ads in?

I want to remove google ads for members that have a certain user-group as their secondary.

The way I have my current subscriptions set is No Change primary and secondary is whatever they subscribed to.

Some member might have 2 or 3 secondaries, BUT if one of them is the user-group that removes the ads, I would like no ads to show.

Can this be done?

peterska2 05-21-2006 06:49 AM

Code:

<if condition="!in_array($vbulletin->userinfo['usergroupid'], array(5,6,7))">Google ads code</if>
replace 5,6,7 with the usergroup id's that you wish to not display the ads too.

tommyxv 05-21-2006 07:03 AM

Hrrrm, didn't work.

Here is another example:

User "Test" belongs to primary usergroup ID 5 and secondary usergroups 8 & 9

Usergroup 9 is not suppose to see ads but 5 & 8 do. Can we keep ads from showing with his usergroups setup like that?

peterska2 05-21-2006 07:10 AM

Ok, try this one

Code:

<if condition="is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 7)">something to display for these user groups like a thanks for subscribing message or something, or just &nbsp;<else />google adds code</if>
Again replace the numbers with the appropriate usergroup ids, and repeat as required.

tommyxv 05-21-2006 07:18 AM

Boom...That worked! :banana:

Thanks M8!

peterska2 05-21-2006 07:51 AM

no worries. Glad it works :)

Boofo 05-21-2006 08:05 AM

Quote:

Originally Posted by peterska2
Ok, try this one

Code:

<if condition="is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 7)">something to display for these user groups like a thanks for subscribing message or something, or just &nbsp;<else />google adds code</if>
Again replace the numbers with the appropriate usergroup ids, and repeat as required.

You should be able to do an array on that Kerry. ;)

peterska2 05-21-2006 08:09 AM

Quote:

Originally Posted by Boofo
You should be able to do an array on that Kerry. ;)

note post #2. We tried an array, but for some reason it didn't work, so we went for the long hand way and it worked.

Boofo 05-21-2006 08:17 AM

But that first one was just for the primary usergroups. The second one includes secondary usergroups also. Unless I'm reading them wrong, which has been known to happen. ;)

peterska2 05-21-2006 08:27 AM

You are probably right. :)


All times are GMT. The time now is 07:39 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.01051 seconds
  • Memory Usage 1,729KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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