Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Topic started by: cann on October 07, 2005, 11:44:36 AM

Title: $settings[array] help
Post by: cann on October 07, 2005, 11:44:36 AM
were can i learn more about-  $settings['images_url'] ?
with the default theme, in the index.template.php file the source for images are-
<img src="', $settings['images_url'], '/smflogo.gif" />
and what i would like to do is add another path var to the $settings array
example-
<img src="', $settings['images_url_flash'], '/smflogo.gif" />
Title: Re: $settings[array] help
Post by: cann on October 08, 2005, 01:11:18 PM
can someone tell me where i can find the $settings (where it is declared)?

i was thinking that this would be easy, but i just cant find it.
Title: Re: $settings[array] help
Post by: forsakenlad on October 08, 2005, 03:30:27 PM
You have to modify both Themes.php and Subs.php to create a new variable, you would also have to add a new column to the database. If you want it to be theme spesific however, it can easily be added to the Settings.template.php in your themes folder. The thing is what exactly do you need this for?
Title: Re: $settings[array] help
Post by: cann on October 08, 2005, 08:26:30 PM
i have another image dir' thats buried deep in a dir above the forum dir and  i need to access it for a forum skin im creating.
Title: Re: $settings[array] help
Post by: cann on January 22, 2006, 03:40:05 PM
Quote...it can easily be added to the Settings.template.php in your themes folder...
can some one give me an example on how i would do this?
Title: Re: $settings[array] help
Post by: bloc on January 23, 2006, 07:45:06 AM
Open Settings.template and find this:
function template_settings()
{
global $context, $settings, $options, $scripturl, $txt;

$context['theme_settings'] = array(


the add on the next line something like:
array(
'id' => 'images_url_flash',
'label' => 'whatever title',
'description' => 'some text',
'type' => 'text',
),


Then save your path when it shows up in "current theme settings", and you are ready to use in the theme. Just access it like $settings['images_flash_url'].
Title: Re: $settings[array] help
Post by: cann on January 23, 2006, 07:51:01 AM
thank you Bloc!