Example using "skins"

User Management: using skins

This document describes the process of setting up skins. It provides the PHP source which enables you to implement a so called "skinnable" web site for your members.

The process involves creating a property, (in this example it is called styleSheetID), storing the users choice in this property, and then using this choice to determine which stylesheet to use.

Download example

Create styleSheetID

Sign in to your control panel, select properties, enter styleSheetID into the Property ID field.

Select Public in the Section field. (we want users to be able to change this) and whatever label you would like to use.

Create a driver script

The driver script will provide a dynamic style sheet. A stylesheet driver script is provided in here.

To use the sample script, you will need to configure it with the location of your ~/geniegate/conf.php script, any stylesheets you wish to use, and a default stylesheet.

The STYLES array contains ID codes and their associated stylesheets. You will need to edit this with the paths to your stylesheets.

STYLES = array(
		DECO 	   => "css_deco.php",
		BLACK_BG   => "css_black.php"
	       );

You can set additional stylesheets by adding (or removing) a ID_CODE => "/my/skinstylesheet.css" (It is important to place commas in the correct places, after every line except the last one)

Create a form

The next step is creating a form that enables the user to change his or her style preference. You can do this with your web/users/index.php script.

This form uses the DO_UPDATE_PROPERTIES function to change preferences.

There is a provided HTML form that should give you a starting point for doing this.