$settings[array] help

Started by cann, October 07, 2005, 11:44:36 AM

Previous topic - Next topic

cann

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" />
SMF 1.0.6

cann

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.
SMF 1.0.6

forsakenlad

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?
Eren "forsakenlad" Yaşarkurt
SMF Friend & Former Team Member

cann

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.
SMF 1.0.6

cann

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?
SMF 1.0.6

bloc

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'].

cann

SMF 1.0.6

Advertisement: