Simple Machines Community Forum

Customizing SMF => Graphics and Templates => Aiheen aloitti: prk166 - heinäkuu 16, 2006, 02:15:51 IP

Otsikko: How are colors for a theme set for SMF?
Kirjoitti: prk166 - heinäkuu 16, 2006, 02:15:51 IP

Eventually I'll end up with a new theme to share.  But I'm jsut getting started with SMF so for now I'm trying to modify a copy of a theme.  I'd like to let people shoose between a couple different color combinations.  But I can't figure out how I go about getting SMF to recognize those.  In the themes folder I found in settings.template.php where I thought the color selections were being set.  I couldn't find anything else though either in the code nor in the database.

How does SMF determine what color choices are available for a theme?  How can that be changed?

Thank you.
Otsikko: Re: How are colors for a theme set for SMF?
Kirjoitti: 1MileCrash - heinäkuu 16, 2006, 05:01:47 IP
smf doesnt "determine what color choices are availibe for a theme". Every theme that has a built in color changer was done manually...different css files, a color variation for each graphic, etc. There is nothing "built in" to do this.
Otsikko: Re: How are colors for a theme set for SMF?
Kirjoitti: TreetopClimber - heinäkuu 17, 2006, 12:07:38 AP
This is where you would change the main backgroud
This is taken from the default theme


/* The main body of the entire forum. */
body
{
background-color: #E5E5E8;
margin: 0px;
padding: 12px 30px 4px 30px;
}

Also for the forum tables it would be here


/* Alternating backgrounds for posts, and several other sections of the forum. */
.windowbg
{
color: #000000;
background-color: #ECEDF3;
}
.windowbg2
{
color: #000000;
background-color: #F6F6F6;
}
.windowbg3
{
color: #000000;
background-color: #E0E1E8;
}


Now all you have to do is play with these colors to get the effect you want.
You may contact me on pm if you need more help  ;)
Otsikko: Re: How are colors for a theme set for SMF?
Kirjoitti: 1MileCrash - heinäkuu 17, 2006, 12:20:46 AP
Not at all what he/she is talking about.

http://www.tinyportal.net/smf/index.php?action=forum;theme=6

check out the top...the little squares change the color on click. You'll have to get a script that can swap css files using javascript or something.

LainaaI'd like to let people shoose between a couple different color combinations.  But I can't figure out how I go about getting SMF to recognize those.  In the themes folder I found in settings.template.php where I thought the color selections were being set.

Or at least this is what I'm understanding. Im sure he/she knows how to alter the CSS file for simple color edits.
Otsikko: Re: How are colors for a theme set for SMF?
Kirjoitti: prk166 - heinäkuu 23, 2006, 04:51:28 IP

Thanks for the information.  I'll have to get in there and look again.  I figure somewhere in some script it's determining what color themes are available for a theme.  Or that's just hard coded into the admin file the theme includes.  I haven't found wher that's done yet but this info does help in better understadning how it all works in general. 
Otsikko: Re: How are colors for a theme set for SMF?
Kirjoitti: bloc - heinäkuu 24, 2006, 04:31:41 AP
The example Tippmaster showed is really not too hard..but it involves a mix of php code and a regular <form> which sends the requested choice back to the theme when chosen. Then the theme take that color value(actually "red", "green" etc.) and put it in front/back of all the folder names where the graphics and css are. So the path could be .../images_red/... for example instead the regular .../images/.. and the stylesheet simply style_red.css.