Support - Calendar Script
Adhost offers our clients a World Wide Web-based and Web editable Events Calendar.
Demo
If you would like to view our demo then please email support@adhost.com requesting access. They will send you the link and necessary information.
Setup
You can setup your calendar in three easy steps:
- Create the Configuration File
- Create the link to your calendar
- Change the permissions for the calendar directory
And once you have set it up, you can edit the calendar.
The Configuration File
The calendar depends on a configuration file which you create using any HTML or text editor you may prefer. The file may be named whatever you want but must end with the extension ".cfg" (without the quotes). Our example file is named calendar.cfg -which might not be a bad choice for yours. This file may be placed anywhere in your Web site. In our examples below, it has been placed in a directory called "calendar". The configuration file MUST contain these 4 lines.
- UNIX path to the calendar directory.
- URL to the calendar directory.
- URL to an image (may be blank).
- Title of your calendar (may be blank).
Example:
- /home/web/sites/yourdomain/calendar
- http://www.yourdomain.com/calendar
- http://www.yourdomain.com/images/logo.gif
- My Calendar
In the first line above, you would replace "yourdomain" with your domain name without the .com, for example: adhost instead of adhost.com. If your calendar directory is down an additional level, just add the intervening directories.
In the second line above, replace "yourdomain" with your domain name.
In the third line above, do the same thing and add the path to your image directory if you want an image to display on your calendar page (an image is not required).
The fourth line above should be changed to whatever title you want for your calendar (a title is not required). Below is the actual config file for the example calendar we linked to at the top of this page:
/home/web/sites/adhost/help/calendar
http://www.adhost.com/help/calendar
http://www.adhost.com/images/logo.gif
Example Calendar
NOTE: Before you upload your config file, make sure it contains no extra spaces or lines - either will cause the script to fail!
Linking
Now you need to place a link to the calendar on whatever page or pages you wish the calendar to link from. We suggest using a text link.
Change Permissions
Once you have finished the steps above, the "permissions" on the calendar directory need to be changed to allow the entries to be "written" to it. You can do this yourself through a telnet session or have Adhost do it.
Telnet:
Secure Shell (SSH2) to your site, navigate to your calendar directory and then (the "adhost%" signifies the command line once you've established a SSH2 connection to your account): adhost% chmod 757 calendar. In the example above, the calendar directory is named "calendar".
Have Adhost Do It:
Send email to our support@adhost.com to have us change your permissions for you. Include the name and path to the calendar directory.
After the permissions are changed, click on the link you have created. The calendar program will now create the other directories it needs to operate.
Edit the Calendar
To edit the calendar, click on the day you want to edit in the small calendar in the upper right corner. You will be taken to the edit page, where you can enter your description. You may use HTML and/or call images into your listing (specify the full URL) if you wish.
The display always starts from the current day of the month, unless the variable "action" is set to "fullmonth" or "fullyear" (see variables below).
All data for the calendar is kept in a directory you specify. Within that directory the calendar program will create a temp directory, (where the created display pages are kept), an edit directory (where the created edit pages are kept), and a year directory for every year for which you create data.
You can "secure" the whole calendar, or just the editing of it by using standard .htaccess style security on the calendar directory, the edit directory, or both. For additional security, ask the support@adhost.com to create your calendar directory for you, rather than creating it yourself, so that the webmaster can set certain file permissions for you.
Variables
You may include certain arguments in your calendar link that will force the calendar to do your bidding:
- year - force year to yyyy (4 digit number, ie; "1999")
- month - force month (1 to 12)
- day - force day (1 to 31)
- action - "fullmonth" or "fullyear"
Code example:
a href="/cgi-bin/calendar.pl? action=fullmonth&cfg=/home/web/ sites/adhost/help/seminar_calendar/cal.cfg"










