#native_company# #native_desc#
#native_cta#

PHP enabled stylesheets Page 9

By Bertrand Potier
on November 24, 2002

Implementing Skins

Remember the visuals.inc file and its $VISUALS
indexed multi-dimensional associative array, it’s now time to add a new
configuration set. This is easily done by copy and pasting the existing set and
increasing the skin id by 1(extracted from visuals.inc):

<?php

$VISUALS
[1]['page']['font'] = 'Arial';

$VISUALS[1]['page']['fontsize'] = '12';

$VISUALS[1]['page']['fontunit'] = 'pt';

$VISUALS[1]['page']['background']['color'] = '#838383';

?>



Once you have set new values you can put the following code in the
index.php file to switch from one skin to another:

<?php

<a href="index.php?SkinID=<?php $SkinID ? echo '1' : echo '0'; ?>">

?>



Using the browser detection as evoked in the “Browser/Platform Based
Behaviors” section, you could also decide to load a totally different skin using
a code similar to this (extracted from index.php):

<?php

if ( browser.indexOf("explorer") != -) {

 
location.replace("index.php?SkinID=1);

}

?>



1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|