Easily
Simple Calendar
©
2001-2002 Easily
Simple Scripts
Latest Version: 3.1 - May 12, 2002
INSTRUCTIONS:
To use this script, simply upload it to your server and type in its' address in a web browser.
Alternatively, use PHP includes or functions to integrate the ESCalendar script into your web pages.
Additionally, you can utilize any of the configuration file or the command-line variables below to completely customize the style, size, color, actions and more of the calendar.
HINT: Put the calendar in a table and make the background any color you wish or put a graphic in the background like the one at http://calendar.esscripts.com.
NOTE: To view the default calendar for the current month with the current day hightlighted, you do not need to use any of the command line variables below.
CONFIGURATION FILE :
Located in the download along with the escalendar.php script is a separate file named esconfig.php. This file conatins three sample configurations to which you can add, remove or change any that you wish. This file makes configuring the look of the ESCalendar very simple.
To use a configuration, pass the uc variable along with the appropriate configuration number to the ESCalendar script. You can have almost an unlimited number of configurations in the esconfig.php file. These are actually arrays with different numbers for each configuration.
Example: http://www.yourdomain.com/escalendar.php?uc=1
By adding ?uc=1 to the URL, the ESCalendar script will look for the esconfig.php file and use the configuration with the number you specified, and in this case it would be 1. Simply replace the 1 with the configuration number you wish to use.
If the esconfig.php file is not in the same folder as the ESCalendar script or your specify a congifuration number that does not exist, the calendar will still display but at it's default configuration.
To customize your configuration file, use the Calendar Creator at http://calendar.esscripts.com/configure.php.
NOTE: All options in a configuration file will overwrite all command-line options including event marking. If you wish to pass these options to the script, do not use them in your configuration file.
COMMAND LINE VARIABLES:
There are two ways to use command-line variables:
The first way is used when loading the ESCalendar script directly in a web browser or via the PHP include function. After the full URL put a ? (question mark) before the first variable and put an & (ampersand) between each of the other variables you want to set. Do not use any spaces.
NOTE: You must call the full script URL address when sending command line variables via an include function.
The second way, if using the ESCalendar script as a function, is to send each variable or set them as global within the function. (All of the calendars on the Easily Simple Calendar web site are used this way).
See http://www.php.net for help with functions and the include command.
Many of these options can be set in the script itself, in the configuration file, or called via the command line. See the escalendar.php script for more information.
mo
MONTH TO DISPLAY
mo=mm
Default: Current month if not specified
yr
YEAR TO DISPLAY
yr=yyyy
Default: Current year if not specified
nt
DO NOT MARK TODAYS DATE
nt=1
Default: Mark todays date
ny
DO NOT DISPLAY THE YEAR
ny=1
Deafult: Display the year
es
START DATE OF DATE MARKING
es=yyyy-mm-dd
Default: None
ee
END DATE OF DATE MARKING
ee=yyyy-mm-dd
Default:
None
***
To send multiple start and end dates, separate each date by an "x".
An example would be "?es=2001-10-05x2001-11-1&ee=2001-10-12x2001-11-8"
This marks Oct. 5, 2001 -- Oct. 12, 2001 and Nov. 1, 2001 -- Nov. 8, 2001.
The date can be sent in most any format as long as the month appears before
the day. For example, to mark December 19, 2001 you can use "2001-12-19",
"12-19-2001","Dec 19, 2001","December 19 2001",
and more. If you want to mark a date regardless of the year, just omit the year
like "12-19", or "Dec 19".
***
ms
MARK STYLE
calstyle=x
Default: 1
Setting '$ms' to 1 will mark calendar dates using table background colors [Style
1 is the only option in any version before 2.0]
Setting this to 2 will mark calendar dates using graphics for background colors.
If using Style 2, all 'stat' graphics should be in the same directory as the
ESCalendar script. You can edit the 'stat' graphics to meet your needs.
ds
DAY CALENDAR BEGINS
ds=x
Default: 0
Valid options are 0=Sunday; 1=Monday; 2=Tuesday; 3=Wednesday; 4=Thursday; 5=Friday;
6=Saturday
ot
HOURS TO OFFSET TIME +/-
ot=x
Defult: 0
To add hours, enter a positive value. To subtract hours, enter a "-"
negative value
tw
th
tw=x CALENDAR TABLE WIDTH
th=x CALENDAR TABLE HEIGHT
Set $tw to the width of the calendar table (Defaults to 175)
Set $th to the height of the calendar table (Defaults to 140)
These options can be set in the script or overridden by the command-line options
'tw=' and 'th='
NOTE: The table may be smaller than specified for months with only 5 rows of
dates. This is to keep the table cells in proportion with the calendars with
six rows of dates.
al
DATE
NUMBER ALIGNMENT
al=x
Default: 0
Set $al to 0 [default] to align the dates to the middle and center of table
cells.
Set $al to 1 to align the dates to the upper-right corner of table cells.
Set $al to 2 to align the dates to the upper-left corner of table cells.
This option can be set in the script or overridden by the command-line option
'al='
FONT SIZES
AND WEIGHT
These options can be set in the script or overridden by command-line options
of the same named variables. The sizes are in pixels.
fsm="x"
FONT SIZE MONTH (Defaults to 18)
fsd="x" FONT SIZE DAY NAMES (Defaults to 9)
fsn="x" FONT SIZE NUMBERS (Defaults to 11)
fwm="x"
FONT WEIGHT MONTH (Setting this to anything will change the month weight to
normal)
fwd="x" FONT WEIGHT DAY NAMES (Setting this to anything will
change the day names weight to bold)
fwn="x" FONT WEIGHT NUMBERS (Setting this to anything will
change the numbers weight to bold)
TABLE CELL COLORS
These options can be set in the script or overridden by command-line options
of the same named variables.
dtc = Day
Names Table Background Color
nbc = Normal Numbers Background Color
ntc =
Blank Numbers Background Color
mtc = Month and Year Table Background Color
EXAMPLE
USE OF THIS SCRIPT:
http://www.yourdomain.com/escalendar.php?mo=12&yr=2001&es=2001-12-18&ee=2001-12-20
or include ("http://www.yourdomain.com/escalendar.php?mo=12&yr=2001&es=2001-12-18&ee=2001-12-20");
Either of these will result in a calendar for December of 2001 with the dates
12-18 through 12-20 marked.
You can also use the ESCalendar Configurator at http://calendar.esscripts.com/configure.php and see how to form command line variables and configuration files.
If you are familiar with PHP programming, it is generally much faster using this script as a function within it's intended web page.