vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   template conditionals (https://vborg.vbsupport.ru/showthread.php?t=173046)

Blackhat 03-14-2008 09:49 PM

template conditionals
 
How can I exclude my ads for the users in my paid subscription group ?

I used this code, but it seems like the ads got removed for everyone but unregistered

Code:

<if condition="!$bbuserinfo['userid'] == 17">
** ad code here **
</if>

Thanks

snakes1100 03-14-2008 10:03 PM

Code:

<if condition="in_array($bbuserinfo[usergroupid], array(1,2,3,4))">

Blackhat 03-14-2008 10:08 PM

I tried to reverse it like this, but it wont work

Quote:

<if condition="in_array(!$bbuserinfo[usergroupid], array(17))">

snakes1100 03-14-2008 10:10 PM

Works fine, remove the ! in yours.

Blackhat 03-14-2008 10:12 PM

I tried that, but I need to exclude it for the usergroup 17 so I thought I needed to have the ! in front

Opserty 03-14-2008 10:21 PM

Code:

<if condition="!is_member_of($bbuserinfo, X)">
    <!-- Advert Code here -->
</if>

X being the UsergroupId of your paid subscription usergroup.

snakes1100 03-14-2008 10:23 PM

Add all the usergroups that you want to see the ads to that array, sorry wasnt paying attention, dont add 17 or any other group that you dont want to show the ads to.

Edit to add:
Do what Op stated, sorry wasnt paying attention, either way will work.

BrandiDup 05-11-2008 03:27 PM

Very helpful, thank you! I'm in the process of reworking our ads system and I needed the conditional to show ads to ALL groups (we have many :D ) except for one (our paid subscribers) and this worked perfectly.


All times are GMT. The time now is 03:50 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.01145 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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