vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What conditional to use for an infraction group? (https://vborg.vbsupport.ru/showthread.php?t=303599)

Ombra 10-19-2013 05:27 PM

What conditional to use for an infraction group?
 
I have a custom feature on my forum that I don't want users restricted by infractions to be able to use. Normally, to restrict access for a certain usergroup I would do this:

Code:

if (!is_member_of($vbulletin->userinfo, X))

This doesn't work for infraction groups though; I'm guessing because vBulletin only overrides their permissions with my restricted usergroup settings instead of actually moving them into the usergroup. So what do I need to use to block their access?

Note that this code is in a php file and not the template, in case that makes a difference.

Ombra 10-21-2013 11:49 PM

I found it. So I don't contribute to the many useless search results I had to dig through before getting to something that worked, here it is:

Code:

if ($vbulletin->userinfo['ipoints'] < 1)

In my case, I'm hiding the next bit of code from anyone who has more than 1 infraction point. The "1" is the number of infraction points; change it to what applies to your forum.


All times are GMT. The time now is 07:02 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.00952 seconds
  • Memory Usage 1,707KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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