PHPBuilder - PHP enabled stylesheets Page 9



RSS Twitter
Articles Html

PHP enabled stylesheets - Page 9

by: Bertrand Potier
|
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);
}
?>

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Bertrand Potier

Comment:



Comment:

(Maximum characters: 1200). You have characters left.