Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

How are colors for a theme set for SMF?

Aloittaja prk166, heinäkuu 16, 2006, 02:15:51 IP

« edellinen - seuraava »

prk166


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.

1MileCrash

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.
The only thing php can't do is tell you how much milk is left in the fridge.



TreetopClimber

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  ;)

1MileCrash

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.
The only thing php can't do is tell you how much milk is left in the fridge.



prk166


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. 

bloc

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.

Advertisement: