Google Calendar

Post Reply

Topic author
timotheosh
Active Member
Posts: 3
Joined: 20. May 2012 00:43

Google Calendar

Post by timotheosh »

I have an idea for a mod I want to implement. I know PHP well enough, but still trying to get used to PHPBB and Board3.

I want to use Google's iframe code in a block to show a Google calendar, but I need to change the ctz= in the iframe url based on the user's timezone.
So I am thinking in the mod I will need a class with something like:
if ($user->user_timezone == '0.00') $usertz = "Europe%2FLondon";
elseif ($user->user_timezone == '-1.00') $usertz = "Atlantic%2FAzores";
elseif ($user->user_timezone == '-2.00') $usertz = "America%2FNoronha";
....
else $usertz = 'Some default seting';
Set the template variable to equal $usertz
The create the template file with iframe code and my variable (ctz={USERTZ})

I want this to be a block I can put on the Board3 Portal
Any tips as to where to look on how to do this?
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Google Calendar

Post by Marc »

This should help with creating a module for Board3 Portal 2.0.0:
knowledge/kb_categorie.php?id=23

Topic author
timotheosh
Active Member
Posts: 3
Joined: 20. May 2012 00:43

Re: Google Calendar

Post by timotheosh »

Thanks for the info!

I got it working, and just to set the record straight on the example in my previous post, in case anyone else tries a similar venture, dont forget to $user to your globals declaration in your function (you'll see the declaration in the functions in portal_default.php described in the previous poster's link). And the variable is not $user->user_timezone but $user->data['user_timezone']
Post Reply

Return to “Modifications Support”