Integration (Adding the calendar to pages)

From Easy PHP Calendar Instructions
Revision as of 16:06, 7 April 2014 by Brian (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Follow these instructions carefully or the calendar will not appear correctly!

When adding the calendar to existing web pages, there are few important steps to follow:

The page displaying the calendar must be parsed by PHP. This usually means that the file name must end with .php (not htm or html) unless your PHP installation has different requirements. Check with your web host provider if you are unsure. If you don't see the calendar at all, this is generally the cause and can be fixed by changing the file to a .php extension.

Adding the CSS

There must be a link to the CSS file in the header (just before the </HEAD> tag) of any page that displays the Easy PHP Calendar script.

<?php $CSS=1; require("calendar/calendar.php"); ?>
</head>

Replace "calendar/" with the actual path to the calendar directory relative to the directory of your web page.

Adding the Mouseover

If using the mouse-over option, make sure the code below is in the BODY section of any PHP page that will display the calendar (preferably the first line below the <body> tag).

<body>
<?php $OL=1; require("calendar/calendar.php"); ?>

Replace "calendar/" with the actual path to the calendar directory relative to the directory of your web page.

Set the option to use the mouse-over pop-up to Yes in the Settings.

Calendar Styles Integration Code

After adding the CSS / Mouseover code shown above to all page(s) displaying the calendar, follow the links below for the code to add a specific calendar style to a web page.

Changing the Theme

The theme (or skin) of the calendar is chosen in settings. It can also be changed "on the fly" to a different theme. To do this, at the top of the web page before the insert CSS code section, add the code below where "theme" is the exact name (and case) of the directory containing the theme to display. If the script cannot find this theme, it will default to the one set in settings.

<?php $showTheme="theme"; ?>