Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: tyty1234 on September 12, 2009, 02:20:16 AM

Title: Using $config_vars
Post by: tyty1234 on September 12, 2009, 02:20:16 AM
Is there a doc, or thread on how $config_vars work? I've seen it in the comments in the ModSettings.php file for SMF 1.1.x, but in ManageSettings.php, it's not there. :(

It seems that $config_vars has changed a bit between concerning the fact that the disabled key is only seen in SMF 2.x. Can anyone provide me with a detailed description for working with $config_vars?

Thanks
Title: Re: Using $config_vars
Post by: Arantor on September 12, 2009, 07:39:44 AM
Basically you add items to the array concerning what you want to add. (In 1.1, it's built in ModSettings.php)

It covers the generic configuration pages where they are simple lists of variable-value key that apply to everything, and are for values that enter $modSettings and live in the {$db_prefix}settings table.

I've used it in a couple of mods; my Disable Template Eval mod adds items in just that way - look at where it's adding it, and it should become clear (sorry I'm so vague, I just woke up)
Title: Re: Using $config_vars
Post by: tyty1234 on September 12, 2009, 12:58:12 PM
Well, I'm familiar with how its used and all, but it would be nice if there was a reference thread I could refer to so that I know its complete features. :)
Title: Re: Using $config_vars
Post by: Arantor on September 12, 2009, 01:01:28 PM
The only reference to it is in the source itself at the moment. There should be a fair number of notes in the source as to how to use it, which is how I learned how to use it.

We do need more coding-related docs, e.g. how to add permissions, how to add this and more.
Title: Re: Using $config_vars
Post by: tyty1234 on September 12, 2009, 01:02:47 PM
I agree with you Arantor. And who knows? Maybe Jade might come across this thread....maybe, maybe not.
Title: Re: Using $config_vars
Post by: Arantor on September 12, 2009, 01:13:55 PM
Well, the problem is that it needs to be someone with a strong coding experience and at least a reasonable knowledge of the more inner-bits of the source - and that pretty much limits it to the devs, customizers and the strong modders.

I did write a guide a bit back on how to create new scheduled tasks in 2.0, I will see about writing some more guides that the Doc team can make all nice and readable, but it's dependent on the time it takes - just writing how to make a new scheduled task (which is a simpler job) took about 3 hours to write.
Title: Re: Using $config_vars
Post by: tyty1234 on September 12, 2009, 01:16:55 PM
That's pretty true. Hopefully, I'll learn more about $config_vars. Maybe one of the devs will see this topic and reply to it?
Title: Re: Using $config_vars
Post by: Arantor on September 12, 2009, 01:24:22 PM
Well, the devs are pretty busy at cranking out RC2, but I'll see what I can come up with in the meantime.