How To Install MyGoogleCal2.php
Posted March 22nd, 2008 in ProgrammingTags: Google, Hacking, PHP, Programming
One of my readers asked for a step-by-step set of instructions to install MyGoogleCal2.php. My original posts for restyling Google Calendar did assume a certain level of expertise. This should hopefully help those who are still confused.
-
Download mygooglecal2.zip.
-
Unzip the file on your server, typically into a subfolder named ‘mygooglecal’.
-
If your web server supports .htaccess files and your site does not already have one, just move the .htaccess file that was in the zip file to the root of your site. If your web site already has an .htaccess file, then you will need to copy the mod_rewrite rules from the the zip file’s .htaccess file to the existing one.
-
If you have not already done so, go to the Embeddable Calendar Helper and generate the HTML code for the calendar. Place this code into the page that will display the calendar.
-
The HTML code for the Google Calendar is an <iframe> tag. You need to edit the src attribute to point to MyGoogleCal2.php on your server and not http://www.google.com/calendar/embed. See ‘USAGE:’ in the MyGoogleCal2.php file for an example.
-
That’s the basic installation. You should be able to edit the included CSS file. If you want to use a different CSS file or move it somewhere else, make sure to update the $stylesheet variable in MyGoogleCal2.php. Remember, the CSS file is not guaranteed to be up-to-date so you may have to download your own copy. Just follow the directions listed in MyGoogleCal2.php.
Some additional notes:
-
Some of the colors that the Google Calendar uses are: #c3d9ff, #bcd, #cde, #e8eef7, #e5ecf9, and #112abb. That should help when editing the CSS file. I highly recommend using Firefox and the Firebug extension. The extension has an Inspect feature that let’s you select a DOM object and see its element ID, class, and style attributes. That will help identify which CSS rule you need change.
-
If the display of the calendar is blank, that usually means your PHP configuration is wrong and most likely the curl module is not installed or disabled. Open the phpinfo.php file included in the zip file. This will list a bunch of debug information about your web server’s PHP configuration. If you do not see curl listed or curl is listed but disabled, then you will need to talk to your system administrator to fix it.
Well, I’ll start the moronic questions (thanks for this, by the way)
I’m getting the blank calendar problem. I think it’s the curl thing (I don’t see any mention of it on the PHP configuration page.) Since my host is some large sinister corporation I’m guessing that making this happen will involve pain, but that’s an aside I suppose. I just want to check everything else first. So: what’s a “.htaccess” file, and how do I know if my web server supports it? If my web server doesn’t support it (I don’t already have one), could this also cause the blank calendar problem?
Also, should “blank” be *literally* blank? Like, when I check the page source when I point my browser towards my MyGoogleCal2.php page, there’s simply nothing there at all.
Update: My php configuration file doesn’t mention CURL (http://www.arrowtownhousing.org/googlecal/phpinfo.php) but the host claims they support CURL.
Jeff,
Your MyGoogleCal2.php page is working just fine. You can test this by going to
http://www.arrowtownhousing.org/googlecal/MyGoogleCal2.php?src=user%40domain.tld
and replace ‘user%40domain.tld’ with your Google Calendar account. So curl is working fine. If your web server is Apache it will support .htaccess files. Other web servers handle URL rewriting differently and will probably require converting the .htaccess file into another format.
You’re one of those internet-dwelling saints. Thanks so much.
IS there anyway to change the white background or blue border on the Google Calendar when Iframing it?
Vale Kelley
Three Lakes Marketing
http://www.Threelakesmarketing.com
Agenda doesn’t work for me…
hi,
is it possible to display more than one calendar at once? if i do it as it is written in the tutorial it takes the first calendar of my account only … but i want them all (in different colors) …
thanks in advance,
benno
Yes. You should be able to display more than one calendar. See the Usage section or better yet, use the Embeddable Calendar Helper linked in Step 4 above.
I’ve noticed that not all calendars are embeddable if they’re imported from a non-Google source.
[…] installation of MyGoogleCal4 is the same as the installation for MyGoogleCal2 except you download the zip file above. You can ignore step 3 regarding the .htaccess file. As far […]