PHP Warning: Undefined array key "rating" in ..../includes/class_postbit.php(368) : eval()'d code on line 68
[How-To]Using Array conditionals with $vboptions - vb.org Archive
Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[How-To]Using Array conditionals with $vboptions
Deaths
Join Date: Oct 2004
Posts: 679

 

Europe, Belgium
Show Printable Version Email this Page Subscription
Deaths Deaths is offline 03-25-2005, 10:00 PM

I've seen a couple of people making this mistake (including me a couple of months ago), so I though I'd make a How-To.

Here we go:

Add a new setting (and optionally a new settinggroup).
You may choose which settings you use, aslong as you remember the variable you use. (In this case we're using $pmembergroups).

After you're added the setting, you can add this code as your conditional:

PHP Code:
$pmembergroups  = $vboptions['pmembergroups'];
$pmembergroups = explode(",", $pmembergroups);

if (in_array($bbuserinfo['usergroupid'], $pmembergroups)){
TEXT_TO_BE_DISPLAYED
} 
That's it!

EDIT: If you want a guide on how to add a setting, just ask.
Reply With Quote
  #2  
Old 09-29-2006, 05:34 PM
Muellmann's Avatar
Muellmann Muellmann is offline
 
Join Date: Jun 2006
Location: near keyboard
Posts: 109
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, this is what I search for: How to add a Custom Settinggroup and a Setting
Could you please make such Howto?

Quote:
If you want a guide on how to add a setting, just ask.
Reply With Quote
  #3  
Old 09-29-2006, 06:44 PM
Delphiprogrammi Delphiprogrammi is offline
 
Join Date: Feb 2004
Location: Landen(Belgium)
Posts: 1,335
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Muellmann
Yes, this is what I search for: How to add a Custom Settinggroup and a Setting
Could you please make such Howto?
that's easy but you only see that options if debug mode is enabled.To enable debug mode edit /includes/config.php

PHP Code:
$config['Misc']['debug'] = true; 
right after the <?php

then goto admincp vbulletin options and there will be a link to add a new settingsgroup each with it's own settings if so desired
Reply With Quote
  #4  
Old 03-19-2008, 10:48 PM
TCattitude's Avatar
TCattitude TCattitude is offline
 
Join Date: Oct 2004
Location: Chile
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks... really.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:49 AM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.