![]() |
is_member_of improvement.
Requested by Boofo
Some people want to check for multiple groups at once, instead of having to slam OR is_member_of(anothercheck) together for each group, if you apply this hack it will be simple to check for multiple groups. The format for the function is now, Code:
is_member_of($bbuserinfo, ID1, ID2, ID3,.....); Find the function in includes/functions.php ~line 190 and replace it with the following. This should not affect any current is_member_of conditionals you're using. PHP Code:
|
You have once again proven yourself the "Master"! Thank you, very much, sir. ;)
[high]* Boofo skulks away having proven to not be a good Grasshopper to Master. :([/high] |
Quote:
|
Wouldn't it be easier to allow the second argument to be an array with usergroup id's?
ie. PHP Code:
|
MY initial use of array() in the conditionals didnt work, maybe because of the way it is evaluated.
If you can work out if array() works in conditionals it would be an easy modification to the code |
Try this:
PHP Code:
|
Interesting hack, should be useful to many :)
|
What exactly do i raplace????
Code:
// ###################### Start is member of ####################### |
Replace all of it unless you've previously hacked that function.
|
replaced it all and i got this:
Code:
Fatal error: Cannot redeclare is_member_of() (previously declared in /usr/home/yates238/public_html/includes/functions.php:176) in /usr/home/yates238/public_html/includes/functions.php on line 208 |
Quote:
|
Quote:
LeeCHeSSS script worked, but the orignal one didn't. I'll try your hack now. Thanks for the support. |
A template only mod to do this is available here if you would like to avoid editing php files.
http://www.vbulletintemplates.com/mo...ead.php?t=7570 |
Has this been added to 3.5 RC 1?
|
It's built in. Go read the code and you'll see that Jelsoft was wise and merciful and no hack is needed any more.
|
Great! Then we can still use it in templates the way Merk descibed, now, right?
|
Yep. But, slightly changed:
Code:
<if condition="is_member_of($vbulletin->userinfo,6,5)"> |
$bbuserinfo should still work in templates shouldn't it ?
|
Quote:
|
All times are GMT. The time now is 04:06 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|