Chameleon v.1.08

Chameleon PHP script shows randomly, or in dependent on user's local time, different background images or colors.


Copyright (C) 2005 Wangchuk Sonam
Chameleon is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Chameleon is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

For newer version check http://www.phoenix.frihost.net


Features:

1. Show images/colors randomly or in dependent on user's local time
2. You can preset precise time (hours, minutes and seconds)
4. Uses Flat File (txt file) and does not need MySQL or any other DB


Installation:

Extract chameleon.zip in root folder.
In a new subfolder "chameleon" find five files: chameleon.php, random.txt, local.txt, read_me.htm, GNU License and images folder with three jpg examples.

Put this script below on the very top of your php page.

<?php
include $_SERVER["DOCUMENT_ROOT"] . "/chameleon/chameleon.php";
?>

Then put in body-definition this script below:

<?php echo $back; ?>

Example for body-definition:

<body text="#000000" <?php echo $back; ?> >

Open chameleon.php and in line 11 define default color. In line 12 you have choise to set if you would like randomly changing or user's time changing. Number 1 is for random changing, and number 2 for user's time.

Last step is random.txt and local.txt customization. Random.txt have only one column per row. This column is for image path or color.

If you like color for background, set first column with color number e.g.:

#0033AA|

You can't use words like yellow, red or blue for color deffinition.

If you like image for background simple type path to image e.g.:

/chameleon/images/example1.jpg|

Simle example for random.txt is below:

/chameleon/images/example1.jpg|
#0033AA|
#0000DD|
/chameleon/images/example2.jpg|
/chameleon/images/example3.jpg|
#0066BB|

Note: Don't forget | (color is only for effective demarcation) in random.txt on the end of the every row.

Every row in local.txt is divided in two columns and separated with |. First column is for image path or color, and second is for time setting.

In second column set hours, minutes, and seconds. E.g. 02 (show different background one second after 2 a.m.), 07.30 (show different background one second after 7.30 a.m.) or 19.15.30 (show different background one second after 19.15.30 p.m.). It is very important to set the first row with time 00, otherwise you will get white background between midnight and the first next setting. Also it is important to set time by order e.g. 00, 01.30, 03.15.30, 06.25.20, 15.48, etc.

Simple example for local.txt is below:

#FFFFDD|00
/chameleon/images/example1.jpg|04.30
#FFE8FF|08
/chameleon/images/example2.jpg|12
#D8E7DD|16.10
/chameleon/images/example3.jpg|20.20

Addition:
With the same script for body background you can also change table background or cell background!

 

Example for table:

<table width="300" border="0" cellpadding="0" cellspacing="0" <?php echo $back; ?>>

Example for cell:

<td valign="top" <?php echo $back; ?>>


That’s all, folks. Have fun!


If you use Chameleon and would like to help us please rate it, place a link to us on your website or refer to us in one of good webmaster's forum. Thank you!