The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do you implement varname from new settings in custom php script?
Hello everyone, I have been trying to figure those out on my own for the whole weekend with no avail, I hope someone has some ideas as to what I can do to solve my concern.
I just created my first option for my custom script (first one! ) through debug mode in settings panel in admincp. It's called "Can View Contests" (of new group " Contest Of The Week") and I set the default value to be 6 as the usergroup allowed to view these pages by default. The option also has a varname which I created (oftw_can_view). Aside from the values of the new settings created how I do Implement now this new option into my custom pages? I want to be able to restrict with this option the ability to see these pages of my script to only usergroup 6 (for now by default).?? Please if anyone has any ideas or can shed any light please share. I can control who sees each page by a simple if condition within the php code of each page but I want to be able to control it globally and not have to edit each page every time I want to allow another usergroup. Best Regards, Equinox Hope everyone had a great weekend. |
#2
|
||||
|
||||
All variables which you defined in the settings are available through
PHP Code:
PHP Code:
PHP Code:
Also make sure to position this code after global.php inclusion. |
#3
|
|||
|
|||
Thank you so much for the fast reply Disasterpiece. Works perfect, now I understand so much better how those options work. Opens up a whole world of possibilities.
Just to see if I have it clear. I'll use the first if condition if I only want ot allow one usegroup per the options and the second if it's more that one? --------------- Added [DATE]1310996257[/DATE] at [TIME]1310996257[/TIME] --------------- Funny thing I tried to add another usegroup to this option like usergroups allowed: 6, 1 for example and I press save it loads returns to that same page but the value still remains 6 and not 6,1 like I had put?? Any ideas what I could be doing wrong? |
#4
|
|||
|
|||
What did you select for "Data Validation Type"? If you want to be able to enter a comma-separated list you need to select "free".
|
#5
|
|||
|
|||
Quote:
Ahhhh perfect now using Free.! Thanks khn99 Now it all works perfectly. Is there any official vb documentation one could use for this sort of issues? |
#6
|
||||
|
||||
6, 1 could make problems when you don't make the code more foolproof, but when you consistently stick to 1,2,3 instead of 1, 2, 3 then there are no problems
|
#7
|
|||
|
|||
Good to know. At this point of my skill level I need every "foolproof" tip you can give me. Still learning but I love it though, I carry around a note pad to right down code in case I come up with an idea...Hope to be sharing with the community some of my work soon.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|