Simple Calendar – Google Calendar Plugin - Version 0.2.1

Version Description

  • Added option to allow 'More details' links to open in new window / tab.
  • Added option to choose a specific timezone for each feed
  • Line breaks in an event description will now be preserved
  • Fixed a bug casing the title to not be displayed on lists
  • Other minor bug fixes
Download this release

Release Info

Developer rosshanney
Plugin Icon 128x128 Simple Calendar – Google Calendar Plugin
Version 0.2.1
Comparing to
See all releases

Code changes from version 0.2 to 0.2.1

admin/add.php CHANGED
@@ -88,13 +88,17 @@ function gce_add_time_format_field(){
88
  }
89
 
90
  //Timezone offset
91
- /*function gce_add_offset_field(){
 
 
 
 
92
  ?>
93
- <span class="description"><?php _e('If you are having issues with dates not being displayed in your timezone, enter an offset, in seconds (3600 = 1 hour), here. This can be positive or negative.', GCE_TEXT_DOMAIN); ?></span>
94
  <br />
95
- <input type="text" name="gce_options[offset]" value="0" />
96
  <?php
97
- }*/
98
 
99
  //Cache duration
100
  function gce_add_cache_duration_field(){
@@ -109,7 +113,7 @@ function gce_add_cache_duration_field(){
109
  //Display options
110
  function gce_add_display_main_text(){
111
  ?>
112
- <p><?php _e('These settings control what information will be displayed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
113
  <p><?php _e('You can use some HTML in the text fields, but ensure it is valid or things might go wonky. Text fields can be empty too.', GCE_TEXT_DOMAIN); ?></p>
114
  <?php
115
  }
@@ -168,6 +172,9 @@ function gce_add_display_link_field(){
168
  ?>
169
  <input type="checkbox" name="gce_options[display_link]" value="on" checked="checked" />
170
  <span class="description"><?php _e('Show a link to the Google Calendar page for an event?', GCE_TEXT_DOMAIN); ?></span>
 
 
 
171
  <br /><br />
172
  <input type="text" name="gce_options[display_link_text]" value="More details" />
173
  <span class="description"><?php _e('The link text to be displayed.', GCE_TEXT_DOMAIN); ?></span>
88
  }
89
 
90
  //Timezone offset
91
+ function gce_add_timezone_field(){
92
+ require_once 'timezone-choices.php';
93
+ $timezone_list = gce_get_timezone_choices();
94
+ //Set selected="selected" for default option
95
+ $timezone_list = str_replace('<option value="default">Default</option>', '<option value="default" selected="selected">Default</option>', $timezone_list);
96
  ?>
97
+ <span class="description"><?php _e('If you are having problems with dates and times displaying in the wrong timezone, select a city in your required timezone here.', GCE_TEXT_DOMAIN); ?></span>
98
  <br />
99
+ <?php echo $timezone_list; ?>
100
  <?php
101
+ }
102
 
103
  //Cache duration
104
  function gce_add_cache_duration_field(){
113
  //Display options
114
  function gce_add_display_main_text(){
115
  ?>
116
+ <p><?php _e('These settings control what information will be displayed for this feed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
117
  <p><?php _e('You can use some HTML in the text fields, but ensure it is valid or things might go wonky. Text fields can be empty too.', GCE_TEXT_DOMAIN); ?></p>
118
  <?php
119
  }
172
  ?>
173
  <input type="checkbox" name="gce_options[display_link]" value="on" checked="checked" />
174
  <span class="description"><?php _e('Show a link to the Google Calendar page for an event?', GCE_TEXT_DOMAIN); ?></span>
175
+ <br />
176
+ <input type="checkbox" name="gce_options[display_link_target]" value="on" />
177
+ <span class="description"><?php _e('Links open in a new window / tab?', GCE_TEXT_DOMAIN); ?></span>
178
  <br /><br />
179
  <input type="text" name="gce_options[display_link_text]" value="More details" />
180
  <span class="description"><?php _e('The link text to be displayed.', GCE_TEXT_DOMAIN); ?></span>
admin/edit.php CHANGED
@@ -93,15 +93,19 @@ function gce_edit_time_format_field(){
93
  }
94
 
95
  //Timezone offset
96
- /*function gce_edit_offset_field(){
97
  $options = get_option(GCE_OPTIONS_NAME);
98
  $options = $options[$_GET['id']];
 
 
 
 
99
  ?>
100
- <span class="description"><?php _e('If you are having issues with dates not being displayed in your timezone, enter an offset, in seconds (3600 = 1 hour), here. This can be positive or negative.', GCE_TEXT_DOMAIN); ?></span>
101
  <br />
102
- <input type="text" name="gce_options[offset]" value="<?php echo $options['offset']; ?>" />
103
  <?php
104
- }*/
105
 
106
  //Cache duration
107
  function gce_edit_cache_duration_field(){
@@ -118,7 +122,7 @@ function gce_edit_cache_duration_field(){
118
 
119
  function gce_edit_display_main_text(){
120
  ?>
121
- <p><?php _e('These settings control what information will be displayed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
122
  <p><?php _e('You can use some HTML in the text fields, but ensure it is valid or things might go wonky. Text fields can be empty too.', GCE_TEXT_DOMAIN); ?></p>
123
  <?php
124
  }
@@ -189,6 +193,9 @@ function gce_edit_display_link_field(){
189
  ?>
190
  <input type="checkbox" name="gce_options[display_link]"<?php checked($options['display_link'], 'on'); ?> value="on" />
191
  <span class="description"><?php _e('Show a link to the Google Calendar page for an event?', GCE_TEXT_DOMAIN); ?></span>
 
 
 
192
  <br /><br />
193
  <input type="text" name="gce_options[display_link_text]" value="<?php echo stripslashes(esc_html($options['display_link_text'])); ?>" />
194
  <span class="description"><?php _e('The link text to be displayed.', GCE_TEXT_DOMAIN); ?></span>
93
  }
94
 
95
  //Timezone offset
96
+ function gce_edit_timezone_field(){
97
  $options = get_option(GCE_OPTIONS_NAME);
98
  $options = $options[$_GET['id']];
99
+ require_once 'timezone-choices.php';
100
+ $timezone_list = gce_get_timezone_choices();
101
+ //Set selected="selected" for selected timezone
102
+ $timezone_list = str_replace(('<option value="' . $options['timezone'] . '"'), ('<option value="' . $options['timezone'] . '" selected="selected"'), $timezone_list);
103
  ?>
104
+ <span class="description"><?php _e('If you are having problems with dates and times displaying in the wrong timezone, select a city in your required timezone here.', GCE_TEXT_DOMAIN); ?></span>
105
  <br />
106
+ <?php echo $timezone_list; ?>
107
  <?php
108
+ }
109
 
110
  //Cache duration
111
  function gce_edit_cache_duration_field(){
122
 
123
  function gce_edit_display_main_text(){
124
  ?>
125
+ <p><?php _e('These settings control what information will be displayed for this feed in the tooltip (for grids), or in a list.', GCE_TEXT_DOMAIN); ?></p>
126
  <p><?php _e('You can use some HTML in the text fields, but ensure it is valid or things might go wonky. Text fields can be empty too.', GCE_TEXT_DOMAIN); ?></p>
127
  <?php
128
  }
193
  ?>
194
  <input type="checkbox" name="gce_options[display_link]"<?php checked($options['display_link'], 'on'); ?> value="on" />
195
  <span class="description"><?php _e('Show a link to the Google Calendar page for an event?', GCE_TEXT_DOMAIN); ?></span>
196
+ <br />
197
+ <input type="checkbox" name="gce_options[display_link_target]"<?php checked($options['display_link_target'], 'on'); ?> value="on" />
198
+ <span class="description"><?php _e('Links open in a new window / tab?', GCE_TEXT_DOMAIN); ?></span>
199
  <br /><br />
200
  <input type="text" name="gce_options[display_link_text]" value="<?php echo stripslashes(esc_html($options['display_link_text'])); ?>" />
201
  <span class="description"><?php _e('The link text to be displayed.', GCE_TEXT_DOMAIN); ?></span>
admin/timezone-choices.php ADDED
@@ -0,0 +1,429 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ function gce_get_timezone_choices(){
3
+ return '
4
+ <select name="gce_options[timezone]">
5
+ <option value="default">Default</option>
6
+ <optgroup label="Africa">
7
+ <option value="Africa/Abidjan">Abidjan</option>
8
+ <option value="Africa/Accra">Accra</option>
9
+ <option value="Africa/Addis_Ababa">Addis Ababa</option>
10
+ <option value="Africa/Algiers">Algiers</option>
11
+ <option value="Africa/Asmara">Asmara</option>
12
+ <option value="Africa/Bamako">Bamako</option>
13
+ <option value="Africa/Bangui">Bangui</option>
14
+ <option value="Africa/Banjul">Banjul</option>
15
+ <option value="Africa/Bissau">Bissau</option>
16
+ <option value="Africa/Blantyre">Blantyre</option>
17
+ <option value="Africa/Brazzaville">Brazzaville</option>
18
+ <option value="Africa/Bujumbura">Bujumbura</option>
19
+ <option value="Africa/Cairo">Cairo</option>
20
+ <option value="Africa/Casablanca">Casablanca</option>
21
+ <option value="Africa/Ceuta">Ceuta</option>
22
+ <option value="Africa/Conakry">Conakry</option>
23
+ <option value="Africa/Dakar">Dakar</option>
24
+ <option value="Africa/Dar_es_Salaam">Dar es Salaam</option>
25
+ <option value="Africa/Djibouti">Djibouti</option>
26
+ <option value="Africa/Douala">Douala</option>
27
+ <option value="Africa/El_Aaiun">El Aaiun</option>
28
+ <option value="Africa/Freetown">Freetown</option>
29
+ <option value="Africa/Gaborone">Gaborone</option>
30
+ <option value="Africa/Harare">Harare</option>
31
+ <option value="Africa/Johannesburg">Johannesburg</option>
32
+ <option value="Africa/Kampala">Kampala</option>
33
+ <option value="Africa/Khartoum">Khartoum</option>
34
+ <option value="Africa/Kigali">Kigali</option>
35
+ <option value="Africa/Kinshasa">Kinshasa</option>
36
+ <option value="Africa/Lagos">Lagos</option>
37
+ <option value="Africa/Libreville">Libreville</option>
38
+ <option value="Africa/Lome">Lome</option>
39
+ <option value="Africa/Luanda">Luanda</option>
40
+ <option value="Africa/Lubumbashi">Lubumbashi</option>
41
+ <option value="Africa/Lusaka">Lusaka</option>
42
+ <option value="Africa/Malabo">Malabo</option>
43
+ <option value="Africa/Maputo">Maputo</option>
44
+ <option value="Africa/Maseru">Maseru</option>
45
+ <option value="Africa/Mbabane">Mbabane</option>
46
+ <option value="Africa/Mogadishu">Mogadishu</option>
47
+ <option value="Africa/Monrovia">Monrovia</option>
48
+ <option value="Africa/Nairobi">Nairobi</option>
49
+ <option value="Africa/Ndjamena">Ndjamena</option>
50
+ <option value="Africa/Niamey">Niamey</option>
51
+ <option value="Africa/Nouakchott">Nouakchott</option>
52
+ <option value="Africa/Ouagadougou">Ouagadougou</option>
53
+ <option value="Africa/Porto-Novo">Porto-Novo</option>
54
+ <option value="Africa/Sao_Tome">Sao Tome</option>
55
+ <option value="Africa/Tripoli">Tripoli</option>
56
+ <option value="Africa/Tunis">Tunis</option>
57
+ <option value="Africa/Windhoek">Windhoek</option>
58
+ </optgroup>
59
+ <optgroup label="America">
60
+ <option value="America/Adak">Adak</option>
61
+ <option value="America/Anchorage">Anchorage</option>
62
+ <option value="America/Anguilla">Anguilla</option>
63
+ <option value="America/Antigua">Antigua</option>
64
+ <option value="America/Araguaina">Araguaina</option>
65
+ <option value="America/Argentina/Buenos_Aires">Argentina - Buenos Aires</option>
66
+ <option value="America/Argentina/Catamarca">Argentina - Catamarca</option>
67
+ <option value="America/Argentina/Cordoba">Argentina - Cordoba</option>
68
+ <option value="America/Argentina/Jujuy">Argentina - Jujuy</option>
69
+ <option value="America/Argentina/La_Rioja">Argentina - La Rioja</option>
70
+ <option value="America/Argentina/Mendoza">Argentina - Mendoza</option>
71
+ <option value="America/Argentina/Rio_Gallegos">Argentina - Rio Gallegos</option>
72
+ <option value="America/Argentina/Salta">Argentina - Salta</option>
73
+ <option value="America/Argentina/San_Juan">Argentina - San Juan</option>
74
+ <option value="America/Argentina/San_Luis">Argentina - San Luis</option>
75
+ <option value="America/Argentina/Tucuman">Argentina - Tucuman</option>
76
+ <option value="America/Argentina/Ushuaia">Argentina - Ushuaia</option>
77
+ <option value="America/Aruba">Aruba</option>
78
+ <option value="America/Asuncion">Asuncion</option>
79
+ <option value="America/Atikokan">Atikokan</option>
80
+ <option value="America/Bahia">Bahia</option>
81
+ <option value="America/Barbados">Barbados</option>
82
+ <option value="America/Belem">Belem</option>
83
+ <option value="America/Belize">Belize</option>
84
+ <option value="America/Blanc-Sablon">Blanc-Sablon</option>
85
+ <option value="America/Boa_Vista">Boa Vista</option>
86
+ <option value="America/Bogota">Bogota</option>
87
+ <option value="America/Boise">Boise</option>
88
+ <option value="America/Cambridge_Bay">Cambridge Bay</option>
89
+ <option value="America/Campo_Grande">Campo Grande</option>
90
+ <option value="America/Cancun">Cancun</option>
91
+ <option value="America/Caracas">Caracas</option>
92
+ <option value="America/Cayenne">Cayenne</option>
93
+ <option value="America/Cayman">Cayman</option>
94
+ <option value="America/Chicago">Chicago</option>
95
+ <option value="America/Chihuahua">Chihuahua</option>
96
+ <option value="America/Costa_Rica">Costa Rica</option>
97
+ <option value="America/Cuiaba">Cuiaba</option>
98
+ <option value="America/Curacao">Curacao</option>
99
+ <option value="America/Danmarkshavn">Danmarkshavn</option>
100
+ <option value="America/Dawson">Dawson</option>
101
+ <option value="America/Dawson_Creek">Dawson Creek</option>
102
+ <option value="America/Denver">Denver</option>
103
+ <option value="America/Detroit">Detroit</option>
104
+ <option value="America/Dominica">Dominica</option>
105
+ <option value="America/Edmonton">Edmonton</option>
106
+ <option value="America/Eirunepe">Eirunepe</option>
107
+ <option value="America/El_Salvador">El Salvador</option>
108
+ <option value="America/Fortaleza">Fortaleza</option>
109
+ <option value="America/Glace_Bay">Glace Bay</option>
110
+ <option value="America/Godthab">Godthab</option>
111
+ <option value="America/Goose_Bay">Goose Bay</option>
112
+ <option value="America/Grand_Turk">Grand Turk</option>
113
+ <option value="America/Grenada">Grenada</option>
114
+ <option value="America/Guadeloupe">Guadeloupe</option>
115
+ <option value="America/Guatemala">Guatemala</option>
116
+ <option value="America/Guayaquil">Guayaquil</option>
117
+ <option value="America/Guyana">Guyana</option>
118
+ <option value="America/Halifax">Halifax</option>
119
+ <option value="America/Havana">Havana</option>
120
+ <option value="America/Hermosillo">Hermosillo</option>
121
+ <option value="America/Indiana/Indianapolis">Indiana - Indianapolis</option>
122
+ <option value="America/Indiana/Knox">Indiana - Knox</option>
123
+ <option value="America/Indiana/Marengo">Indiana - Marengo</option>
124
+ <option value="America/Indiana/Petersburg">Indiana - Petersburg</option>
125
+ <option value="America/Indiana/Tell_City">Indiana - Tell City</option>
126
+ <option value="America/Indiana/Vevay">Indiana - Vevay</option>
127
+ <option value="America/Indiana/Vincennes">Indiana - Vincennes</option>
128
+ <option value="America/Indiana/Winamac">Indiana - Winamac</option>
129
+ <option value="America/Inuvik">Inuvik</option>
130
+ <option value="America/Iqaluit">Iqaluit</option>
131
+ <option value="America/Jamaica">Jamaica</option>
132
+ <option value="America/Juneau">Juneau</option>
133
+ <option value="America/Kentucky/Louisville">Kentucky - Louisville</option>
134
+ <option value="America/Kentucky/Monticello">Kentucky - Monticello</option>
135
+ <option value="America/La_Paz">La Paz</option>
136
+ <option value="America/Lima">Lima</option>
137
+ <option value="America/Los_Angeles">Los Angeles</option>
138
+ <option value="America/Maceio">Maceio</option>
139
+ <option value="America/Managua">Managua</option>
140
+ <option value="America/Manaus">Manaus</option>
141
+ <option value="America/Marigot">Marigot</option>
142
+ <option value="America/Martinique">Martinique</option>
143
+ <option value="America/Mazatlan">Mazatlan</option>
144
+ <option value="America/Menominee">Menominee</option>
145
+ <option value="America/Merida">Merida</option>
146
+ <option value="America/Mexico_City">Mexico City</option>
147
+ <option value="America/Miquelon">Miquelon</option>
148
+ <option value="America/Moncton">Moncton</option>
149
+ <option value="America/Monterrey">Monterrey</option>
150
+ <option value="America/Montevideo">Montevideo</option>
151
+ <option value="America/Montreal">Montreal</option>
152
+ <option value="America/Montserrat">Montserrat</option>
153
+ <option value="America/Nassau">Nassau</option>
154
+ <option value="America/New_York">New York</option>
155
+ <option value="America/Nipigon">Nipigon</option>
156
+ <option value="America/Nome">Nome</option>
157
+ <option value="America/Noronha">Noronha</option>
158
+ <option value="America/North_Dakota/Center">North Dakota - Center</option>
159
+ <option value="America/North_Dakota/New_Salem">North Dakota - New Salem</option>
160
+ <option value="America/Panama">Panama</option>
161
+ <option value="America/Pangnirtung">Pangnirtung</option>
162
+ <option value="America/Paramaribo">Paramaribo</option>
163
+ <option value="America/Phoenix">Phoenix</option>
164
+ <option value="America/Port-au-Prince">Port-au-Prince</option>
165
+ <option value="America/Port_of_Spain">Port of Spain</option>
166
+ <option value="America/Porto_Velho">Porto Velho</option>
167
+ <option value="America/Puerto_Rico">Puerto Rico</option>
168
+ <option value="America/Rainy_River">Rainy River</option>
169
+ <option value="America/Rankin_Inlet">Rankin Inlet</option>
170
+ <option value="America/Recife">Recife</option>
171
+ <option value="America/Regina">Regina</option>
172
+ <option value="America/Resolute">Resolute</option>
173
+ <option value="America/Rio_Branco">Rio Branco</option>
174
+ <option value="America/Santarem">Santarem</option>
175
+ <option value="America/Santiago">Santiago</option>
176
+ <option value="America/Santo_Domingo">Santo Domingo</option>
177
+ <option value="America/Sao_Paulo">Sao Paulo</option>
178
+ <option value="America/Scoresbysund">Scoresbysund</option>
179
+ <option value="America/Shiprock">Shiprock</option>
180
+ <option value="America/St_Barthelemy">St Barthelemy</option>
181
+ <option value="America/St_Johns">St Johns</option>
182
+ <option value="America/St_Kitts">St Kitts</option>
183
+ <option value="America/St_Lucia">St Lucia</option>
184
+ <option value="America/St_Thomas">St Thomas</option>
185
+ <option value="America/St_Vincent">St Vincent</option>
186
+ <option value="America/Swift_Current">Swift Current</option>
187
+ <option value="America/Tegucigalpa">Tegucigalpa</option>
188
+ <option value="America/Thule">Thule</option>
189
+ <option value="America/Thunder_Bay">Thunder Bay</option>
190
+ <option value="America/Tijuana">Tijuana</option>
191
+ <option value="America/Toronto">Toronto</option>
192
+ <option value="America/Tortola">Tortola</option>
193
+ <option value="America/Vancouver">Vancouver</option>
194
+ <option value="America/Whitehorse">Whitehorse</option>
195
+ <option value="America/Winnipeg">Winnipeg</option>
196
+ <option value="America/Yakutat">Yakutat</option>
197
+ <option value="America/Yellowknife">Yellowknife</option>
198
+ </optgroup>
199
+ <optgroup label="Antarctica">
200
+ <option value="Antarctica/Casey">Casey</option>
201
+ <option value="Antarctica/Davis">Davis</option>
202
+ <option value="Antarctica/DumontDUrville">DumontDUrville</option>
203
+ <option value="Antarctica/Mawson">Mawson</option>
204
+ <option value="Antarctica/McMurdo">McMurdo</option>
205
+ <option value="Antarctica/Palmer">Palmer</option>
206
+ <option value="Antarctica/Rothera">Rothera</option>
207
+ <option value="Antarctica/South_Pole">South Pole</option>
208
+ <option value="Antarctica/Syowa">Syowa</option>
209
+ <option value="Antarctica/Vostok">Vostok</option>
210
+ </optgroup>
211
+ <optgroup label="Arctic">
212
+ <option value="Arctic/Longyearbyen">Longyearbyen</option>
213
+ </optgroup>
214
+ <optgroup label="Asia">
215
+ <option value="Asia/Aden">Aden</option>
216
+ <option value="Asia/Almaty">Almaty</option>
217
+ <option value="Asia/Amman">Amman</option>
218
+ <option value="Asia/Anadyr">Anadyr</option>
219
+ <option value="Asia/Aqtau">Aqtau</option>
220
+ <option value="Asia/Aqtobe">Aqtobe</option>
221
+ <option value="Asia/Ashgabat">Ashgabat</option>
222
+ <option value="Asia/Baghdad">Baghdad</option>
223
+ <option value="Asia/Bahrain">Bahrain</option>
224
+ <option value="Asia/Baku">Baku</option>
225
+ <option value="Asia/Bangkok">Bangkok</option>
226
+ <option value="Asia/Beirut">Beirut</option>
227
+ <option value="Asia/Bishkek">Bishkek</option>
228
+ <option value="Asia/Brunei">Brunei</option>
229
+ <option value="Asia/Choibalsan">Choibalsan</option>
230
+ <option value="Asia/Chongqing">Chongqing</option>
231
+ <option value="Asia/Colombo">Colombo</option>
232
+ <option value="Asia/Damascus">Damascus</option>
233
+ <option value="Asia/Dhaka">Dhaka</option>
234
+ <option value="Asia/Dili">Dili</option>
235
+ <option value="Asia/Dubai">Dubai</option>
236
+ <option value="Asia/Dushanbe">Dushanbe</option>
237
+ <option value="Asia/Gaza">Gaza</option>
238
+ <option value="Asia/Harbin">Harbin</option>
239
+ <option value="Asia/Ho_Chi_Minh">Ho Chi Minh</option>
240
+ <option value="Asia/Hong_Kong">Hong Kong</option>
241
+ <option value="Asia/Hovd">Hovd</option>
242
+ <option value="Asia/Irkutsk">Irkutsk</option>
243
+ <option value="Asia/Jakarta">Jakarta</option>
244
+ <option value="Asia/Jayapura">Jayapura</option>
245
+ <option value="Asia/Jerusalem">Jerusalem</option>
246
+ <option value="Asia/Kabul">Kabul</option>
247
+ <option value="Asia/Kamchatka">Kamchatka</option>
248
+ <option value="Asia/Karachi">Karachi</option>
249
+ <option value="Asia/Kashgar">Kashgar</option>
250
+ <option value="Asia/Kathmandu">Kathmandu</option>
251
+ <option value="Asia/Kolkata">Kolkata</option>
252
+ <option value="Asia/Krasnoyarsk">Krasnoyarsk</option>
253
+ <option value="Asia/Kuala_Lumpur">Kuala Lumpur</option>
254
+ <option value="Asia/Kuching">Kuching</option>
255
+ <option value="Asia/Kuwait">Kuwait</option>
256
+ <option value="Asia/Macau">Macau</option>
257
+ <option value="Asia/Magadan">Magadan</option>
258
+ <option value="Asia/Makassar">Makassar</option>
259
+ <option value="Asia/Manila">Manila</option>
260
+ <option value="Asia/Muscat">Muscat</option>
261
+ <option value="Asia/Nicosia">Nicosia</option>
262
+ <option value="Asia/Novosibirsk">Novosibirsk</option>
263
+ <option value="Asia/Omsk">Omsk</option>
264
+ <option value="Asia/Oral">Oral</option>
265
+ <option value="Asia/Phnom_Penh">Phnom Penh</option>
266
+ <option value="Asia/Pontianak">Pontianak</option>
267
+ <option value="Asia/Pyongyang">Pyongyang</option>
268
+ <option value="Asia/Qatar">Qatar</option>
269
+ <option value="Asia/Qyzylorda">Qyzylorda</option>
270
+ <option value="Asia/Rangoon">Rangoon</option>
271
+ <option value="Asia/Riyadh">Riyadh</option>
272
+ <option value="Asia/Sakhalin">Sakhalin</option>
273
+ <option value="Asia/Samarkand">Samarkand</option>
274
+ <option value="Asia/Seoul">Seoul</option>
275
+ <option value="Asia/Shanghai">Shanghai</option>
276
+ <option value="Asia/Singapore">Singapore</option>
277
+ <option value="Asia/Taipei">Taipei</option>
278
+ <option value="Asia/Tashkent">Tashkent</option>
279
+ <option value="Asia/Tbilisi">Tbilisi</option>
280
+ <option value="Asia/Tehran">Tehran</option>
281
+ <option value="Asia/Thimphu">Thimphu</option>
282
+ <option value="Asia/Tokyo">Tokyo</option>
283
+ <option value="Asia/Ulaanbaatar">Ulaanbaatar</option>
284
+ <option value="Asia/Urumqi">Urumqi</option>
285
+ <option value="Asia/Vientiane">Vientiane</option>
286
+ <option value="Asia/Vladivostok">Vladivostok</option>
287
+ <option value="Asia/Yakutsk">Yakutsk</option>
288
+ <option value="Asia/Yekaterinburg">Yekaterinburg</option>
289
+ <option value="Asia/Yerevan">Yerevan</option>
290
+ </optgroup>
291
+ <optgroup label="Atlantic">
292
+ <option value="Atlantic/Azores">Azores</option>
293
+ <option value="Atlantic/Bermuda">Bermuda</option>
294
+ <option value="Atlantic/Canary">Canary</option>
295
+ <option value="Atlantic/Cape_Verde">Cape Verde</option>
296
+ <option value="Atlantic/Faroe">Faroe</option>
297
+ <option value="Atlantic/Madeira">Madeira</option>
298
+ <option value="Atlantic/Reykjavik">Reykjavik</option>
299
+ <option value="Atlantic/South_Georgia">South Georgia</option>
300
+ <option value="Atlantic/Stanley">Stanley</option>
301
+ <option value="Atlantic/St_Helena">St Helena</option>
302
+ </optgroup>
303
+ <optgroup label="Australia">
304
+ <option value="Australia/Adelaide">Adelaide</option>
305
+ <option value="Australia/Brisbane">Brisbane</option>
306
+ <option value="Australia/Broken_Hill">Broken Hill</option>
307
+ <option value="Australia/Currie">Currie</option>
308
+ <option value="Australia/Darwin">Darwin</option>
309
+ <option value="Australia/Eucla">Eucla</option>
310
+ <option value="Australia/Hobart">Hobart</option>
311
+ <option value="Australia/Lindeman">Lindeman</option>
312
+ <option value="Australia/Lord_Howe">Lord Howe</option>
313
+ <option value="Australia/Melbourne">Melbourne</option>
314
+ <option value="Australia/Perth">Perth</option>
315
+ <option value="Australia/Sydney">Sydney</option>
316
+ </optgroup>
317
+ <optgroup label="Europe">
318
+ <option value="Europe/Amsterdam">Amsterdam</option>
319
+ <option value="Europe/Andorra">Andorra</option>
320
+ <option value="Europe/Athens">Athens</option>
321
+ <option value="Europe/Belgrade">Belgrade</option>
322
+ <option value="Europe/Berlin">Berlin</option>
323
+ <option value="Europe/Bratislava">Bratislava</option>
324
+ <option value="Europe/Brussels">Brussels</option>
325
+ <option value="Europe/Bucharest">Bucharest</option>
326
+ <option value="Europe/Budapest">Budapest</option>
327
+ <option value="Europe/Chisinau">Chisinau</option>
328
+ <option value="Europe/Copenhagen">Copenhagen</option>
329
+ <option value="Europe/Dublin">Dublin</option>
330
+ <option value="Europe/Gibraltar">Gibraltar</option>
331
+ <option value="Europe/Guernsey">Guernsey</option>
332
+ <option value="Europe/Helsinki">Helsinki</option>
333
+ <option value="Europe/Isle_of_Man">Isle of Man</option>
334
+ <option value="Europe/Istanbul">Istanbul</option>
335
+ <option value="Europe/Jersey">Jersey</option>
336
+ <option value="Europe/Kaliningrad">Kaliningrad</option>
337
+ <option value="Europe/Kiev">Kiev</option>
338
+ <option value="Europe/Lisbon">Lisbon</option>
339
+ <option value="Europe/Ljubljana">Ljubljana</option>
340
+ <option value="Europe/London">London</option>
341
+ <option value="Europe/Luxembourg">Luxembourg</option>
342
+ <option value="Europe/Madrid">Madrid</option>
343
+ <option value="Europe/Malta">Malta</option>
344
+ <option value="Europe/Mariehamn">Mariehamn</option>
345
+ <option value="Europe/Minsk">Minsk</option>
346
+ <option value="Europe/Monaco">Monaco</option>
347
+ <option value="Europe/Moscow">Moscow</option>
348
+ <option value="Europe/Oslo">Oslo</option>
349
+ <option value="Europe/Paris">Paris</option>
350
+ <option value="Europe/Podgorica">Podgorica</option>
351
+ <option value="Europe/Prague">Prague</option>
352
+ <option value="Europe/Riga">Riga</option>
353
+ <option value="Europe/Rome">Rome</option>
354
+ <option value="Europe/Samara">Samara</option>
355
+ <option value="Europe/San_Marino">San Marino</option>
356
+ <option value="Europe/Sarajevo">Sarajevo</option>
357
+ <option value="Europe/Simferopol">Simferopol</option>
358
+ <option value="Europe/Skopje">Skopje</option>
359
+ <option value="Europe/Sofia">Sofia</option>
360
+ <option value="Europe/Stockholm">Stockholm</option>
361
+ <option value="Europe/Tallinn">Tallinn</option>
362
+ <option value="Europe/Tirane">Tirane</option>
363
+ <option value="Europe/Uzhgorod">Uzhgorod</option>
364
+ <option value="Europe/Vaduz">Vaduz</option>
365
+ <option value="Europe/Vatican">Vatican</option>
366
+ <option value="Europe/Vienna">Vienna</option>
367
+ <option value="Europe/Vilnius">Vilnius</option>
368
+ <option value="Europe/Volgograd">Volgograd</option>
369
+ <option value="Europe/Warsaw">Warsaw</option>
370
+ <option value="Europe/Zagreb">Zagreb</option>
371
+ <option value="Europe/Zaporozhye">Zaporozhye</option>
372
+ <option value="Europe/Zurich">Zurich</option>
373
+ </optgroup>
374
+ <optgroup label="Indian">
375
+ <option value="Indian/Antananarivo">Antananarivo</option>
376
+ <option value="Indian/Chagos">Chagos</option>
377
+ <option value="Indian/Christmas">Christmas</option>
378
+ <option value="Indian/Cocos">Cocos</option>
379
+ <option value="Indian/Comoro">Comoro</option>
380
+ <option value="Indian/Kerguelen">Kerguelen</option>
381
+ <option value="Indian/Mahe">Mahe</option>
382
+ <option value="Indian/Maldives">Maldives</option>
383
+ <option value="Indian/Mauritius">Mauritius</option>
384
+ <option value="Indian/Mayotte">Mayotte</option>
385
+ <option value="Indian/Reunion">Reunion</option>
386
+ </optgroup>
387
+ <optgroup label="Pacific">
388
+ <option value="Pacific/Apia">Apia</option>
389
+ <option value="Pacific/Auckland">Auckland</option>
390
+ <option value="Pacific/Chatham">Chatham</option>
391
+ <option value="Pacific/Easter">Easter</option>
392
+ <option value="Pacific/Efate">Efate</option>
393
+ <option value="Pacific/Enderbury">Enderbury</option>
394
+ <option value="Pacific/Fakaofo">Fakaofo</option>
395
+ <option value="Pacific/Fiji">Fiji</option>
396
+ <option value="Pacific/Funafuti">Funafuti</option>
397
+ <option value="Pacific/Galapagos">Galapagos</option>
398
+ <option value="Pacific/Gambier">Gambier</option>
399
+ <option value="Pacific/Guadalcanal">Guadalcanal</option>
400
+ <option value="Pacific/Guam">Guam</option>
401
+ <option value="Pacific/Honolulu">Honolulu</option>
402
+ <option value="Pacific/Johnston">Johnston</option>
403
+ <option value="Pacific/Kiritimati">Kiritimati</option>
404
+ <option value="Pacific/Kosrae">Kosrae</option>
405
+ <option value="Pacific/Kwajalein">Kwajalein</option>
406
+ <option value="Pacific/Majuro">Majuro</option>
407
+ <option value="Pacific/Marquesas">Marquesas</option>
408
+ <option value="Pacific/Midway">Midway</option>
409
+ <option value="Pacific/Nauru">Nauru</option>
410
+ <option value="Pacific/Niue">Niue</option>
411
+ <option value="Pacific/Norfolk">Norfolk</option>
412
+ <option value="Pacific/Noumea">Noumea</option>
413
+ <option value="Pacific/Pago_Pago">Pago Pago</option>
414
+ <option value="Pacific/Palau">Palau</option>
415
+ <option value="Pacific/Pitcairn">Pitcairn</option>
416
+ <option value="Pacific/Ponape">Ponape</option>
417
+ <option value="Pacific/Port_Moresby">Port Moresby</option>
418
+ <option value="Pacific/Rarotonga">Rarotonga</option>
419
+ <option value="Pacific/Saipan">Saipan</option>
420
+ <option value="Pacific/Tahiti">Tahiti</option>
421
+ <option value="Pacific/Tarawa">Tarawa</option>
422
+ <option value="Pacific/Tongatapu">Tongatapu</option>
423
+ <option value="Pacific/Truk">Truk</option>
424
+ <option value="Pacific/Wake">Wake</option>
425
+ <option value="Pacific/Wallis">Wallis</option>
426
+ </optgroup>
427
+ </select>';
428
+ }
429
+ ?>
css/gce-style.css CHANGED
@@ -8,7 +8,7 @@
8
  width:100%;
9
  border-collapse:collapse;
10
  border:1px solid #CCCCCC;
11
- color:#DDDDDD;
12
  }
13
 
14
  .gce-page-grid .gce-calendar th{ /* Day headings (S, M etc.) */
@@ -152,7 +152,7 @@
152
  }
153
 
154
  .gce-widget-list .gce-list .gce-list-event{ /* The event title */
155
- background-color:#DDDDDD;
156
  }
157
 
158
  .gce-widget-list .gce-list .gce-list-title{ /* The title (not the same as event title) */
8
  width:100%;
9
  border-collapse:collapse;
10
  border:1px solid #CCCCCC;
11
+ color:#CCCCCC;
12
  }
13
 
14
  .gce-page-grid .gce-calendar th{ /* Day headings (S, M etc.) */
152
  }
153
 
154
  .gce-widget-list .gce-list .gce-list-event{ /* The event title */
155
+
156
  }
157
 
158
  .gce-widget-list .gce-list .gce-list-title{ /* The title (not the same as event title) */
google-calendar-events.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Google Calendar Events
4
  Plugin URI: http://www.rhanney.co.uk/plugins/google-calendar-events
5
  Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
6
- Version: 0.2
7
  Author: Ross Hanney
8
  Author URI: http://www.rhanney.co.uk
9
  License: GPL2
@@ -71,7 +71,7 @@ if(!class_exists('Google_Calendar_Events')){
71
  'max_events' => 25,
72
  'date_format' => '',
73
  'time_format' => '',
74
- //'offset' => 0,
75
  'cache_duration' => 43200,
76
  'display_title' => 'on',
77
  'display_start' => 'on',
@@ -84,7 +84,8 @@ if(!class_exists('Google_Calendar_Events')){
84
  'display_end_text' => 'Ends:',
85
  'display_location_text' => 'Location:',
86
  'display_desc_text' => 'Description:',
87
- 'display_link_text' => 'More details'
 
88
  );
89
 
90
  //Merge saved options with defaults
@@ -179,7 +180,7 @@ if(!class_exists('Google_Calendar_Events')){
179
  add_settings_field('gce_add_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_add_max_events_field', 'add_feed', 'gce_add');
180
  add_settings_field('gce_add_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_add_date_format_field', 'add_feed', 'gce_add');
181
  add_settings_field('gce_add_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_add_time_format_field', 'add_feed', 'gce_add');
182
- //add_settings_field('gce_add_offset_field', __('Timezone offset', GCE_TEXT_DOMAIN), 'gce_add_offset_field', 'add_feed', 'gce_add');
183
  add_settings_field('gce_add_cache_duration_field', __('Cache duration', GCE_TEXT_DOMAIN), 'gce_add_cache_duration_field', 'add_feed', 'gce_add');
184
 
185
  add_settings_section('gce_add_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_add_display_main_text', 'add_display');
@@ -201,7 +202,7 @@ if(!class_exists('Google_Calendar_Events')){
201
  add_settings_field('gce_edit_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_edit_max_events_field', 'edit_feed', 'gce_edit');
202
  add_settings_field('gce_edit_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_edit_date_format_field', 'edit_feed', 'gce_edit');
203
  add_settings_field('gce_edit_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_edit_time_format_field', 'edit_feed', 'gce_edit');
204
- //add_settings_field('gce_edit_offset_field', __('Timezone offset', GCE_TEXT_DOMAIN), 'gce_edit_offset_field', 'edit_feed', 'gce_edit');
205
  add_settings_field('gce_edit_cache_duration_field', __('Cache duration', GCE_TEXT_DOMAIN), 'gce_edit_cache_duration_field', 'edit_feed', 'gce_edit');
206
 
207
  add_settings_section('gce_edit_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_edit_display_main_text', 'edit_display');
@@ -245,8 +246,8 @@ if(!class_exists('Google_Calendar_Events')){
245
  $date_format = wp_filter_kses($input['date_format']);
246
  $time_format = wp_filter_kses($input['time_format']);
247
 
248
- //Check timezone offset is an integer
249
- //$offset = (int)$input['offset'];
250
 
251
  //Make sure cache duration is a positive integer or 0. If user has typed 0, leave as 0 but if 0 is returned from absint, set to default (43200)
252
  $cache_duration = $input['cache_duration'];
@@ -254,13 +255,14 @@ if(!class_exists('Google_Calendar_Events')){
254
  $cache_duration = (absint($cache_duration) == 0 ? 43200 : absint($cache_duration));
255
  }
256
 
257
- //Dooltip options must be 'on' or null
258
  $display_title = ($input['display_title'] == 'on' ? 'on' : null);
259
  $display_start = ($input['display_start'] == 'on' ? 'on' : null);
260
  $display_end = ($input['display_end'] == 'on' ? 'on' : null);
261
  $display_location = ($input['display_location'] == 'on' ? 'on' : null);
262
  $display_desc = ($input['display_desc'] == 'on' ? 'on' : null);
263
  $display_link = ($input['display_link'] == 'on' ? 'on' : null);
 
264
 
265
  //Escape display text
266
  $display_title_text = wp_filter_kses($input['display_title_text']);
@@ -279,7 +281,7 @@ if(!class_exists('Google_Calendar_Events')){
279
  'max_events' => $max_events,
280
  'date_format' => $date_format,
281
  'time_format' => $time_format,
282
- //'offset' => $offset,
283
  'cache_duration' => $cache_duration,
284
  'display_title' => $display_title,
285
  'display_start' => $display_start,
@@ -292,7 +294,8 @@ if(!class_exists('Google_Calendar_Events')){
292
  'display_end_text' => $display_end_text,
293
  'display_location_text' => $display_location_text,
294
  'display_desc_text' => $display_desc_text,
295
- 'display_link_text' => $display_link_text
 
296
  );
297
  }
298
 
@@ -370,7 +373,9 @@ function gce_print_list($feed_id){
370
  if($options[$feed_id]['display_end'] == 'on') $display_options['end'] = $options[$feed_id]['display_end_text'];
371
  if($options[$feed_id]['display_location'] == 'on') $display_options['location'] = $options[$feed_id]['display_location_text'];
372
  if($options[$feed_id]['display_desc'] == 'on') $display_options['desc'] = $options[$feed_id]['display_desc_text'];
373
- if($options[$feed_id]['display_link'] == 'on') $display_options['link'] = $options[$feed_id]['display_link_text'];
 
 
374
 
375
  //Creates a new GCE_Parser object for $feed_id
376
  $feed_data = new GCE_Parser(
@@ -380,7 +385,7 @@ function gce_print_list($feed_id){
380
  $options[$feed_id]['cache_duration'],
381
  $df,
382
  $tf,
383
- //$options[$feed_id]['offset'],
384
  null,
385
  $display_options
386
  );
@@ -414,6 +419,7 @@ function gce_print_grid($feed_id, $ajaxified = false, $month = null, $year = nul
414
  if($options[$feed_id]['display_location'] == 'on') $display_options['location'] = $options[$feed_id]['display_location_text'];
415
  if($options[$feed_id]['display_desc'] == 'on') $display_options['desc'] = $options[$feed_id]['display_desc_text'];
416
  if($options[$feed_id]['display_link'] == 'on') $display_options['link'] = $options[$feed_id]['display_link_text'];
 
417
 
418
  //Creates a new GCE_Parser object for $feed_id
419
  $feed_data = new GCE_Parser(
@@ -423,7 +429,7 @@ function gce_print_grid($feed_id, $ajaxified = false, $month = null, $year = nul
423
  $options[$feed_id]['cache_duration'],
424
  $df,
425
  $tf,
426
- //$options[$feed_id]['offset'],
427
  get_option('start_of_week'),
428
  $display_options
429
  );
3
  Plugin Name: Google Calendar Events
4
  Plugin URI: http://www.rhanney.co.uk/plugins/google-calendar-events
5
  Description: Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
6
+ Version: 0.2.1
7
  Author: Ross Hanney
8
  Author URI: http://www.rhanney.co.uk
9
  License: GPL2
71
  'max_events' => 25,
72
  'date_format' => '',
73
  'time_format' => '',
74
+ 'timezone' => 'default',
75
  'cache_duration' => 43200,
76
  'display_title' => 'on',
77
  'display_start' => 'on',
84
  'display_end_text' => 'Ends:',
85
  'display_location_text' => 'Location:',
86
  'display_desc_text' => 'Description:',
87
+ 'display_link_text' => 'More details',
88
+ 'display_link_target' => ''
89
  );
90
 
91
  //Merge saved options with defaults
180
  add_settings_field('gce_add_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_add_max_events_field', 'add_feed', 'gce_add');
181
  add_settings_field('gce_add_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_add_date_format_field', 'add_feed', 'gce_add');
182
  add_settings_field('gce_add_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_add_time_format_field', 'add_feed', 'gce_add');
183
+ add_settings_field('gce_add_timezone_field', __('Timezone adjustment', GCE_TEXT_DOMAIN), 'gce_add_timezone_field', 'add_feed', 'gce_add');
184
  add_settings_field('gce_add_cache_duration_field', __('Cache duration', GCE_TEXT_DOMAIN), 'gce_add_cache_duration_field', 'add_feed', 'gce_add');
185
 
186
  add_settings_section('gce_add_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_add_display_main_text', 'add_display');
202
  add_settings_field('gce_edit_max_events_field', __('Maximum number of events to retrieve', GCE_TEXT_DOMAIN), 'gce_edit_max_events_field', 'edit_feed', 'gce_edit');
203
  add_settings_field('gce_edit_date_format_field', __('Date format', GCE_TEXT_DOMAIN), 'gce_edit_date_format_field', 'edit_feed', 'gce_edit');
204
  add_settings_field('gce_edit_time_format_field', __('Time format', GCE_TEXT_DOMAIN), 'gce_edit_time_format_field', 'edit_feed', 'gce_edit');
205
+ add_settings_field('gce_edit_timezone_field', __('Timezone adjustment', GCE_TEXT_DOMAIN), 'gce_edit_timezone_field', 'edit_feed', 'gce_edit');
206
  add_settings_field('gce_edit_cache_duration_field', __('Cache duration', GCE_TEXT_DOMAIN), 'gce_edit_cache_duration_field', 'edit_feed', 'gce_edit');
207
 
208
  add_settings_section('gce_edit_display', __('Display Options', GCE_TEXT_DOMAIN), 'gce_edit_display_main_text', 'edit_display');
246
  $date_format = wp_filter_kses($input['date_format']);
247
  $time_format = wp_filter_kses($input['time_format']);
248
 
249
+ //Escape timezone
250
+ $timezone = esc_html($input['timezone']);
251
 
252
  //Make sure cache duration is a positive integer or 0. If user has typed 0, leave as 0 but if 0 is returned from absint, set to default (43200)
253
  $cache_duration = $input['cache_duration'];
255
  $cache_duration = (absint($cache_duration) == 0 ? 43200 : absint($cache_duration));
256
  }
257
 
258
+ //Tooltip options must be 'on' or null
259
  $display_title = ($input['display_title'] == 'on' ? 'on' : null);
260
  $display_start = ($input['display_start'] == 'on' ? 'on' : null);
261
  $display_end = ($input['display_end'] == 'on' ? 'on' : null);
262
  $display_location = ($input['display_location'] == 'on' ? 'on' : null);
263
  $display_desc = ($input['display_desc'] == 'on' ? 'on' : null);
264
  $display_link = ($input['display_link'] == 'on' ? 'on' : null);
265
+ $display_link_target = ($input['display_link_target'] == 'on' ? 'on' : null);
266
 
267
  //Escape display text
268
  $display_title_text = wp_filter_kses($input['display_title_text']);
281
  'max_events' => $max_events,
282
  'date_format' => $date_format,
283
  'time_format' => $time_format,
284
+ 'timezone' => $timezone,
285
  'cache_duration' => $cache_duration,
286
  'display_title' => $display_title,
287
  'display_start' => $display_start,
294
  'display_end_text' => $display_end_text,
295
  'display_location_text' => $display_location_text,
296
  'display_desc_text' => $display_desc_text,
297
+ 'display_link_text' => $display_link_text,
298
+ 'display_link_target' => $display_link_target
299
  );
300
  }
301
 
373
  if($options[$feed_id]['display_end'] == 'on') $display_options['end'] = $options[$feed_id]['display_end_text'];
374
  if($options[$feed_id]['display_location'] == 'on') $display_options['location'] = $options[$feed_id]['display_location_text'];
375
  if($options[$feed_id]['display_desc'] == 'on') $display_options['desc'] = $options[$feed_id]['display_desc_text'];
376
+ if($options[$feed_id]['display_link'] == 'on')$display_options['link'] = $options[$feed_id]['display_link_text'];
377
+ if($options[$feed_id]['display_link_target'] == 'on') $display_options['link_target'] = 'yeps';
378
+
379
 
380
  //Creates a new GCE_Parser object for $feed_id
381
  $feed_data = new GCE_Parser(
385
  $options[$feed_id]['cache_duration'],
386
  $df,
387
  $tf,
388
+ $options[$feed_id]['timezone'],
389
  null,
390
  $display_options
391
  );
419
  if($options[$feed_id]['display_location'] == 'on') $display_options['location'] = $options[$feed_id]['display_location_text'];
420
  if($options[$feed_id]['display_desc'] == 'on') $display_options['desc'] = $options[$feed_id]['display_desc_text'];
421
  if($options[$feed_id]['display_link'] == 'on') $display_options['link'] = $options[$feed_id]['display_link_text'];
422
+ if($options[$feed_id]['display_link_target'] == 'on') $display_options['link_target'] = 'yeps';
423
 
424
  //Creates a new GCE_Parser object for $feed_id
425
  $feed_data = new GCE_Parser(
429
  $options[$feed_id]['cache_duration'],
430
  $df,
431
  $tf,
432
+ $options[$feed_id]['timezone'],
433
  get_option('start_of_week'),
434
  $display_options
435
  );
inc/gce-parser.php CHANGED
@@ -8,15 +8,14 @@ class GCE_Parser{
8
  var $t_format;
9
  var $week_start_day;
10
  var $display_options;
11
- //var $tz_offset;
12
 
13
  //PHP 4 constructor
14
- function GCE_Parser($feed_url = null, $past_events = false, $max_events = 25, $cache_duration = 43200, $date_format = 'F j, Y', $time_format = 'g:i a',/*$offset = 0,*/ $week_start = 0, $display_opts = array()){
15
- $this->__construct($feed_url, $past_events, $max_events, $cache_duration, $date_format,/*$offset*/ $week_start, $display_opts);
16
  }
17
 
18
  //PHP 5 constructor
19
- function __construct($feed_url = null, $past_events = false, $max_events = 25, $cache_duration = 43200, $date_format = 'F j, Y', $time_format = 'g:i a',/*$offset = 0,*/ $week_start = 0, $display_opts = array()){
20
  $new_feed = new SimplePie_GCalendar(null, null, $cache_duration);
21
  $new_feed->set_cache_class('WP_Feed_Cache');
22
  $new_feed->set_file_class('WP_SimplePie_File');
@@ -26,6 +25,8 @@ class GCE_Parser{
26
  //Set start date to 1st of this month if $past_events is true (otherwise leave as todays date)
27
  if($past_events == 'true') $new_feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')));
28
 
 
 
29
  $new_feed->set_max_events($max_events);
30
  $new_feed->enable_order_by_date(false);
31
 
@@ -38,7 +39,6 @@ class GCE_Parser{
38
  $this->t_format = $time_format;
39
  $this->week_start_day = $week_start;
40
  $this->display_options = $display_opts;
41
- //$this->tz_offset = $offset;
42
  }
43
 
44
  //Check for SimplePie errors. Return false if an error occurred, otherwise return true
@@ -83,19 +83,20 @@ class GCE_Parser{
83
  $event_start_time = date_i18n($this->t_format, $event->get_start_date());
84
  $event_end_time = date_i18n($this->t_format . ' ' . $this->d_format, $event->get_end_date());
85
  $event_location = $event->get_location();
86
- $event_desc = make_clickable($event->get_description());
87
- $event_link = $event->get_link();
 
88
 
89
  $markup .= '<li>';
90
 
91
  //Check whether to add each piece of info. If yes, add info (location and desc are also checked if empty, as they may not have been entered when event was created)
92
- if(isset($this->display_options['title'])) $markup .= '<p class="gce-list-title">' . $this->display_options['title'] . ' ' . date($this->d_format, $key) . '</p>';
93
  $markup .= '<p class="gce-list-event">' . $event->get_title() . '</p>';
94
  if(isset($this->display_options['start'])) $markup .= '<p class="gce-list-start"><span>' . $this->display_options['start'] . '</span> ' . $event_start_time . '</p>';
95
  if(isset($this->display_options['end'])) $markup .= '<p class="gce-list-end"><span>' . $this->display_options['end'] . '</span> ' . $event_end_time . '</p>';
96
- if(isset($this->display_options['location']) && $location != '') $markup .= '<p class="gce-list-loc"><span>' . $this->display_options['location'] . '</span> ' . $event_location . '</p>';
97
  if(isset($this->display_options['desc']) && $event_desc != '') $markup .= '<p class="gce-list-desc"><span>' . $this->display_options['desc'] . '</span> ' . $event_desc . '</p>';
98
- if(isset($this->display_options['link'])) $markup .= '<p class="gce-list-link"><a href="' . $event_link . '">' . $this->display_options['link'] . '</a></p>';
99
 
100
  $markup .= '</li>';
101
  }
@@ -134,7 +135,7 @@ class GCE_Parser{
134
  $events_markup = '<div class="gce-event-info">';
135
 
136
  //If title option has been set for display, add it
137
- if(isset($this->display_options['title'])) $events_markup .= '<p class="gce-tooltip-title">' . $this->display_options['title'] . ' ' . date($this->d_format, $key) . '</p>';
138
 
139
  $events_markup .= '<ul>';
140
 
@@ -143,8 +144,9 @@ class GCE_Parser{
143
  $event_start_time = date_i18n($this->t_format, $event->get_start_date());
144
  $event_end_time = date_i18n($this->t_format . ' ' . $this->d_format, $event->get_end_date());
145
  $event_location = $event->get_location();
146
- $event_desc = make_clickable($event->get_description());
147
- $event_link = $event->get_link();
 
148
 
149
  //Add event title
150
  $events_markup .= '<li><p class="gce-tooltip-event">' . $event->get_title() . '</p>';
@@ -154,7 +156,7 @@ class GCE_Parser{
154
  if(isset($this->display_options['end'])) $events_markup .= '<p class="gce-tooltip-end"><span>' . $this->display_options['end'] . '</span> ' . $event_end_time . '</p>';
155
  if(isset($this->display_options['location']) && $event_location != '') $events_markup .= '<p class="gce-tooltip-loc"><span>' . $this->display_options['location'] . '</span> ' . $event_location . '</p>';
156
  if(isset($this->display_options['desc']) && $event_desc != '') $events_markup .= '<p class="gce-tooltip-desc"><span>' . $this->display_options['desc'] . '</span> ' . $event_desc . '</p>';
157
- if(isset($this->display_options['link'])) $events_markup .= '<p class="gce-tooltip-link"><a href="' . $event_link . '">' . $this->display_options['link'] . '</a></p>';
158
 
159
  $events_markup .= '</li>';
160
  }
8
  var $t_format;
9
  var $week_start_day;
10
  var $display_options;
 
11
 
12
  //PHP 4 constructor
13
+ function GCE_Parser($feed_url = null, $past_events = false, $max_events = 25, $cache_duration = 43200, $date_format = 'F j, Y', $time_format = 'g:i a', $timezone = 'default', $week_start = 0, $display_opts = array()){
14
+ $this->__construct($feed_url, $past_events, $max_events, $cache_duration, $date_format, $timezone, $week_start, $display_opts);
15
  }
16
 
17
  //PHP 5 constructor
18
+ function __construct($feed_url = null, $past_events = false, $max_events = 25, $cache_duration = 43200, $date_format = 'F j, Y', $time_format = 'g:i a', $timezone = 'default', $week_start = 0, $display_opts = array()){
19
  $new_feed = new SimplePie_GCalendar(null, null, $cache_duration);
20
  $new_feed->set_cache_class('WP_Feed_Cache');
21
  $new_feed->set_file_class('WP_SimplePie_File');
25
  //Set start date to 1st of this month if $past_events is true (otherwise leave as todays date)
26
  if($past_events == 'true') $new_feed->set_start_date(mktime(0, 0, 0, date('m'), 1, date('Y')));
27
 
28
+ if($timezone != 'default') $new_feed->set_timezone($timezone);
29
+
30
  $new_feed->set_max_events($max_events);
31
  $new_feed->enable_order_by_date(false);
32
 
39
  $this->t_format = $time_format;
40
  $this->week_start_day = $week_start;
41
  $this->display_options = $display_opts;
 
42
  }
43
 
44
  //Check for SimplePie errors. Return false if an error occurred, otherwise return true
83
  $event_start_time = date_i18n($this->t_format, $event->get_start_date());
84
  $event_end_time = date_i18n($this->t_format . ' ' . $this->d_format, $event->get_end_date());
85
  $event_location = $event->get_location();
86
+ $event_desc = nl2br(make_clickable($event->get_description()));
87
+ $event_link = $event->get_link() . '&ctz=' . $this->feed->get_timezone();
88
+ $event_link_target = (isset($this->display_options['link_target']) ? ' target="_blank"' : '');
89
 
90
  $markup .= '<li>';
91
 
92
  //Check whether to add each piece of info. If yes, add info (location and desc are also checked if empty, as they may not have been entered when event was created)
93
+ if(isset($this->display_options['title'])) $markup .= '<p class="gce-list-title">' . $this->display_options['title'] . ' ' . date_i18n($this->d_format, $key) . '</p>';
94
  $markup .= '<p class="gce-list-event">' . $event->get_title() . '</p>';
95
  if(isset($this->display_options['start'])) $markup .= '<p class="gce-list-start"><span>' . $this->display_options['start'] . '</span> ' . $event_start_time . '</p>';
96
  if(isset($this->display_options['end'])) $markup .= '<p class="gce-list-end"><span>' . $this->display_options['end'] . '</span> ' . $event_end_time . '</p>';
97
+ if(isset($this->display_options['location']) && $event_location != '') $markup .= '<p class="gce-list-loc"><span>' . $this->display_options['location'] . '</span> ' . $event_location . '</p>';
98
  if(isset($this->display_options['desc']) && $event_desc != '') $markup .= '<p class="gce-list-desc"><span>' . $this->display_options['desc'] . '</span> ' . $event_desc . '</p>';
99
+ if(isset($this->display_options['link'])) $markup .= '<p class="gce-list-link"><a href="' . $event_link . '"' . $event_link_target . '>' . $this->display_options['link'] . '</a></p>';
100
 
101
  $markup .= '</li>';
102
  }
135
  $events_markup = '<div class="gce-event-info">';
136
 
137
  //If title option has been set for display, add it
138
+ if(isset($this->display_options['title'])) $events_markup .= '<p class="gce-tooltip-title">' . $this->display_options['title'] . ' ' . date_i18n($this->d_format, $key) . '</p>';
139
 
140
  $events_markup .= '<ul>';
141
 
144
  $event_start_time = date_i18n($this->t_format, $event->get_start_date());
145
  $event_end_time = date_i18n($this->t_format . ' ' . $this->d_format, $event->get_end_date());
146
  $event_location = $event->get_location();
147
+ $event_desc = nl2br(make_clickable($event->get_description()));
148
+ $event_link = $event->get_link() . '&ctz=' . $this->feed->get_timezone();
149
+ $event_link_target = (isset($this->display_options['link_target']) ? ' target="_blank"' : '');
150
 
151
  //Add event title
152
  $events_markup .= '<li><p class="gce-tooltip-event">' . $event->get_title() . '</p>';
156
  if(isset($this->display_options['end'])) $events_markup .= '<p class="gce-tooltip-end"><span>' . $this->display_options['end'] . '</span> ' . $event_end_time . '</p>';
157
  if(isset($this->display_options['location']) && $event_location != '') $events_markup .= '<p class="gce-tooltip-loc"><span>' . $this->display_options['location'] . '</span> ' . $event_location . '</p>';
158
  if(isset($this->display_options['desc']) && $event_desc != '') $events_markup .= '<p class="gce-tooltip-desc"><span>' . $this->display_options['desc'] . '</span> ' . $event_desc . '</p>';
159
+ if(isset($this->display_options['link'])) $events_markup .= '<p class="gce-tooltip-link"><a href="' . $event_link . '"' . $event_link_target . '>' . $this->display_options['link'] . '</a></p>';
160
 
161
  $events_markup .= '</li>';
162
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: rosshanney
3
  Tags: google, google calendar, calendar, events, ajax, widget
4
  Requires at least: 2.9.2
5
  Tested up to: 3.0
6
- Stable tag: 0.2
7
 
8
  Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
9
 
@@ -54,6 +54,13 @@ You can now start adding feeds. Visit the [plugin homepage](http://www.rhanney.c
54
 
55
  == Changelog ==
56
 
 
 
 
 
 
 
 
57
  = 0.2 =
58
  * Added customization options for how information is displayed.
59
  * Can now display: start time, end time and date, location, description and event link.
3
  Tags: google, google calendar, calendar, events, ajax, widget
4
  Requires at least: 2.9.2
5
  Tested up to: 3.0
6
+ Stable tag: 0.2.1
7
 
8
  Parses Google Calendar feeds and displays the events as a calendar grid or list on a page, post or widget.
9
 
54
 
55
  == Changelog ==
56
 
57
+ = 0.2.1 =
58
+ * Added option to allow 'More details' links to open in new window / tab.
59
+ * Added option to choose a specific timezone for each feed
60
+ * Line breaks in an event description will now be preserved
61
+ * Fixed a bug casing the title to not be displayed on lists
62
+ * Other minor bug fixes
63
+
64
  = 0.2 =
65
  * Added customization options for how information is displayed.
66
  * Can now display: start time, end time and date, location, description and event link.
widget/gce-widget.php CHANGED
@@ -108,6 +108,7 @@ function gce_widget_content_grid($feed_id, $widget_id, $ajaxified = false, $mont
108
  if($options[$feed_id]['display_location'] == 'on') $display_options['location'] = $options[$feed_id]['display_location_text'];
109
  if($options[$feed_id]['display_desc'] == 'on') $display_options['desc'] = $options[$feed_id]['display_desc_text'];
110
  if($options[$feed_id]['display_link'] == 'on') $display_options['link'] = $options[$feed_id]['display_link_text'];
 
111
 
112
  //Creates a new GCE_Parser object for $feed_id
113
  $widget_feed_data = new GCE_Parser(
@@ -117,7 +118,7 @@ function gce_widget_content_grid($feed_id, $widget_id, $ajaxified = false, $mont
117
  $options[$feed_id]['cache_duration'],
118
  $df,
119
  $tf,
120
- //$options[$feed_id]['offset'],
121
  get_option('start_of_week'),
122
  $display_options
123
  );
@@ -156,6 +157,7 @@ function gce_widget_content_list($id){
156
  if($options[$id]['display_location'] == 'on') $display_options['location'] = $options[$id]['display_location_text'];
157
  if($options[$id]['display_desc'] == 'on') $display_options['desc'] = $options[$id]['display_desc_text'];
158
  if($options[$id]['display_link'] == 'on') $display_options['link'] = $options[$id]['display_link_text'];
 
159
 
160
  //Creates a new GCE_Parser object for $feed_id
161
  $widget_feed_data = new GCE_Parser(
@@ -165,9 +167,9 @@ function gce_widget_content_list($id){
165
  $options[$id]['cache_duration'],
166
  $df,
167
  $tf,
 
168
  null,
169
  $display_options
170
- //$options[$id]['offset']
171
  );
172
 
173
  //Check that feed parsed ok
108
  if($options[$feed_id]['display_location'] == 'on') $display_options['location'] = $options[$feed_id]['display_location_text'];
109
  if($options[$feed_id]['display_desc'] == 'on') $display_options['desc'] = $options[$feed_id]['display_desc_text'];
110
  if($options[$feed_id]['display_link'] == 'on') $display_options['link'] = $options[$feed_id]['display_link_text'];
111
+ if($options[$feed_id]['display_link_target'] == 'on') $display_options['link_target'] = 'yeps';
112
 
113
  //Creates a new GCE_Parser object for $feed_id
114
  $widget_feed_data = new GCE_Parser(
118
  $options[$feed_id]['cache_duration'],
119
  $df,
120
  $tf,
121
+ $options[$feed_id]['timezone'],
122
  get_option('start_of_week'),
123
  $display_options
124
  );
157
  if($options[$id]['display_location'] == 'on') $display_options['location'] = $options[$id]['display_location_text'];
158
  if($options[$id]['display_desc'] == 'on') $display_options['desc'] = $options[$id]['display_desc_text'];
159
  if($options[$id]['display_link'] == 'on') $display_options['link'] = $options[$id]['display_link_text'];
160
+ if($options[$id]['display_link_target'] == 'on') $display_options['link_target'] = 'yeps';
161
 
162
  //Creates a new GCE_Parser object for $feed_id
163
  $widget_feed_data = new GCE_Parser(
167
  $options[$id]['cache_duration'],
168
  $df,
169
  $tf,
170
+ $options[$id]['timezone'],
171
  null,
172
  $display_options
 
173
  );
174
 
175
  //Check that feed parsed ok