My Calendar - Version 1.0.2

Version Description

  • Fixed problems with editing and deleting events or categories in multiblog installation
  • Fixed escaping/character set issue
  • Fixed issue when blog address and wp address did not match (introduced in 1.0.1)
  • Added import method to transfer events and categories from Kieran O'Shea's Calendar plugin
Download this release

Release Info

Developer joedolson
Plugin Icon 128x128 My Calendar
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.0 to 1.0.2

date-utilities.php CHANGED
@@ -1,12 +1,12 @@
1
<?php
2
3
4
- function add_date($givendate,$day=0,$mth=0,$yr=0) {
5
$cd = strtotime($givendate);
6
$newdate = date('Y-m-d', mktime(date('h',$cd),date('i',$cd), date('s',$cd), date('m',$cd)+$mth,date('d',$cd)+$day, date('Y',$cd)+$yr));
7
return $newdate;
8
}
9
- function date_comp($early,$late) {
10
$firstdate = strtotime($early);
11
$lastdate = strtotime($late);
12
if ($firstdate <= $lastdate) {
@@ -16,7 +16,7 @@ function date_comp($early,$late) {
16
}
17
}
18
19
- function date_equal($early,$late) {
20
$firstdate = strtotime($early);
21
$lastdate = strtotime($late);
22
if ($early == $late) {
@@ -27,7 +27,7 @@ function date_equal($early,$late) {
27
}
28
29
// Function to compare time in event objects
30
- function time_cmp($a, $b) {
31
if ($a->event_time == $b->event_time) {
32
return 0;
33
}
@@ -35,7 +35,7 @@ function time_cmp($a, $b) {
35
}
36
37
// Function to compare datetime in event objects
38
- function datetime_cmp($a, $b) {
39
$event_dt_a = strtotime($a->event_begin .' '. $a->event_time);
40
$event_dt_b = strtotime($b->event_begin .' '. $b->event_time);
41
if ($event_dt_a == $event_dt_b ) {
@@ -44,7 +44,7 @@ function datetime_cmp($a, $b) {
44
return ( $event_dt_a < $event_dt_b ) ? -1 : 1;
45
}
46
47
- function timediff_cmp($a, $b) {
48
$event_dt_a = strtotime($a->event_begin .' '. $a->event_time);
49
$event_dt_b = strtotime($b->event_begin .' '. $b->event_time);
50
$diff_a = jd_date_diff_precise($event_dt_a);
1
<?php
2
3
4
+ function my_calendar_add_date($givendate,$day=0,$mth=0,$yr=0) {
5
$cd = strtotime($givendate);
6
$newdate = date('Y-m-d', mktime(date('h',$cd),date('i',$cd), date('s',$cd), date('m',$cd)+$mth,date('d',$cd)+$day, date('Y',$cd)+$yr));
7
return $newdate;
8
}
9
+ function my_calendar_date_comp($early,$late) {
10
$firstdate = strtotime($early);
11
$lastdate = strtotime($late);
12
if ($firstdate <= $lastdate) {
16
}
17
}
18
19
+ function my_calendar_date_equal($early,$late) {
20
$firstdate = strtotime($early);
21
$lastdate = strtotime($late);
22
if ($early == $late) {
27
}
28
29
// Function to compare time in event objects
30
+ function my_calendar_time_cmp($a, $b) {
31
if ($a->event_time == $b->event_time) {
32
return 0;
33
}
35
}
36
37
// Function to compare datetime in event objects
38
+ function my_calendar_datetime_cmp($a, $b) {
39
$event_dt_a = strtotime($a->event_begin .' '. $a->event_time);
40
$event_dt_b = strtotime($b->event_begin .' '. $b->event_time);
41
if ($event_dt_a == $event_dt_b ) {
44
return ( $event_dt_a < $event_dt_b ) ? -1 : 1;
45
}
46
47
+ function my_calendar_timediff_cmp($a, $b) {
48
$event_dt_a = strtotime($a->event_begin .' '. $a->event_time);
49
$event_dt_b = strtotime($b->event_begin .' '. $b->event_time);
50
$diff_a = jd_date_diff_precise($event_dt_a);
my-calendar-categories.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
// Function to handle the management of categories
3
4
- function dirList() {
5
$directory = dirname(__FILE__).'/icons/';
6
// create an array to hold directory list
7
$results = array();
@@ -22,37 +22,37 @@ $directory = dirname(__FILE__).'/icons/';
22
}
23
24
25
- function manage_categories() {
26
global $wpdb;
27
28
// My Calendar must be installed and upgraded before this will work
29
- check_calendar();
30
31
?>
32
<div class="wrap">
33
<?php
34
// We do some checking to see what we're doing
35
if (isset($_POST['mode']) && $_POST['mode'] == 'add') {
36
- $sql = "INSERT INTO " . MY_CALENDAR_CATEGORIES_TABLE . " SET category_name='".mysql_escape_string($_POST['category_name'])."', category_color='".mysql_escape_string($_POST['category_color'])."', category_icon='".mysql_escape_string($_POST['category_icon'])."'";
37
$wpdb->get_results($sql);
38
echo "<div class=\"updated\"><p><strong>".__('Category added successfully','my-calendar')."</strong></p></div>";
39
} else if (isset($_GET['mode']) && isset($_GET['category_id']) && $_GET['mode'] == 'delete') {
40
- $sql = "DELETE FROM " . MY_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".mysql_escape_string($_GET['category_id']);
41
$wpdb->get_results($sql);
42
- $sql = "UPDATE " . MY_CALENDAR_TABLE . " SET event_category=1 WHERE event_category=".mysql_escape_string($_GET['category_id']);
43
$wpdb->get_results($sql);
44
echo "<div class=\"updated\"><p><strong>".__('Category deleted successfully','my-calendar')."</strong></p></div>";
45
} else if (isset($_GET['mode']) && isset($_GET['category_id']) && $_GET['mode'] == 'edit' && !isset($_POST['mode'])) {
46
- $sql = "SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".mysql_escape_string($_GET['category_id']);
47
$cur_cat = $wpdb->get_row($sql);
48
?>
49
<h2><?php _e('Edit Category','my-calendar'); ?></h2>
50
- <?php show_support_box(); ?>
51
<div id="poststuff" class="jd-my-calendar">
52
<div class="postbox">
53
<h3><?php _e('Category Editor','my-calendar'); ?></h3>
54
<div class="inside">
55
- <form name="my-calendar" id="my-calendar" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=my-calendar-categories">
56
<div>
57
<input type="hidden" name="mode" value="edit" />
58
<input type="hidden" name="category_id" value="<?php echo $cur_cat->category_id ?>" />
@@ -63,7 +63,7 @@ function manage_categories() {
63
<label for="category_color"><?php _e('Category Color (Hex format)','my-calendar'); ?>:</label> <input type="text" id="category_color" name="category_color" class="input" size="10" maxlength="7" value="<?php echo $cur_cat->category_color ?>" /><br />
64
<label for="category_icon"><?php _e('Category Icon','my-calendar'); ?>:</label> <select name="category_icon" id="category_icon">
65
<?php
66
- $files = dirList();
67
foreach ($files as $value) {
68
if ($cur_cat->category_icon == $value) {
69
$selected = " selected='selected'";
@@ -84,7 +84,7 @@ if ($cur_cat->category_icon == $value) {
84
</div>
85
<?php
86
} else if (isset($_POST['mode']) && isset($_POST['category_id']) && isset($_POST['category_name']) && isset($_POST['category_color']) && $_POST['mode'] == 'edit') {
87
- $sql = "UPDATE " . MY_CALENDAR_CATEGORIES_TABLE . " SET category_name='".mysql_escape_string($_POST['category_name'])."', category_color='".mysql_escape_string($_POST['category_color'])."', category_icon='".mysql_escape_string($_POST['category_icon'])."' WHERE category_id=".mysql_escape_string($_POST['category_id']);
88
$wpdb->get_results($sql);
89
echo "<div class=\"updated\"><p><strong>".__('Category edited successfully','my-calendar')."</strong></p></div>";
90
}
@@ -93,12 +93,12 @@ if ($cur_cat->category_icon == $value) {
93
?>
94
95
<h2><?php _e('Add Category','my-calendar'); ?></h2>
96
- <?php show_support_box(); ?>
97
<div id="poststuff" class="jd-my-calendar">
98
<div class="postbox">
99
<h3><?php _e('Add New Category','my-calendar'); ?></h3>
100
<div class="inside">
101
- <form name="my-calendar" id="my-calendar" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=my-calendar-categories">
102
<div>
103
<input type="hidden" name="mode" value="add" />
104
<input type="hidden" name="category_id" value="" />
@@ -109,7 +109,7 @@ if ($cur_cat->category_icon == $value) {
109
<label for="category_color"><?php _e('Category Color (Hex format)','my-calendar'); ?>:</label> <input type="text" id="category_color" name="category_color" class="input" size="10" maxlength="7" value="#" /><br />
110
<label for="category_icon"><?php _e('Category Icon','my-calendar'); ?>:</label> <select name="category_icon" id="category_icon">
111
<?php
112
- $files = dirList();
113
foreach ($files as $value) {
114
echo "<option value='$value' style='background: url(".WP_PLUGIN_URL."/my-calendar/icons/$value) no-repeat;'>$value</option>";
115
}
@@ -153,13 +153,13 @@ foreach ($files as $value) {
153
<td><?php echo $category->category_name; ?></td>
154
<td style="background-color:<?php echo $category->category_color; ?>;">&nbsp;</td>
155
<td style="background-color:<?php echo $category->category_color; ?>;"><img src="<?php echo WP_PLUGIN_URL; ?>/my-calendar/icons/<?php echo $category->category_icon; ?>" alt="" /></td>
156
- <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?page=my-calendar-categories&amp;mode=edit&amp;category_id=<?php echo $category->category_id;?>" class='edit'><?php echo __('Edit','my-calendar'); ?></a></td>
157
<?php
158
if ($category->category_id == 1) {
159
echo '<td>'.__('N/A','my-calendar').'</td>';
160
} else {
161
?>
162
- <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?page=my-calendar-categories&amp;mode=delete&amp;category_id=<?php echo $category->category_id;?>" class="delete" onclick="return confirm('<?php echo __('Are you sure you want to delete this category?','my-calendar'); ?>')"><?php echo __('Delete','my-calendar'); ?></a></td>
163
<?php
164
}
165
?>
1
<?php
2
// Function to handle the management of categories
3
4
+ function my_dirlist() {
5
$directory = dirname(__FILE__).'/icons/';
6
// create an array to hold directory list
7
$results = array();
22
}
23
24
25
+ function my_calendar_manage_categories() {
26
global $wpdb;
27
28
// My Calendar must be installed and upgraded before this will work
29
+ check_my_calendar();
30
31
?>
32
<div class="wrap">
33
<?php
34
// We do some checking to see what we're doing
35
if (isset($_POST['mode']) && $_POST['mode'] == 'add') {
36
+ $sql = "INSERT INTO " . MY_CALENDAR_CATEGORIES_TABLE . " SET category_name='".mysql_real_escape_string($_POST['category_name'])."', category_color='".mysql_real_escape_string($_POST['category_color'])."', category_icon='".mysql_real_escape_string($_POST['category_icon'])."'";
37
$wpdb->get_results($sql);
38
echo "<div class=\"updated\"><p><strong>".__('Category added successfully','my-calendar')."</strong></p></div>";
39
} else if (isset($_GET['mode']) && isset($_GET['category_id']) && $_GET['mode'] == 'delete') {
40
+ $sql = "DELETE FROM " . MY_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".mysql_real_escape_string($_GET['category_id']);
41
$wpdb->get_results($sql);
42
+ $sql = "UPDATE " . MY_CALENDAR_TABLE . " SET event_category=1 WHERE event_category=".mysql_real_escape_string($_GET['category_id']);
43
$wpdb->get_results($sql);
44
echo "<div class=\"updated\"><p><strong>".__('Category deleted successfully','my-calendar')."</strong></p></div>";
45
} else if (isset($_GET['mode']) && isset($_GET['category_id']) && $_GET['mode'] == 'edit' && !isset($_POST['mode'])) {
46
+ $sql = "SELECT * FROM " . MY_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".mysql_real_escape_string($_GET['category_id']);
47
$cur_cat = $wpdb->get_row($sql);
48
?>
49
<h2><?php _e('Edit Category','my-calendar'); ?></h2>
50
+ <?php jd_show_support_box(); ?>
51
<div id="poststuff" class="jd-my-calendar">
52
<div class="postbox">
53
<h3><?php _e('Category Editor','my-calendar'); ?></h3>
54
<div class="inside">
55
+ <form name="my-calendar" id="my-calendar" method="post" action="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar-categories">
56
<div>
57
<input type="hidden" name="mode" value="edit" />
58
<input type="hidden" name="category_id" value="<?php echo $cur_cat->category_id ?>" />
63
<label for="category_color"><?php _e('Category Color (Hex format)','my-calendar'); ?>:</label> <input type="text" id="category_color" name="category_color" class="input" size="10" maxlength="7" value="<?php echo $cur_cat->category_color ?>" /><br />
64
<label for="category_icon"><?php _e('Category Icon','my-calendar'); ?>:</label> <select name="category_icon" id="category_icon">
65
<?php
66
+ $files = my_dirlist();
67
foreach ($files as $value) {
68
if ($cur_cat->category_icon == $value) {
69
$selected = " selected='selected'";
84
</div>
85
<?php
86
} else if (isset($_POST['mode']) && isset($_POST['category_id']) && isset($_POST['category_name']) && isset($_POST['category_color']) && $_POST['mode'] == 'edit') {
87
+ $sql = "UPDATE " . MY_CALENDAR_CATEGORIES_TABLE . " SET category_name='".mysql_real_escape_string($_POST['category_name'])."', category_color='".mysql_real_escape_string($_POST['category_color'])."', category_icon='".mysql_real_escape_string($_POST['category_icon'])."' WHERE category_id=".mysql_real_escape_string($_POST['category_id']);
88
$wpdb->get_results($sql);
89
echo "<div class=\"updated\"><p><strong>".__('Category edited successfully','my-calendar')."</strong></p></div>";
90
}
93
?>
94
95
<h2><?php _e('Add Category','my-calendar'); ?></h2>
96
+ <?php jd_show_support_box(); ?>
97
<div id="poststuff" class="jd-my-calendar">
98
<div class="postbox">
99
<h3><?php _e('Add New Category','my-calendar'); ?></h3>
100
<div class="inside">
101
+ <form name="my-calendar" id="my-calendar" method="post" action="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar-categories">
102
<div>
103
<input type="hidden" name="mode" value="add" />
104
<input type="hidden" name="category_id" value="" />
109
<label for="category_color"><?php _e('Category Color (Hex format)','my-calendar'); ?>:</label> <input type="text" id="category_color" name="category_color" class="input" size="10" maxlength="7" value="#" /><br />
110
<label for="category_icon"><?php _e('Category Icon','my-calendar'); ?>:</label> <select name="category_icon" id="category_icon">
111
<?php
112
+ $files = my_dirlist();
113
foreach ($files as $value) {
114
echo "<option value='$value' style='background: url(".WP_PLUGIN_URL."/my-calendar/icons/$value) no-repeat;'>$value</option>";
115
}
153
<td><?php echo $category->category_name; ?></td>
154
<td style="background-color:<?php echo $category->category_color; ?>;">&nbsp;</td>
155
<td style="background-color:<?php echo $category->category_color; ?>;"><img src="<?php echo WP_PLUGIN_URL; ?>/my-calendar/icons/<?php echo $category->category_icon; ?>" alt="" /></td>
156
+ <td><a href="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar-categories&amp;mode=edit&amp;category_id=<?php echo $category->category_id;?>" class='edit'><?php echo __('Edit','my-calendar'); ?></a></td>
157
<?php
158
if ($category->category_id == 1) {
159
echo '<td>'.__('N/A','my-calendar').'</td>';
160
} else {
161
?>
162
+ <td><a href="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar-categories&amp;mode=delete&amp;category_id=<?php echo $category->category_id;?>" class="delete" onclick="return confirm('<?php echo __('Are you sure you want to delete this category?','my-calendar'); ?>')"><?php echo __('Delete','my-calendar'); ?></a></td>
163
<?php
164
}
165
?>
my-calendar-es_ES.mo ADDED
Binary file
my-calendar-es_ES.po ADDED
@@ -0,0 +1,864 @@
1
+ # Translation of the WordPress plugin My Calendar 1.0.0 by Joseph C Dolson.
2
+ # Copyright (C) 2010 Joseph C Dolson
3
+ # This file is distributed under the same license as the My Calendar package.
4
+ # FIRST AUTHOR <EMAIL@ADDRESS>, 2010.
5
+ #
6
+ msgid ""
7
+ msgstr ""
8
+ "Project-Id-Version: My Calendar 1.0.0\n"
9
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/my-calendar\n"
10
+ "POT-Creation-Date: 2010-04-05 23:03+0000\n"
11
+ "PO-Revision-Date: 2010-04-07 11:46-0300\n"
12
+ "Last-Translator: Esteban <esteban@netmdp.com>\n"
13
+ "Language-Team: www.netmdp.com <esteban@netmdp.com>\n"
14
+ "MIME-Version: 1.0\n"
15
+ "Content-Type: text/plain; charset=utf-8\n"
16
+ "Content-Transfer-Encoding: 8bit\n"
17
+ "X-Poedit-Language: Spanish\n"
18
+ "X-Poedit-Country: ARGENTINA\n"
19
+
20
+ #: my-calendar-categories.php:38
21
+ msgid "Category added successfully"
22
+ msgstr "Categoría agregada exitosamente"
23
+
24
+ #: my-calendar-categories.php:44
25
+ msgid "Category deleted successfully"
26
+ msgstr "Categoría eliminada exitosamente"
27
+
28
+ #: my-calendar-categories.php:49
29
+ #: my-calendar-categories.php:61
30
+ msgid "Edit Category"
31
+ msgstr "Editar Categoría"
32
+
33
+ #: my-calendar-categories.php:53
34
+ msgid "Category Editor"
35
+ msgstr "Editor de categoría"
36
+
37
+ #: my-calendar-categories.php:62
38
+ #: my-calendar-categories.php:108
39
+ #: my-calendar-categories.php:139
40
+ msgid "Category Name"
41
+ msgstr "Nombre de categoría"
42
+
43
+ #: my-calendar-categories.php:63
44
+ #: my-calendar-categories.php:109
45
+ msgid "Category Color (Hex format)"
46
+ msgstr "Color de Categoría (Formato Hex)"
47
+
48
+ #: my-calendar-categories.php:64
49
+ #: my-calendar-categories.php:110
50
+ #: my-calendar-categories.php:141
51
+ msgid "Category Icon"
52
+ msgstr "Icono de Categoría"
53
+
54
+ #: my-calendar-categories.php:79
55
+ msgid "Save Changes"
56
+ msgstr "Guardar cambios"
57
+
58
+ #: my-calendar-categories.php:89
59
+ msgid "Category edited successfully"
60
+ msgstr "Categoría editada exitosamente"
61
+
62
+ #: my-calendar-categories.php:95
63
+ #: my-calendar-categories.php:107
64
+ #: my-calendar-categories.php:120
65
+ msgid "Add Category"
66
+ msgstr "Agregar Categoría"
67
+
68
+ #: my-calendar-categories.php:99
69
+ msgid "Add New Category"
70
+ msgstr "Agregar Nueva Categoría"
71
+
72
+ #: my-calendar-categories.php:126
73
+ #: my-calendar.php:127
74
+ msgid "Manage Categories"
75
+ msgstr "Administrar Categorías"
76
+
77
+ #: my-calendar-categories.php:138
78
+ #: my-calendar-event-manager.php:592
79
+ msgid "ID"
80
+ msgstr "ID"
81
+
82
+ #: my-calendar-categories.php:140
83
+ msgid "Category Color"
84
+ msgstr "Color de Categoría"
85
+
86
+ #: my-calendar-categories.php:142
87
+ #: my-calendar-categories.php:156
88
+ #: my-calendar-event-manager.php:640
89
+ msgid "Edit"
90
+ msgstr "Editar"
91
+
92
+ #: my-calendar-categories.php:143
93
+ #: my-calendar-categories.php:162
94
+ #: my-calendar-event-manager.php:33
95
+ #: my-calendar-event-manager.php:640
96
+ msgid "Delete"
97
+ msgstr "Borrar"
98
+
99
+ #: my-calendar-categories.php:159
100
+ #: my-calendar-event-manager.php:628
101
+ #: my-calendar.php:796
102
+ msgid "N/A"
103
+ msgstr "N/D"
104
+
105
+ #: my-calendar-categories.php:162
106
+ msgid "Are you sure you want to delete this category?"
107
+ msgstr "¿Está seguro de que desea borrar esta categoría?"
108
+
109
+ #: my-calendar-categories.php:173
110
+ msgid "There are no categories in the database - something has gone wrong!"
111
+ msgstr "No hay categorías en la base de datos - ¡Algo va mal!"
112
+
113
+ #: my-calendar-event-manager.php:28
114
+ msgid "Delete Event"
115
+ msgstr "Borrar evento"
116
+
117
+ #: my-calendar-event-manager.php:28
118
+ msgid "Are you sure you want to delete this event?"
119
+ msgstr "¿Está seguro de que desea borrar este evento?"
120
+
121
+ #: my-calendar-event-manager.php:99
122
+ #: my-calendar-event-manager.php:104
123
+ #: my-calendar-event-manager.php:109
124
+ #: my-calendar-event-manager.php:119
125
+ #: my-calendar-event-manager.php:127
126
+ #: my-calendar-event-manager.php:135
127
+ #: my-calendar-event-manager.php:143
128
+ #: my-calendar-event-manager.php:174
129
+ #: my-calendar-event-manager.php:265
130
+ #: my-calendar-event-manager.php:270
131
+ #: my-calendar-event-manager.php:275
132
+ #: my-calendar-event-manager.php:285
133
+ #: my-calendar-event-manager.php:293
134
+ #: my-calendar-event-manager.php:301
135
+ #: my-calendar-event-manager.php:309
136
+ #: my-calendar-event-manager.php:374
137
+ #: my-calendar-event-manager.php:389
138
+ msgid "Error"
139
+ msgstr "Error"
140
+
141
+ #: my-calendar-event-manager.php:99
142
+ #: my-calendar-event-manager.php:265
143
+ msgid "Your event end date must be either after or the same as your event begin date"
144
+ msgstr "La fecha de fin del evento debe ser igual o posterior a la fecha de comienzo"
145
+
146
+ #: my-calendar-event-manager.php:104
147
+ #: my-calendar-event-manager.php:270
148
+ msgid "Your date formatting is correct but one or more of your dates is invalid. Check for number of days in month and leap year related errors."
149
+ msgstr "El formato de fecha es correto pero una o mas de sus fechas son inválidas. Revise números de días puestos en lugar de los meses y errores relacionados a años bisiestos."
150
+
151
+ #: my-calendar-event-manager.php:109
152
+ #: my-calendar-event-manager.php:275
153
+ msgid "Both start and end dates must be entered and be in the format YYYY-MM-DD"
154
+ msgstr "Ambas fechas de inicio y fin deben ser ingresadas y con el formato YYYY-MM-DD"
155
+
156
+ #: my-calendar-event-manager.php:119
157
+ #: my-calendar-event-manager.php:285
158
+ msgid "The time field must either be blank or be entered in the format hh:mm"
159
+ msgstr "El campo de hora o bien debe estar en blanco o ingresado con el formato hh:mm"
160
+
161
+ #: my-calendar-event-manager.php:127
162
+ #: my-calendar-event-manager.php:293
163
+ msgid "The URL entered must either be prefixed with http:// or be completely blank"
164
+ msgstr "La URL ingresada debe comenzar con el prefijo http:// o estar completamente en blanco"
165
+
166
+ #: my-calendar-event-manager.php:135
167
+ #: my-calendar-event-manager.php:301
168
+ msgid "The event title must be between 1 and 60 characters in length. Some punctuation characters may not be allowed."
169
+ msgstr "El título del evento debe tener de 1 a 60 caracteres. Algunos signos de puntuación pueden no ser permitidos."
170
+
171
+ #: my-calendar-event-manager.php:143
172
+ #: my-calendar-event-manager.php:309
173
+ msgid "The repetition value must be 0 unless a type of recurrance is selected in which case the repetition value must be 0 or higher"
174
+ msgstr "El valor de repetición debe ser 0 a menos que seleccione un tipo de recurrencia, entonces la repetición debe ser 0 o más."
175
+
176
+ #: my-calendar-event-manager.php:174
177
+ msgid "An event with the details you submitted could not be found in the database. This may indicate a problem with your database or the way in which it is configured."
178
+ msgstr "El evento con los detalles que envió no se encuentra en la base de datos. Esto indica un problema con la base de datos o en como fue configurado."
179
+
180
+ #: my-calendar-event-manager.php:178
181
+ msgid "Event added. It will now show in your calendar."
182
+ msgstr "Evento agregado. Ya se mostrará en su calendario."
183
+
184
+ #: my-calendar-event-manager.php:242
185
+ #: my-calendar-event-manager.php:341
186
+ msgid "Failure"
187
+ msgstr "Falla"
188
+
189
+ #: my-calendar-event-manager.php:242
190
+ msgid "You can't update an event if you haven't submitted an event id"
191
+ msgstr "No puedes actualizar un evento si no tienes un id de evento envíado"
192
+
193
+ #: my-calendar-event-manager.php:341
194
+ msgid "The database failed to return data to indicate the event has been updated sucessfully. This may indicate a problem with your database or the way in which it is configured."
195
+ msgstr "La base de datos falló al devolver los datos para indicar que el evento fue actualizado exitosamente. Esto puede indicar un problema con su base de datos o en como está configurada."
196
+
197
+ #: my-calendar-event-manager.php:345
198
+ msgid "Event updated successfully"
199
+ msgstr "Evento actualizado exitosamente"
200
+
201
+ #: my-calendar-event-manager.php:374
202
+ msgid "You can't delete an event if you haven't submitted an event id"
203
+ msgstr "No puedes borrar un evento si no tienes un id de evento envíado"
204
+
205
+ #: my-calendar-event-manager.php:385
206
+ msgid "Event deleted successfully"
207
+ msgstr "Evento borrado exitosamente"
208
+
209
+ #: my-calendar-event-manager.php:389
210
+ msgid "Despite issuing a request to delete, the event still remains in the database. Please investigate."
211
+ msgstr "A pesar de la solicitud para eliminar, el evento sigue estando en la base de datos. Por favor, investigue."
212
+
213
+ #: my-calendar-event-manager.php:404
214
+ #: my-calendar-event-manager.php:458
215
+ msgid "Edit Event"
216
+ msgstr "Editar evento"
217
+
218
+ #: my-calendar-event-manager.php:408
219
+ msgid "You must provide an event id in order to edit it"
220
+ msgstr "Debes proveer un id de evento para poder editarlo"
221
+
222
+ #: my-calendar-event-manager.php:414
223
+ msgid "Add Event"
224
+ msgstr "Nuevo evento"
225
+
226
+ #: my-calendar-event-manager.php:419
227
+ msgid "Manage Events"
228
+ msgstr "Administrar Eventos"
229
+
230
+ #: my-calendar-event-manager.php:436
231
+ msgid "Sorry! That's an invalid event key."
232
+ msgstr "Lo siento. Esa es una clave de evento erronea."
233
+
234
+ #: my-calendar-event-manager.php:441
235
+ msgid "Sorry! We couldn't find an event with that ID."
236
+ msgstr "Lo siento. No podemos encontrar un evento con ese ID."
237
+
238
+ #: my-calendar-event-manager.php:458
239
+ msgid "Add an Event"
240
+ msgstr "Agregar un Evento"
241
+
242
+ #: my-calendar-event-manager.php:466
243
+ msgid "Enter your Event Information"
244
+ msgstr "Ingrese la información de su evento"
245
+
246
+ #: my-calendar-event-manager.php:468
247
+ msgid "Event Title"
248
+ msgstr "Título del Evento"
249
+
250
+ #: my-calendar-event-manager.php:471
251
+ msgid "Event Description (<abbr title=\"hypertext markup language\">HTML</abbr> allowed)"
252
+ msgstr "Descripción del evento (<abbr title=\"hypertext markup language\">HTML</abbr> permitido)"
253
+
254
+ #: my-calendar-event-manager.php:474
255
+ msgid "Event Category"
256
+ msgstr "Categoría del Evento "
257
+
258
+ #: my-calendar-event-manager.php:493
259
+ msgid "Event Link (Optional)"
260
+ msgstr "Link del evento (Opcional)"
261
+
262
+ #: my-calendar-event-manager.php:496
263
+ msgid "Start Date (YYYY-MM-DD)"
264
+ msgstr "Comienza el (YYYY-MM-DD)"
265
+
266
+ #: my-calendar-event-manager.php:499
267
+ msgid "End Date (YYYY-MM-DD) (Optional)"
268
+ msgstr "Finaliza (YYYY-MM-DD) (Opcional)"
269
+
270
+ #: my-calendar-event-manager.php:502
271
+ msgid "Time (hh:mm)"
272
+ msgstr "hora (hh:mm)"
273
+
274
+ #: my-calendar-event-manager.php:513
275
+ msgid "Optional, set blank if your event is an all-day event or does not happen at a specific time."
276
+ msgstr "Opcional, deje en blanco si su evento es \"todo el día\" o no es a una hora específica."
277
+
278
+ #: my-calendar-event-manager.php:513
279
+ msgid "Current time difference from GMT is "
280
+ msgstr "La diferencia es GMT "
281
+
282
+ #: my-calendar-event-manager.php:513
283
+ msgid " hour(s)"
284
+ msgstr " hora(s)"
285
+
286
+ #: my-calendar-event-manager.php:517
287
+ msgid "Recurring Events"
288
+ msgstr "Eventos Recurrentes"
289
+
290
+ #: my-calendar-event-manager.php:536
291
+ msgid "Repeats for"
292
+ msgstr "Repite por"
293
+
294
+ #: my-calendar-event-manager.php:537
295
+ msgid "Units"
296
+ msgstr "Unidades"
297
+
298
+ #: my-calendar-event-manager.php:544
299
+ msgid "Entering 0 means forever, if a unit is selected. If the recurrance unit is left at \"Does not recur,\" the event will not reoccur."
300
+ msgstr "Ingresar 0 significa para siempre, si una unidad es seleccionada. Si la unidad se deja en \"No se repite,\" el evento no vuelva a aparecer."
301
+
302
+ #: my-calendar-event-manager.php:551
303
+ msgid "All location fields are optional: <em>insufficient information may result in an inaccurate map</em>."
304
+ msgstr "Todos los campos de ubicación son opcionales: <em>insuficiente información puede resultar en un mapa inexacto</em>."
305
+
306
+ #: my-calendar-event-manager.php:554
307
+ msgid "Name of Location (e.g. <em>Joe's Bar and Grill</em>)"
308
+ msgstr "Nombre de la Ubicacion (ej. <em>Parrilla Lo de Carlitos</em>)"
309
+
310
+ #: my-calendar-event-manager.php:557
311
+ msgid "Street Address"
312
+ msgstr "Dirección"
313
+
314
+ #: my-calendar-event-manager.php:560
315
+ msgid "Street Address (2)"
316
+ msgstr "Dirección(2)"
317
+
318
+ #: my-calendar-event-manager.php:563
319
+ msgid "City"
320
+ msgstr "Ciudad"
321
+
322
+ #: my-calendar-event-manager.php:563
323
+ msgid "State/Province"
324
+ msgstr "Estado/provincia"
325
+
326
+ #: my-calendar-event-manager.php:563
327
+ msgid "Postal Code"
328
+ msgstr "Código postal"
329
+
330
+ #: my-calendar-event-manager.php:566
331
+ msgid "Country"
332
+ msgstr "País"
333
+
334
+ #: my-calendar-event-manager.php:571
335
+ msgid "Save Event"
336
+ msgstr "Grabar Evento"
337
+
338
+ #: my-calendar-event-manager.php:593
339
+ #: my-calendar-widgets.php:32
340
+ #: my-calendar-widgets.php:108
341
+ msgid "Title"
342
+ msgstr "Titulo"
343
+
344
+ #: my-calendar-event-manager.php:594
345
+ msgid "Description"
346
+ msgstr "Descripción"
347
+
348
+ #: my-calendar-event-manager.php:595
349
+ msgid "Start Date"
350
+ msgstr "Fecha de inicio"
351
+
352
+ #: my-calendar-event-manager.php:597
353
+ msgid "Recurs"
354
+ msgstr "Repeticiones"
355
+
356
+ #: my-calendar-event-manager.php:598
357
+ msgid "Repeats"
358
+ msgstr "Repeticiones"
359
+
360
+ #: my-calendar-event-manager.php:599
361
+ #: my-calendar-settings.php:107
362
+ msgid "Author"
363
+ msgstr "Autor"
364
+
365
+ #: my-calendar-event-manager.php:600
366
+ msgid "Category"
367
+ msgstr "Categoría"
368
+
369
+ #: my-calendar-event-manager.php:601
370
+ msgid "Edit / Delete"
371
+ msgstr "Editar / Borrar"
372
+
373
+ #: my-calendar-event-manager.php:618
374
+ msgid "Never"
375
+ msgstr "Nunca"
376
+
377
+ #: my-calendar-event-manager.php:619
378
+ msgid "Daily"
379
+ msgstr "Diariamente"
380
+
381
+ #: my-calendar-event-manager.php:620
382
+ msgid "Weekly"
383
+ msgstr "Semanalmente"
384
+
385
+ #: my-calendar-event-manager.php:621
386
+ msgid "Monthly"
387
+ msgstr "Mensualmente"
388
+
389
+ #: my-calendar-event-manager.php:622
390
+ msgid "Yearly"
391
+ msgstr "Anualmente"
392
+
393
+ #: my-calendar-event-manager.php:629
394
+ msgid "Forever"
395
+ msgstr "Para siempre"
396
+
397
+ #: my-calendar-event-manager.php:630
398
+ msgid "Times"
399
+ msgstr "Veces"
400
+
401
+ #: my-calendar-event-manager.php:648
402
+ msgid "There are no events in the database!"
403
+ msgstr "¡No hay eventos en la base de datos!"
404
+
405
+ #: my-calendar-help.php:6
406
+ msgid "How to use My Calendar"
407
+ msgstr "Cómo usar My Calendar"
408
+
409
+ #: my-calendar-help.php:11
410
+ msgid "Shortcode Syntax"
411
+ msgstr "Sintáxis Shortcode"
412
+
413
+ #: my-calendar-help.php:16
414
+ msgid "This basic shortcode will show the calendar on a post or page including all categories and the category key, in a traditional month-by-month format."
415
+ msgstr "Este shortcode básico mostrará el calendario en una entrada o página incluyendo todas las categorías y la clave de categoría, en el formato tradicional mes-por-mes."
416
+
417
+ #: my-calendar-help.php:19
418
+ msgid "The shortcode supports three attributes, <code>category</code>, <code>format</code> and <code>showkey</code>. There is currently only one alternate option for <code>format</code> &mdash; <code>list</code> &mdash; which will show the calendar in a list format, skipping dates without any events. The <code>category</code> attribute requires either the name of or ID number one of your event categories (the name is case-sensitive). This will show a calendar only including events in that category. Setting <code>showkey</code> to <code>no</code> will prevent the category key from being displayed &mdash; this can be useful with single-category output."
419
+ msgstr "El shortcode soporta tres atributos, <code>category</code>, <code>format</code> y <code>showkey</code>. Actualmente hay sólo una opción alternativa para <code>format</code> &mdash; <code>list</code> &mdash; la cual mostrará el calendario en modo de lista, salteando fechas sin eventos. El atributo <code>category</code> requiere el nombre o un número de ID de las categorías (el nombre es sensible a mayusculas). Esto mostrará el calendario incluyendo solo eventos de esa categoría. Configurar <code>showkey</code> a <code>no</code> impedirá que se muestre la clave de categoría &mdash; esto puede ser útil con una sola categoría de salida."
420
+
421
+ #: my-calendar-help.php:27
422
+ msgid "Category Icons"
423
+ msgstr "Iconos de categoría"
424
+
425
+ #: my-calendar-help.php:30
426
+ msgid "My Calendar is designed to manage multiple calendars. The basis for these calendars are categories; you can easily setup a calendar page which includes all categories, or you can dedicate separate pages to calendars in each category. For an example, this might be useful for you in managing the tour calendars for multiple bands; event calendars for a variety of locations, etc."
427
+ msgstr "My Calendar está diseñado para administrar múltiples calendarios. La base de estos calendarios son categorías; puedes configurar fácilmente una página de calendario que incluya todas las categorías, o puedes dedicar páginas separadas a calendarios para cada categoría. Por ejemplo esto pdría ser útil para administrar calendarios de tours de varias bandas; calendarios de eventos para distintos lugares, etc."
428
+
429
+ #: my-calendar-help.php:33
430
+ msgid "The pre-installed category icons may not be especially useful for your needs or design. I'm assuming that you're going to upload your own icons -- all you need to do is upload them to the plugin's icons folder, and they'll be available for immediate use."
431
+ msgstr "Los íconos preinstalados para categorías pueden no ser útiles para sus necesidades. Asumiendo que vaya a cargar sus propios iconos -- todo lo que necesita hacer es cargarlos a la carpeta icons del plugin, y estarán disponibles inmediatamente para su uso."
432
+
433
+ #: my-calendar-help.php:33
434
+ msgid "Your icons folder is:"
435
+ msgstr "Su carpeta de íconos es:"
436
+
437
+ #: my-calendar-help.php:41
438
+ msgid "Widget Templating"
439
+ msgstr "Plantillas de Widget"
440
+
441
+ #: my-calendar-help.php:44
442
+ msgid "These codes are available in calendar widgets to create your own custom calendar format."
443
+ msgstr "Estos códigos están disponibles en los widgets de calendario para crear su propio formato."
444
+
445
+ #: my-calendar-help.php:48
446
+ msgid "Displays the name of the category the event is in."
447
+ msgstr "Muestra el nombre de la categoría del evento."
448
+
449
+ #: my-calendar-help.php:51
450
+ msgid "Displays the title of the event."
451
+ msgstr "Muestra el título del evento."
452
+
453
+ #: my-calendar-help.php:54
454
+ msgid "Displays the start time for the event."
455
+ msgstr "Muestra la hora de inicio del evento."
456
+
457
+ #: my-calendar-help.php:57
458
+ msgid "Displays the date on which the event begins."
459
+ msgstr "Muestra la fecha en que comienza el evento."
460
+
461
+ #: my-calendar-help.php:60
462
+ msgid "Displays the WordPress author who posted the event."
463
+ msgstr "Muestra el autor que publicó el evento."
464
+
465
+ #: my-calendar-help.php:63
466
+ msgid "Displays the URL provided for the event."
467
+ msgstr "Muestra la URL provista para el evento."
468
+
469
+ #: my-calendar-help.php:66
470
+ msgid "Displays the description of the event."
471
+ msgstr "Muestra la descripción del evento."
472
+
473
+ #: my-calendar-help.php:69
474
+ msgid "Displays title of the event as a link if a URL is present, or the title alone if no URL is available."
475
+ msgstr "Muestra el título del evento como un enlace si hay presente una URL, o sólo el título si no hay URL."
476
+
477
+ #: my-calendar-help.php:72
478
+ msgid "Displays the name of the location of the event."
479
+ msgstr "Muestra el nombre de la ubicación del evento."
480
+
481
+ #: my-calendar-help.php:75
482
+ msgid "Displays the first line of the site address."
483
+ msgstr "Muestra la primer línea de la dirección."
484
+
485
+ #: my-calendar-help.php:78
486
+ msgid "Displays the second line of the site address."
487
+ msgstr "Muestra la segunda línea de la dirección."
488
+
489
+ #: my-calendar-help.php:81
490
+ msgid "Displays the city for the event."
491
+ msgstr "Muestra la ciudad del evento."
492
+
493
+ #: my-calendar-help.php:84
494
+ msgid "Displays the state for the event."
495
+ msgstr "Muestra el estado/provincia del evento."
496
+
497
+ #: my-calendar-help.php:87
498
+ msgid "Displays the postcode for the event."
499
+ msgstr "Muestra el código postal del evento."
500
+
501
+ #: my-calendar-help.php:90
502
+ msgid "Displays the country for the event location."
503
+ msgstr "Muestra el país de la ubicación del evento."
504
+
505
+ #: my-calendar-help.php:93
506
+ msgid "Displays the event address in <a href=\"http://microformats.org/wiki/hcard\">hcard</a> format."
507
+ msgstr "Muestra la dirección del evento en formato <a href=\"http://microformats.org/wiki/hcard\">hcard</a>."
508
+
509
+ #: my-calendar-help.php:96
510
+ msgid "Displays a link to a Google Map of the event, if sufficient address information is available. If not, will be empty."
511
+ msgstr "Muestra un link del evento a Google Map, si hay suficiente información sobre la dirección. Si no, estará vacío."
512
+
513
+ #: my-calendar-settings.php:67
514
+ msgid "Settings saved"
515
+ msgstr "Opciones guardadas"
516
+
517
+ #: my-calendar-settings.php:94
518
+ msgid "My Calendar Options"
519
+ msgstr "Opciones My Calendar"
520
+
521
+ #: my-calendar-settings.php:98
522
+ msgid "Calendar Settings"
523
+ msgstr "Opciones de Calendario"
524
+
525
+ #: my-calendar-settings.php:102
526
+ msgid "Primary Calendar Options"
527
+ msgstr "Opciones primarias de Calendario"
528
+
529
+ #: my-calendar-settings.php:104
530
+ msgid "Choose the lowest user group that may manage events"
531
+ msgstr "Ingrese el mínimo grupo de usuarios que pueda administrar eventos."
532
+
533
+ #: my-calendar-settings.php:105
534
+ msgid "Subscriber"
535
+ msgstr "Suscriptor"
536
+
537
+ #: my-calendar-settings.php:106
538
+ msgid "Contributor"
539
+ msgstr "Colaborador"
540
+
541
+ #: my-calendar-settings.php:108
542
+ msgid "Editor"
543
+ msgstr "Editor"
544
+
545
+ #: my-calendar-settings.php:109
546
+ msgid "Administrator"
547
+ msgstr "Administrador"
548
+
549
+ #: my-calendar-settings.php:113
550
+ msgid "Do you want to display the author name on events?"
551
+ msgstr "¿Quiere mostrar el nombre del autor en los eventos?"
552
+
553
+ #: my-calendar-settings.php:114
554
+ #: my-calendar-settings.php:120
555
+ msgid "Yes"
556
+ msgstr "Si"
557
+
558
+ #: my-calendar-settings.php:115
559
+ #: my-calendar-settings.php:121
560
+ msgid "No"
561
+ msgstr "No"
562
+
563
+ #: my-calendar-settings.php:119
564
+ msgid "Display a jumpbox for changing month and year quickly?"
565
+ msgstr "¿Mostrar un combo para cambiar rápidamente de mes y año?"
566
+
567
+ #: my-calendar-settings.php:125
568
+ msgid "In list mode, show how many months of events at a time:"
569
+ msgstr "En modo lista, mostrar cuantos meses con eventos a la vez:"
570
+
571
+ #: my-calendar-settings.php:128
572
+ msgid "Date format in list mode"
573
+ msgstr "Formato de fecha en modo lista"
574
+
575
+ #: my-calendar-settings.php:129
576
+ msgid "Date format uses the same syntax as the <a href=\"http://php.net/date\">PHP <code>date()</code> function</a>. Save option to update sample output."
577
+ msgstr "Formato de fecha usa la misma sintaxis que la <a href=\"http://php.net/date\">funcion PHP <code>date()</code></a>. Grabe para ver el ejemplo."
578
+
579
+ #: my-calendar-settings.php:132
580
+ msgid "Show Link to Google Map (when sufficient address information is available.)"
581
+ msgstr "Mostrar link a Google Map (Cuando haya suficiente informacion de dirección.)"
582
+
583
+ #: my-calendar-settings.php:133
584
+ msgid "Show Event Address in Details"
585
+ msgstr "Mostrar la dirección del evento en Detalle"
586
+
587
+ #: my-calendar-settings.php:137
588
+ msgid "Calendar Styles"
589
+ msgstr "Estilos del Calendario"
590
+
591
+ #: my-calendar-settings.php:139
592
+ msgid "Reset the My Calendar style to default"
593
+ msgstr "\"Reset\" Volver el Calendario al estilo por defecto"
594
+
595
+ #: my-calendar-settings.php:140
596
+ msgid "Disable My Calendar Stylesheet"
597
+ msgstr "Desactivar el estilo para My Calendar"
598
+
599
+ #: my-calendar-settings.php:143
600
+ msgid "Edit the stylesheet for My Calendar"
601
+ msgstr "Editar el estilo para My Calendar"
602
+
603
+ #: my-calendar-settings.php:147
604
+ msgid "Calendar Behaviors"
605
+ msgstr "Comportamientos del Calendario"
606
+
607
+ #: my-calendar-settings.php:149
608
+ msgid "Disable List Javascript Effects"
609
+ msgstr "Desactivar efectos Javascript en Lista"
610
+
611
+ #: my-calendar-settings.php:150
612
+ msgid "Disable Calendar Javascript Effects"
613
+ msgstr "Desactivar efectos Javascript en Calendario"
614
+
615
+ #: my-calendar-settings.php:153
616
+ msgid "Save"
617
+ msgstr "Guardar"
618
+
619
+ #: my-calendar-widgets.php:11
620
+ #: my-calendar-widgets.php:42
621
+ #: my-calendar-widgets.php:43
622
+ msgid "Today's Events"
623
+ msgstr "Eventos de hoy"
624
+
625
+ #: my-calendar-widgets.php:36
626
+ #: my-calendar-widgets.php:112
627
+ msgid "Template"
628
+ msgstr "Plantilla"
629
+
630
+ #: my-calendar-widgets.php:56
631
+ #: my-calendar-widgets.php:135
632
+ #: my-calendar-widgets.php:136
633
+ msgid "Upcoming Events"
634
+ msgstr "Próximos eventos"
635
+
636
+ #: my-calendar-widgets.php:116
637
+ msgid "Widget Options"
638
+ msgstr "Opciones de Widget"
639
+
640
+ #: my-calendar-widgets.php:118
641
+ msgid "Display upcoming events by:"
642
+ msgstr "Mostar los próximos eventos por:"
643
+
644
+ #: my-calendar-widgets.php:119
645
+ msgid "Events (e.g. 2 past, 3 future)"
646
+ msgstr "Eventos (ej. 2 pasados, 3 futuros)"
647
+
648
+ #: my-calendar-widgets.php:120
649
+ msgid "Dates (e.g. 4 days past, 5 forward)"
650
+ msgstr "Fecha (ej. 2 días atras, 3 días siguientes)"
651
+
652
+ #: my-calendar-widgets.php:124
653
+ msgid "events into the future;"
654
+ msgstr "eventos en el futuro;"
655
+
656
+ #: my-calendar-widgets.php:125
657
+ msgid "events from the past"
658
+ msgstr "eventos del pasado"
659
+
660
+ #: my-calendar-widgets.php:128
661
+ msgid "days into the future;"
662
+ msgstr "días en el futuro;"
663
+
664
+ #: my-calendar-widgets.php:129
665
+ msgid "days from the past"
666
+ msgstr "días pasados"
667
+
668
+ #: my-calendar.php:46
669
+ #: my-calendar.php:128
670
+ msgid "Settings"
671
+ msgstr "Opciones"
672
+
673
+ #: my-calendar.php:65
674
+ msgid "Get Support"
675
+ msgstr "Obtener Soporte"
676
+
677
+ #: my-calendar.php:66
678
+ msgid "Make a Donation"
679
+ msgstr "Hacer una donación"
680
+
681
+ #. #-#-#-#-# plugin.pot (My Calendar 1.0.0) #-#-#-#-#
682
+ #. Plugin Name of the plugin/theme
683
+ #: my-calendar.php:120
684
+ msgid "My Calendar"
685
+ msgstr "My Calendar"
686
+
687
+ #: my-calendar.php:123
688
+ msgid "Add/Edit Events"
689
+ msgstr "Agregar/editar un Evento"
690
+
691
+ #: my-calendar.php:129
692
+ msgid "My Calendar Help"
693
+ msgstr "My Calendar Help"
694
+
695
+ #: my-calendar.php:129
696
+ msgid "Help"
697
+ msgstr "Ayuda"
698
+
699
+ #: my-calendar.php:662
700
+ #: my-calendar.php:666
701
+ #: my-calendar.php:676
702
+ #: my-calendar.php:678
703
+ msgid "Next Events"
704
+ msgstr "Próximos eventos"
705
+
706
+ #: my-calendar.php:691
707
+ #: my-calendar.php:695
708
+ #: my-calendar.php:705
709
+ #: my-calendar.php:707
710
+ msgid "Previous Events"
711
+ msgstr "Eventos Anteriores"
712
+
713
+ #: my-calendar.php:790
714
+ msgid "Event Details"
715
+ msgstr "Detalles del Evento"
716
+
717
+ #: my-calendar.php:796
718
+ msgid "Not Applicable"
719
+ msgstr "No aplicable"
720
+
721
+ #: my-calendar.php:804
722
+ msgid "Posted by"
723
+ msgstr "Escrito por"
724
+
725
+ #: my-calendar.php:1284
726
+ msgid "Month"
727
+ msgstr "Mes"
728
+
729
+ #: my-calendar.php:1285
730
+ #: my-calendar.php:1346
731
+ msgid "January"
732
+ msgstr "Enero"
733
+
734
+ #: my-calendar.php:1286
735
+ #: my-calendar.php:1346
736
+ msgid "February"
737
+ msgstr "Febrero"
738
+
739
+ #: my-calendar.php:1287
740
+ #: my-calendar.php:1346
741
+ msgid "March"
742
+ msgstr "Marzo"
743
+
744
+ #: my-calendar.php:1288
745
+ #: my-calendar.php:1346
746
+ msgid "April"
747
+ msgstr "Abril"
748
+
749
+ #: my-calendar.php:1289
750
+ #: my-calendar.php:1346
751
+ msgid "May"
752
+ msgstr "Mayo"
753
+
754
+ #: my-calendar.php:1290
755
+ #: my-calendar.php:1346
756
+ msgid "June"
757
+ msgstr "Junio"
758
+
759
+ #: my-calendar.php:1291
760
+ #: my-calendar.php:1346
761
+ msgid "July"
762
+ msgstr "Julio"
763
+
764
+ #: my-calendar.php:1292
765
+ #: my-calendar.php:1346
766
+ msgid "August"
767
+ msgstr "Agosto"
768
+
769
+ #: my-calendar.php:1293
770
+ #: my-calendar.php:1346
771
+ msgid "September"
772
+ msgstr "Septiembre"
773
+
774
+ #: my-calendar.php:1294
775
+ #: my-calendar.php:1346
776
+ msgid "October"
777
+ msgstr "Octubre"
778
+
779
+ #: my-calendar.php:1295
780
+ #: my-calendar.php:1346
781
+ msgid "November"
782
+ msgstr "Noviembre"
783
+
784
+ #: my-calendar.php:1296
785
+ #: my-calendar.php:1346
786
+ msgid "December"
787
+ msgstr "Diciembre"
788
+
789
+ #: my-calendar.php:1298
790
+ msgid "Year"
791
+ msgstr "Año"
792
+
793
+ #: my-calendar.php:1321
794
+ msgid "Go"
795
+ msgstr "Ir"
796
+
797
+ #: my-calendar.php:1339
798
+ #: my-calendar.php:1342
799
+ msgid "<abbr title=\"Sunday\">Sun</abbr>"
800
+ msgstr "<abbr title=\"Domingo\">Dom</abbr>"
801
+
802
+ #: my-calendar.php:1339
803
+ #: my-calendar.php:1342
804
+ msgid "<abbr title=\"Monday\">Mon</abbr>"
805
+ msgstr "<abbr title=\"Lunes\">Lun</abbr>"
806
+
807
+ #: my-calendar.php:1339
808
+ #: my-calendar.php:1342
809
+ msgid "<abbr title=\"Tuesday\">Tues</abbr>"
810
+ msgstr "<abbr title=\"Martes\">Mar</abbr>"
811
+
812
+ #: my-calendar.php:1339
813
+ #: my-calendar.php:1342
814
+ msgid "<abbr title=\"Wednesday\">Wed</abbr>"
815
+ msgstr "<abbr title=\"Miercoles\">Mie</abbr>"
816
+
817
+ #: my-calendar.php:1339
818
+ #: my-calendar.php:1342
819
+ msgid "<abbr title=\"Thursday\">Thur</abbr>"
820
+ msgstr "<abbr title=\"Jueves\">Jue</abbr>"
821
+
822
+ #: my-calendar.php:1339
823
+ #: my-calendar.php:1342
824
+ msgid "<abbr title=\"Friday\">Fri</abbr>"
825
+ msgstr "<abbr title=\"Viernes\">Vie</abbr>"
826
+
827
+ #: my-calendar.php:1339
828
+ #: my-calendar.php:1342
829
+ msgid "<abbr title=\"Saturday\">Sat</abbr>"
830
+ msgstr "<abbr title=\"Sabado\">Sab</abbr>"
831
+
832
+ #: my-calendar.php:1427
833
+ #: my-calendar.php:1430
834
+ msgid "Calendar"
835
+ msgstr "Calendario"
836
+
837
+ #: my-calendar.php:1434
838
+ msgid "Events in"
839
+ msgstr "Eventos en"
840
+
841
+ #: my-calendar.php:1543
842
+ msgid "There are no events scheduled during this period."
843
+ msgstr "No hay eventos agendados en este período."
844
+
845
+ #: my-calendar.php:1553
846
+ msgid "Category Key"
847
+ msgstr "Clave de Categoría"
848
+
849
+ #. Plugin URI of the plugin/theme
850
+ msgid "http://www.joedolson.com/articles/my-calendar/"
851
+ msgstr "http://www.joedolson.com/articles/my-calendar/"
852
+
853
+ #. Description of the plugin/theme
854
+ msgid "Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets."
855
+ msgstr "Accesible plugin de Wordpress para calendario de eventos. Muestra eventos de varios calendarios en páginas, en entradas, o en widgets."
856
+
857
+ #. Author of the plugin/theme
858
+ msgid "Joseph C Dolson"
859
+ msgstr "Joseph C Dolson - Spanish Translator www.netmdp.com"
860
+
861
+ #. Author URI of the plugin/theme
862
+ msgid "http://www.joedolson.com"
863
+ msgstr "http://www.joedolson.com"
864
+
my-calendar-event-manager.php CHANGED
@@ -1,10 +1,34 @@
1
<?php
2
// The actual function called to render the manage events page and
3
// to deal with posts
4
- function edit_calendar() {
5
global $current_user, $wpdb, $users_entries;
6
?>
7
8
<?php
9
// First some quick cleaning up
10
$edit = $create = $save = $delete = false;
@@ -18,7 +42,7 @@ if ($_GET['action'] == 'edit') {
18
}
19
20
// Lets see if this is first run and create us a table if it is!
21
- check_calendar();
22
23
if ($_GET['action'] == 'delete') {
24
$sql = "SELECT event_title FROM " . MY_CALENDAR_TABLE . " WHERE event_id=" . (int) $_GET['event_id'];
@@ -26,7 +50,7 @@ if ($_GET['action'] == 'delete') {
26
?>
27
<div class="error">
28
<p><strong><?php _e('Delete Event','my-calendar'); ?>:</strong> <?php _e('Are you sure you want to delete this event?','my-calendar'); ?></p>
29
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=my-calendar" method="post">
30
<div>
31
<input type="hidden" value="delete" name="action" />
32
<input type="hidden" value="<?php echo (int) $_GET['event_id']; ?>" name="event_id" />
@@ -145,28 +169,28 @@ if ( $action == 'add' ) {
145
}
146
if ($start_date_ok == 1 && $end_date_ok == 1 && $time_ok == 1 && $url_ok == 1 && $title_ok == 1 && $recurring_ok == 1) {
147
$sql = "INSERT INTO " . MY_CALENDAR_TABLE . " SET
148
- event_title='" . mysql_escape_string($title) . "',
149
- event_desc='" . mysql_escape_string($desc) . "',
150
- event_begin='" . mysql_escape_string($begin) . "',
151
- event_end='" . mysql_escape_string($end) . "',
152
- event_time='" . mysql_escape_string($time) . "',
153
- event_recur='" . mysql_escape_string($recur) . "',
154
- event_repeats='" . mysql_escape_string($repeats) . "',
155
event_author=".$current_user->ID.",
156
- event_category=".mysql_escape_string($category).",
157
- event_link='".mysql_escape_string($linky)."',
158
- event_label='".mysql_escape_string($event_label)."',
159
- event_street='".mysql_escape_string($event_street)."',
160
- event_street2='".mysql_escape_string($event_street2)."',
161
- event_city='".mysql_escape_string($event_city)."',
162
- event_state='".mysql_escape_string($event_state)."',
163
- event_postcode='".mysql_escape_string($event_postcode)."',
164
- event_country='".mysql_escape_string($event_country)."'";
165
166
$wpdb->get_results($sql);
167
168
- $sql = "SELECT event_id FROM " . MY_CALENDAR_TABLE . " WHERE event_title='" . mysql_escape_string($title) . "'"
169
- . " AND event_desc='" . mysql_escape_string($desc) . "' AND event_begin='" . mysql_escape_string($begin) . "' AND event_end='" . mysql_escape_string($end) . "' AND event_recur='" . mysql_escape_string($recur) . "' AND event_repeats='" . mysql_escape_string($repeats) . "' LIMIT 1";
170
$result = $wpdb->get_results($sql);
171
172
if ( empty($result) || empty($result[0]->event_id) ) {
@@ -311,29 +335,29 @@ if ( $action == 'add' ) {
311
}
312
if ($start_date_ok == 1 && $end_date_ok == 1 && $time_ok == 1 && $url_ok == 1 && $title_ok && $recurring_ok == 1) {
313
$sql = "UPDATE " . MY_CALENDAR_TABLE . " SET
314
- event_title='" . mysql_escape_string($title) . "',
315
- event_desc='" . mysql_escape_string($desc) . "',
316
- event_begin='" . mysql_escape_string($begin) . "',
317
- event_end='" . mysql_escape_string($end) . "',
318
- event_time='" . mysql_escape_string($time) . "',
319
- event_recur='" . mysql_escape_string($recur) . "',
320
- event_repeats='" . mysql_escape_string($repeats) . "',
321
event_author=".$current_user->ID . ",
322
- event_category=".mysql_escape_string($category).",
323
- event_link='".mysql_escape_string($linky)."',
324
- event_label='".mysql_escape_string($event_label)."',
325
- event_street='".mysql_escape_string($event_street)."',
326
- event_street2='".mysql_escape_string($event_street2)."',
327
- event_city='".mysql_escape_string($event_city)."',
328
- event_state='".mysql_escape_string($event_state)."',
329
- event_postcode='".mysql_escape_string($event_postcode)."',
330
- event_country='".mysql_escape_string($event_country)."'
331
- WHERE event_id='" . mysql_escape_string($event_id) . "'";
332
333
$wpdb->get_results($sql);
334
335
- $sql = "SELECT event_id FROM " . MY_CALENDAR_TABLE . " WHERE event_title='" . mysql_escape_string($title) . "'"
336
- . " AND event_desc='" . mysql_escape_string($desc) . "' AND event_begin='" . mysql_escape_string($begin) . "' AND event_end='" . mysql_escape_string($end) . "' AND event_recur='" . mysql_escape_string($recur) . "' AND event_repeats='" . mysql_escape_string($repeats) . "' LIMIT 1";
337
$result = $wpdb->get_results($sql);
338
339
if ( empty($result) || empty($result[0]->event_id) ) {
@@ -374,10 +398,10 @@ if ( $action == 'add' ) {
374
<div class="error"><p><strong><?php _e('Error','my-calendar'); ?>:</strong> <?php _e("You can't delete an event if you haven't submitted an event id",'my-calendar'); ?></p></div>
375
<?php
376
} else {
377
- $sql = "DELETE FROM " . MY_CALENDAR_TABLE . " WHERE event_id='" . mysql_escape_string($event_id) . "'";
378
$wpdb->get_results($sql);
379
380
- $sql = "SELECT event_id FROM " . MY_CALENDAR_TABLE . " WHERE event_id='" . mysql_escape_string($event_id) . "'";
381
$result = $wpdb->get_results($sql);
382
383
if ( empty($result) || empty($result[0]->event_id) ) {
@@ -402,23 +426,23 @@ if ( $action == 'add' ) {
402
if ( $action == 'edit' || ($action == 'edit_save' && $error_with_saving == 1)) {
403
?>
404
<h2><?php _e('Edit Event','my-calendar'); ?></h2>
405
- <?php show_support_box(); ?>
406
<?php
407
if ( empty($event_id) ) {
408
echo "<div class=\"error\"><p>".__("You must provide an event id in order to edit it",'my-calendar')."</p></div>";
409
} else {
410
- wp_events_edit_form('edit_save', $event_id);
411
}
412
} else {
413
?>
414
<h2><?php _e('Add Event','my-calendar'); ?></h2>
415
- <?php show_support_box(); ?>
416
417
- <?php wp_events_edit_form(); ?>
418
419
<h2><?php _e('Manage Events','my-calendar'); ?></h2>
420
421
- <?php wp_events_display_list();
422
}
423
?>
424
</div>
@@ -427,7 +451,7 @@ if ( $action == 'add' ) {
427
}
428
429
// The event edit form for the manage events admin page
430
- function wp_events_edit_form($mode='add', $event_id=false) {
431
global $wpdb,$users_entries;
432
$data = false;
433
@@ -436,7 +460,7 @@ function wp_events_edit_form($mode='add', $event_id=false) {
436
echo "<div class=\"error\"><p>".__('Sorry! That\'s an invalid event key.','my-calendar')."</p></div>";
437
return;
438
} else {
439
- $data = $wpdb->get_results("SELECT * FROM " . MY_CALENDAR_TABLE . " WHERE event_id='" . mysql_escape_string($event_id) . "' LIMIT 1");
440
if ( empty($data) ) {
441
echo "<div class=\"error\"><p>".__("Sorry! We couldn't find an event with that ID.",'my-calendar')."</p></div>";
442
return;
@@ -457,7 +481,7 @@ function wp_events_edit_form($mode='add', $event_id=false) {
457
<div class="postbox">
458
<h3><?php if ($mode == "add") { _e('Add an Event','my-calendar'); } else { _e('Edit Event'); } ?></h3>
459
<div class="inside">
460
- <form name="my-calendar" id="my-calendar" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=my-calendar">
461
<div>
462
<input type="hidden" name="action" value="<?php echo $mode; ?>" />
463
<input type="hidden" name="event_id" value="<?php echo $event_id; ?>" />
@@ -579,7 +603,7 @@ function wp_events_edit_form($mode='add', $event_id=false) {
579
<?php
580
}
581
// Used on the manage events admin page to display a list of events
582
- function wp_events_display_list() {
583
global $wpdb;
584
585
$events = $wpdb->get_results("SELECT * FROM " . MY_CALENDAR_TABLE . " ORDER BY event_begin DESC");
@@ -637,7 +661,7 @@ function wp_events_display_list() {
637
?>
638
<td style="background-color:<?php echo $this_cat->category_color;?>;"><?php echo $this_cat->category_name; ?></td>
639
<?php unset($this_cat); ?>
640
- <td><a href="<?php echo $_SERVER['PHP_SELF'] ?>?page=my-calendar&amp;action=edit&amp;event_id=<?php echo $event->event_id;?>" class='edit'><?php echo __('Edit','my-calendar'); ?></a> &middot; <a href="<?php echo $_SERVER['PHP_SELF'] ?>?page=my-calendar&amp;action=delete&amp;event_id=<?php echo $event->event_id;?>" class="delete"><?php echo __('Delete','my-calendar'); ?></a></td> </tr>
641
<?php
642
}
643
?>
1
<?php
2
// The actual function called to render the manage events page and
3
// to deal with posts
4
+ function edit_my_calendar() {
5
global $current_user, $wpdb, $users_entries;
6
?>
7
8
+ <?php
9
+ update_option('ko_calendar_imported','false');
10
+ if ( get_option('ko_calendar_imported') != 'true' ) {
11
+ if (function_exists('check_calendar')) {
12
+ echo "<div id='message' class='updated'>";
13
+ echo "<p>";
14
+ _e('My Calendar has identified that you have the Calendar plugin by Kieran O\'Shea installed. You can import those events and categories into the My Calendar database. Would you like to import these events?','my-calendar');
15
+ echo "</p>";
16
+ ?>
17
+ <form method="post" action="<?php bloginfo('url'); ?>/wp-admin/admin.php?page=my-calendar-config">
18
+ <div>
19
+ <input type="hidden" name="import" value="true" />
20
+ <input type="submit" value="Import from Calendar" name="import-calendar" class="button-primary" />
21
+ </div>
22
+ </form>
23
+ <?php
24
+ echo "<p>";
25
+ _e('Calendar Import has received limited testing. Although it is possible that it could fail to import your events correctly, it should not have any impact on your existing Calendar database. If you encounter any problems, <a href="http://www.joedolson.com/contact.php">please contact me</a>!','my-calendar');
26
+ echo "</p>";
27
+ echo "</div>";
28
+ }
29
+ }
30
+ ?>
31
+
32
<?php
33
// First some quick cleaning up
34
$edit = $create = $save = $delete = false;
42
}
43
44
// Lets see if this is first run and create us a table if it is!
45
+ check_my_calendar();
46
47
if ($_GET['action'] == 'delete') {
48
$sql = "SELECT event_title FROM " . MY_CALENDAR_TABLE . " WHERE event_id=" . (int) $_GET['event_id'];
50
?>
51
<div class="error">
52
<p><strong><?php _e('Delete Event','my-calendar'); ?>:</strong> <?php _e('Are you sure you want to delete this event?','my-calendar'); ?></p>
53
+ <form action="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar" method="post">
54
<div>
55
<input type="hidden" value="delete" name="action" />
56
<input type="hidden" value="<?php echo (int) $_GET['event_id']; ?>" name="event_id" />
169
}
170
if ($start_date_ok == 1 && $end_date_ok == 1 && $time_ok == 1 && $url_ok == 1 && $title_ok == 1 && $recurring_ok == 1) {
171
$sql = "INSERT INTO " . MY_CALENDAR_TABLE . " SET
172
+ event_title='" . mysql_real_escape_string($title) . "',
173
+ event_desc='" . mysql_real_escape_string($desc) . "',
174
+ event_begin='" . mysql_real_escape_string($begin) . "',
175
+ event_end='" . mysql_real_escape_string($end) . "',
176
+ event_time='" . mysql_real_escape_string($time) . "',
177
+ event_recur='" . mysql_real_escape_string($recur) . "',
178
+ event_repeats='" . mysql_real_escape_string($repeats) . "',
179
event_author=".$current_user->ID.",
180
+ event_category=".mysql_real_escape_string($category).",
181
+ event_link='".mysql_real_escape_string($linky)."',
182
+ event_label='".mysql_real_escape_string($event_label)."',
183
+ event_street='".mysql_real_escape_string($event_street)."',
184
+ event_street2='".mysql_real_escape_string($event_street2)."',
185
+ event_city='".mysql_real_escape_string($event_city)."',
186
+ event_state='".mysql_real_escape_string($event_state)."',
187
+ event_postcode='".mysql_real_escape_string($event_postcode)."',
188
+ event_country='".mysql_real_escape_string($event_country)."'";
189
190
$wpdb->get_results($sql);
191
192
+ $sql = "SELECT event_id FROM " . MY_CALENDAR_TABLE . " WHERE event_title='" . mysql_real_escape_string($title) . "'"
193
+ . " AND event_desc='" . mysql_real_escape_string($desc) . "' AND event_begin='" . mysql_real_escape_string($begin) . "' AND event_end='" . mysql_real_escape_string($end) . "' AND event_recur='" . mysql_real_escape_string($recur) . "' AND event_repeats='" . mysql_real_escape_string($repeats) . "' LIMIT 1";
194
$result = $wpdb->get_results($sql);
195
196
if ( empty($result) || empty($result[0]->event_id) ) {
335
}
336
if ($start_date_ok == 1 && $end_date_ok == 1 && $time_ok == 1 && $url_ok == 1 && $title_ok && $recurring_ok == 1) {
337
$sql = "UPDATE " . MY_CALENDAR_TABLE . " SET
338
+ event_title='" . mysql_real_escape_string($title) . "',
339
+ event_desc='" . mysql_real_escape_string($desc) . "',
340
+ event_begin='" . mysql_real_escape_string($begin) . "',
341
+ event_end='" . mysql_real_escape_string($end) . "',
342
+ event_time='" . mysql_real_escape_string($time) . "',
343
+ event_recur='" . mysql_real_escape_string($recur) . "',
344
+ event_repeats='" . mysql_real_escape_string($repeats) . "',
345
event_author=".$current_user->ID . ",
346
+ event_category=".mysql_real_escape_string($category).",
347
+ event_link='".mysql_real_escape_string($linky)."',
348
+ event_label='".mysql_real_escape_string($event_label)."',
349
+ event_street='".mysql_real_escape_string($event_street)."',
350
+ event_street2='".mysql_real_escape_string($event_street2)."',
351
+ event_city='".mysql_real_escape_string($event_city)."',
352
+ event_state='".mysql_real_escape_string($event_state)."',
353
+ event_postcode='".mysql_real_escape_string($event_postcode)."',
354
+ event_country='".mysql_real_escape_string($event_country)."'
355
+ WHERE event_id='" . mysql_real_escape_string($event_id) . "'";
356
357
$wpdb->get_results($sql);
358
359
+ $sql = "SELECT event_id FROM " . MY_CALENDAR_TABLE . " WHERE event_title='" . mysql_real_escape_string($title) . "'"
360
+ . " AND event_desc='" . mysql_real_escape_string($desc) . "' AND event_begin='" . mysql_real_escape_string($begin) . "' AND event_end='" . mysql_real_escape_string($end) . "' AND event_recur='" . mysql_real_escape_string($recur) . "' AND event_repeats='" . mysql_real_escape_string($repeats) . "' LIMIT 1";
361
$result = $wpdb->get_results($sql);
362
363
if ( empty($result) || empty($result[0]->event_id) ) {
398
<div class="error"><p><strong><?php _e('Error','my-calendar'); ?>:</strong> <?php _e("You can't delete an event if you haven't submitted an event id",'my-calendar'); ?></p></div>
399
<?php
400
} else {
401
+ $sql = "DELETE FROM " . MY_CALENDAR_TABLE . " WHERE event_id='" . mysql_real_escape_string($event_id) . "'";
402
$wpdb->get_results($sql);
403
404
+ $sql = "SELECT event_id FROM " . MY_CALENDAR_TABLE . " WHERE event_id='" . mysql_real_escape_string($event_id) . "'";
405
$result = $wpdb->get_results($sql);
406
407
if ( empty($result) || empty($result[0]->event_id) ) {
426
if ( $action == 'edit' || ($action == 'edit_save' && $error_with_saving == 1)) {
427
?>
428
<h2><?php _e('Edit Event','my-calendar'); ?></h2>
429
+ <?php jd_show_support_box(); ?>
430
<?php
431
if ( empty($event_id) ) {
432
echo "<div class=\"error\"><p>".__("You must provide an event id in order to edit it",'my-calendar')."</p></div>";
433
} else {
434
+ jd_events_edit_form('edit_save', $event_id);
435
}
436
} else {
437
?>
438
<h2><?php _e('Add Event','my-calendar'); ?></h2>
439
+ <?php jd_show_support_box(); ?>
440
441
+ <?php jd_events_edit_form(); ?>
442
443
<h2><?php _e('Manage Events','my-calendar'); ?></h2>
444
445
+ <?php jd_events_display_list();
446
}
447
?>
448
</div>
451
}
452
453
// The event edit form for the manage events admin page
454
+ function jd_events_edit_form($mode='add', $event_id=false) {
455
global $wpdb,$users_entries;
456
$data = false;
457
460
echo "<div class=\"error\"><p>".__('Sorry! That\'s an invalid event key.','my-calendar')."</p></div>";
461
return;
462
} else {
463
+ $data = $wpdb->get_results("SELECT * FROM " . MY_CALENDAR_TABLE . " WHERE event_id='" . mysql_real_escape_string($event_id) . "' LIMIT 1");
464
if ( empty($data) ) {
465
echo "<div class=\"error\"><p>".__("Sorry! We couldn't find an event with that ID.",'my-calendar')."</p></div>";
466
return;
481
<div class="postbox">
482
<h3><?php if ($mode == "add") { _e('Add an Event','my-calendar'); } else { _e('Edit Event'); } ?></h3>
483
<div class="inside">
484
+ <form name="my-calendar" id="my-calendar" method="post" action="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar">
485
<div>
486
<input type="hidden" name="action" value="<?php echo $mode; ?>" />
487
<input type="hidden" name="event_id" value="<?php echo $event_id; ?>" />
603
<?php
604
}
605
// Used on the manage events admin page to display a list of events
606
+ function jd_events_display_list() {
607
global $wpdb;
608
609
$events = $wpdb->get_results("SELECT * FROM " . MY_CALENDAR_TABLE . " ORDER BY event_begin DESC");
661
?>
662
<td style="background-color:<?php echo $this_cat->category_color;?>;"><?php echo $this_cat->category_name; ?></td>
663
<?php unset($this_cat); ?>
664
+ <td><a href="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar&amp;action=edit&amp;event_id=<?php echo $event->event_id;?>" class='edit'><?php echo __('Edit','my-calendar'); ?></a> &middot; <a href="<?php bloginfo('wpurl'); ?>/wp-admin/admin.php?page=my-calendar&amp;action=delete&amp;event_id=<?php echo $event->event_id;?>" class="delete"><?php echo __('Delete','my-calendar'); ?></a></td> </tr>
665
<?php
666
}
667
?>
my-calendar-help.php CHANGED
@@ -4,7 +4,7 @@ function my_calendar_help() {
4
?>
5
<div class="wrap">
6
<h2><?php _e('How to use My Calendar','my-calendar'); ?></h2>
7
- <?php show_support_box(); ?>
8
9
<div id="poststuff" class="jd-my-calendar">
10
<div class="postbox">
@@ -56,6 +56,9 @@ function my_calendar_help() {
56
<dt><code>{date}</code></dt>
57
<dd><?php _e('Displays the date on which the event begins.','my-calendar'); ?></dd>
58
59
<dt><code>{author}</code></dt>
60
<dd><?php _e('Displays the WordPress author who posted the event.','my-calendar'); ?></dd>
61
4
?>
5
<div class="wrap">
6
<h2><?php _e('How to use My Calendar','my-calendar'); ?></h2>
7
+ <?php jd_show_support_box(); ?>
8
9
<div id="poststuff" class="jd-my-calendar">
10
<div class="postbox">
56
<dt><code>{date}</code></dt>
57
<dd><?php _e('Displays the date on which the event begins.','my-calendar'); ?></dd>
58
59
+ <dt><code>{enddate}</code></dt>
60
+ <dd><?php _e('Displays the date on which the event ends.','my-calendar'); ?></dd>
61
+
62
<dt><code>{author}</code></dt>
63
<dd><?php _e('Displays the WordPress author who posted the event.','my-calendar'); ?></dd>
64
my-calendar-settings.php CHANGED
@@ -1,16 +1,85 @@
1
<?php
2
// Display the admin configuration page
3
function edit_my_calendar_config() {
4
global $wpdb, $initial_style;
5
6
// We can't use this page unless My Calendar is installed/upgraded
7
- check_calendar();
8
9
if (isset($_POST['permissions']) && isset($_POST['style'])) {
10
- if ($_POST['permissions'] == 'subscriber') { $new_perms = 'read'; }
11
- else if ($_POST['permissions'] == 'contributor') { $new_perms = 'edit_posts'; }
12
- else if ($_POST['permissions'] == 'author') { $new_perms = 'publish_posts'; }
13
- else if ($_POST['permissions'] == 'editor') { $new_perms = 'moderate_comments'; }
14
else if ($_POST['permissions'] == 'admin') { $new_perms = 'manage_options'; }
15
else { $new_perms = 'manage_options'; }
16
@@ -18,35 +87,11 @@ function edit_my_calendar_config() {
18
$my_calendar_show_months = (int) $_POST['my_calendar_show_months'];
19
$my_calendar_date_format = $_POST['my_calendar_date_format'];
20
21
- if (mysql_escape_string($_POST['display_author']) == 'on') {
22
- $disp_author = 'true';
23
- } else {
24
- $disp_author = 'false';
25
- }
26
-
27
- if (mysql_escape_string($_POST['display_jump']) == 'on') {
28
- $disp_jump = 'true';
29
- } else {
30
- $disp_jump = 'false';
31
- }
32
-
33
- if (mysql_escape_string($_POST['use_styles']) == 'on') {
34
- $use_styles = 'true';
35
- } else {
36
- $use_styles = 'false';
37
- }
38
-
39
- if (mysql_escape_string($_POST['my_calendar_show_map']) == 'on') {
40
- $my_calendar_show_map = 'true';
41
- } else {
42
- $my_calendar_show_map = 'false';
43
- }
44
-
45
- if (mysql_escape_string($_POST['my_calendar_show_address']) == 'on') {
46
- $my_calendar_show_address = 'true';
47
- } else {
48
- $my_calendar_show_address = 'false';
49
- }
50
51
update_option('can_manage_events',$new_perms);
52
update_option('my_calendar_style',$my_calendar_style);
@@ -61,7 +106,7 @@ function edit_my_calendar_config() {
61
update_option('list_javascript', (int) $_POST['list_javascript']);
62
// Check to see if we are replacing the original style
63
64
- if (mysql_escape_string($_POST['reset_styles']) == 'on') {
65
update_option('my_calendar_style',$initial_style);
66
}
67
echo "<div class=\"updated\"><p><strong>".__('Settings saved','my-calendar').".</strong></p></div>";
@@ -92,12 +137,12 @@ function edit_my_calendar_config() {
92
<div class="wrap">
93
94
<h2><?php _e('My Calendar Options','my-calendar'); ?></h2>
95
- <?php show_support_box(); ?>
96
<div id="poststuff" class="jd-my-calendar">
97
<div class="postbox">
98
<h3><?php _e('Calendar Settings','my-calendar'); ?></h3>
99
<div class="inside">
100
- <form name="my-calendar" id="my-calendar" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?page=my-calendar-config">
101
<fieldset>
102
<legend><?php _e('Primary Calendar Options','my-calendar'); ?></legend>
103
<p>
@@ -153,7 +198,27 @@ function edit_my_calendar_config() {
153
<input type="submit" name="save" class="button-primary" value="<?php _e('Save','my-calendar'); ?> &raquo;" />
154
</p>
155
</form>
156
</div>
157
</div>
158
</div>
159
</div>
@@ -161,4 +226,5 @@ function edit_my_calendar_config() {
161
162
163
}
164
?>
1
<?php
2
// Display the admin configuration page
3
+
4
+ if ($_POST['import'] == 'true') {
5
+ my_calendar_import();
6
+ }
7
+
8
+ function my_calendar_import() {
9
+ if ( get_option('ko_calendar_imported') != 'true' ) {
10
+ global $wpdb;
11
+ define('KO_CALENDAR_TABLE', $wpdb->prefix . 'calendar');
12
+ define('KO_CALENDAR_CATS', $wpdb->prefix . 'calendar_categories');
13
+ $events = $wpdb->get_results("SELECT * FROM " . KO_CALENDAR_TABLE, 'ARRAY_A');
14
+ $sql = "";
15
+ foreach ($events as $key) {
16
+ $title = mysql_real_escape_string($key['event_title']);
17
+ $desc = mysql_real_escape_string($key['event_desc']);
18
+ $begin = mysql_real_escape_string($key['event_begin']);
19
+ $end = mysql_real_escape_string($key['event_end']);
20
+ $time = mysql_real_escape_string($key['event_time']);
21
+ $recur = mysql_real_escape_string($key['event_recur']);
22
+ $repeats = mysql_real_escape_string($key['event_repeats']);
23
+ $author = mysql_real_escape_string($key['event_author']);
24
+ $category = mysql_real_escape_string($key['event_category']);
25
+ $linky = mysql_real_escape_string($key['event_link']);
26
+
27
+ $sql .= "INSERT INTO " . MY_CALENDAR_TABLE . " SET
28
+ event_title='" . ($title) . "',
29
+ event_desc='" . ($desc) . "',
30
+ event_begin='" . ($begin) . "',
31
+ event_end='" . ($end) . "',
32
+ event_time='" . ($time) . "',
33
+ event_recur='" . ($recur) . "',
34
+ event_repeats='" . ($repeats) . "',
35
+ event_author=".($author).",
36
+ event_category=".($category).",
37
+ event_link='".($linky)."';";
38
+ }
39
+ $cats = $wpdb->get_results("SELECT * FROM " . KO_CALENDAR_CATS, 'ARRAY_A');
40
+ $catsql = "";
41
+ foreach ($cats as $key) {
42
+ $name = mysql_real_escape_string($key['category_name']);
43
+ $color = mysql_real_escape_string($key['category_colour']);
44
+ $id = mysql_real_escape_string($key['category_id']);
45
+
46
+ if ($id != '1') {
47
+ $catsql .= "INSERT INTO " . MY_CALENDAR_CATEGORIES_TABLE . " SET
48
+ category_id='".$id."',
49
+ category_name='".$name."',
50
+ category_color='".$color."';";
51
+ }
52
+ }
53
+ $cats_results = $wpdb->query($catsql);
54
+ $events_results = $wpdb->query($sql);
55
+ if ($cats_results !== false) {
56
+ $message = __('Categories imported successfully.','my-calendar');
57
+ } else {
58
+ $message = __('Categories not imported.','my-calendar');
59
+ }
60
+ if ($events_results !== false) {
61
+ $e_message = __('Events imported successfully.','my-calendar');
62
+ } else {
63
+ $e_message = __('Events not imported.','my-calendar');
64
+ }
65
+ $return_value = "<div id='message' class='updated fade'><p><strong>$message</strong><br /><strong>$e_message</strong></p></div>";
66
+ echo $return_value;
67
+ add_option( 'ko_calendar_imported','true' );
68
+ }
69
+ }
70
+
71
function edit_my_calendar_config() {
72
global $wpdb, $initial_style;
73
74
// We can't use this page unless My Calendar is installed/upgraded
75
+ check_my_calendar();
76
77
if (isset($_POST['permissions']) && isset($_POST['style'])) {
78
+
79
+ if ($_POST['permissions'] == 'subscriber') { $new_perms = 'read'; }
80
+ else if ($_POST['permissions'] == 'contributor') { $new_perms = 'edit_posts'; }
81
+ else if ($_POST['permissions'] == 'author') { $new_perms = 'publish_posts'; }
82
+ else if ($_POST['permissions'] == 'editor') { $new_perms = 'moderate_comments'; }
83
else if ($_POST['permissions'] == 'admin') { $new_perms = 'manage_options'; }
84
else { $new_perms = 'manage_options'; }
85
87
$my_calendar_show_months = (int) $_POST['my_calendar_show_months'];
88
$my_calendar_date_format = $_POST['my_calendar_date_format'];
89
90
+ $disp_author = ($_POST['display_author']=='on')?'true':'false';
91
+ $disp_jump = ($_POST['display_jump']=='on')?'true':'false';
92
+ $use_styles = ($_POST['use_styles']=='on')?'true':'false';
93
+ $my_calendar_show_map = ($_POST['my_calendar_show_map']=='on')?'true':'false';
94
+ $my_calendar_show_address = ($_POST['my_calendar_show_address']=='on')?'true':'false';
95
96
update_option('can_manage_events',$new_perms);
97
update_option('my_calendar_style',$my_calendar_style);
106
update_option('list_javascript', (int) $_POST['list_javascript']);
107
// Check to see if we are replacing the original style
108
109
+ if ( $_POST['reset_styles'] == 'on') {
110
update_option('my_calendar_style',$initial_style);
111
}
112
echo "<div class=\"updated\"><p><strong>".__('Settings saved','my-calendar').".</strong></p></div>";
137
<div class="wrap">
138
139
<h2><?php _e('My Calendar Options','my-calendar'); ?></h2>
140
+ <?php jd_show_support_box(); ?>
141
<div id="poststuff" class="jd-my-calendar">
142
<div class="postbox">
143
<h3><?php _e('Calendar Settings','my-calendar'); ?></h3>
144
<div class="inside">
145
+ <form name="my-calendar" id="my-calendar" method="post" action="<?php bloginfo('url'); ?>/wp-admin/admin.php?page=my-calendar-config">
146
<fieldset>
147
<legend><?php _e('Primary Calendar Options','my-calendar'); ?></legend>
148
<p>
198
<input type="submit" name="save" class="button-primary" value="<?php _e('Save','my-calendar'); ?> &raquo;" />
199
</p>
200
</form>
201
+ <?php
202
+ if ( get_option('ko_calendar_imported') != 'true' ) {
203
+ if (function_exists('check_calendar')) {
204
+ echo "<div class='import'>";
205
+ echo "<p>";
206
+ _e('My Calendar has identified that you have the Calendar plugin by Kieran O\'Shea installed. You can import those events and categories into the My Calendar database. Would you like to import these events?','my-calendar');
207
+ echo "</p>";
208
+ ?>
209
+ <form method="post" action="<?php bloginfo('url'); ?>/wp-admin/admin.php?page=my-calendar-config">
210
+ <div>
211
+ <input type="hidden" name="import" value="true" />
212
+ <input type="submit" value="Import from Calendar" name="import-calendar" class="button-primary" />
213
+ </div>
214
+ </form>
215
+ <?php
216
+ echo "</div>";
217
+ }
218
+ }
219
+ ?>
220
</div>
221
+
222
</div>
223
</div>
224
</div>
226
227
228
}
229
+
230
?>
my-calendar-widgets.php CHANGED
@@ -9,7 +9,7 @@ function init_my_calendar_today() {
9
extract($args);
10
$the_title = get_option('my_calendar_today_title');
11
$widget_title = empty($the_title) ? __('Today\'s Events','my-calendar') : $the_title;
12
- $the_events = todays_events();
13
if ($the_events != '') {
14
echo $before_widget;
15
echo $before_title . $widget_title . $after_title;
@@ -54,7 +54,7 @@ function init_my_calendar_upcoming() {
54
extract($args);
55
$the_title = get_option('my_calendar_upcoming_title');
56
$widget_title = empty($the_title) ? __('Upcoming Events','my-calendar') : $the_title;
57
- $the_events = upcoming_events();
58
if ($the_events != '') {
59
echo $before_widget;
60
echo $before_title . $widget_title . $after_title;
@@ -138,11 +138,11 @@ function init_my_calendar_upcoming() {
138
139
140
// Widget upcoming events
141
- function upcoming_events() {
142
global $wpdb;
143
144
// This function cannot be called unless calendar is up to date
145
- check_calendar();
146
$template = get_option('my_calendar_upcoming_template');
147
$display_upcoming_type = get_option('display_upcoming_type');
148
@@ -160,18 +160,18 @@ function upcoming_events() {
160
if ($display_upcoming_type == "date") {
161
while ($day_count < $future_days+1) {
162
list($y,$m,$d) = split("-",date("Y-m-d",mktime($day_count*24,0,0,date("m"),date("d"),date("Y"))));
163
- $events = grab_events( $y,$m,$d );
164
165
- usort($events, "time_cmp");
166
foreach($events as $event) {
167
$event_details = event_as_array($event);
168
- $output .= "<li>".draw_widget_event($event_details,$template)."</li>";
169
}
170
$day_count = $day_count+1;
171
}
172
} else {
173
- $events = get_all_events( ); // grab all events WITHIN reasonable proximity
174
- usort($events, "timediff_cmp");// sort all events by proximity to current date
175
for ($i=0;$i<=($past_events+$future_events);$i++) {
176
if ($events[$i]) {
177
$near_events[] = $events[$i]; // split off a number of events equal to the past + future settings
@@ -179,21 +179,21 @@ function upcoming_events() {
179
}
180
181
$events = $near_events;
182
- usort($events, "datetime_cmp"); // sort split events by date
183
184
foreach($events as $event) {
185
$event_details = event_as_array($event);
186
$today = date('Y').'-'.date('m').'-'.date('d');
187
$date = date('Y-m-d',strtotime($event_details['date']));
188
- if (date_comp($date,$today)===true) {
189
$class = "past-event";
190
} else {
191
$class = "future-event";
192
}
193
- if (date_equal($date,$today)) {
194
$class = "today";
195
}
196
- $output .= "<li class=\"$class\">".draw_widget_event($event_details,$template)."</li>\n";
197
}
198
$day_count = $day_count+1;
199
}
@@ -205,19 +205,19 @@ function upcoming_events() {
205
}
206
207
// Widget todays events
208
- function todays_events() {
209
global $wpdb;
210
211
// This function cannot be called unless calendar is up to date
212
- check_calendar();
213
214
$template = get_option('my_calendar_today_template');
215
216
- $events = grab_events(date("Y"),date("m"),date("d"));
217
if (count($events) != 0) {
218
$output = "<ul>";
219
}
220
- usort($events, "time_cmp");
221
foreach($events as $event) {
222
$event_details = event_as_array($event);
223
@@ -228,7 +228,7 @@ function todays_events() {
228
}
229
// correct displayed time to today
230
$event_details['date'] = $date;
231
- $output .= "<li>".draw_widget_event($event_details,$template)."</li>";
232
}
233
if (count($events) != 0) {
234
$output .= "</ul>";
@@ -236,7 +236,7 @@ function todays_events() {
236
}
237
}
238
239
- function draw_widget_event($array,$template) {
240
//1st argument: array of details
241
//2nd argument: template to print details into
242
foreach ($array as $key=>$value) {
@@ -250,7 +250,7 @@ function draw_widget_event($array,$template) {
250
function event_as_array($event) {
251
global $wpdb;
252
// My Calendar must be updated to run this function
253
- check_calendar();
254
255
$sql = "SELECT category_name FROM " . MY_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".$event->event_category;
256
$category_name = $wpdb->get_row($sql);
@@ -296,10 +296,13 @@ if (strlen($map_string) > 10) {
296
297
if (get_option('my_calendar_date_format') != '') {
298
$date = date(get_option('my_calendar_date_format'),strtotime($event->event_begin));
299
} else {
300
$date = date(get_option('date_format'),strtotime($event->event_begin));
301
}
302
303
$details = array();
304
$details['category'] = $category_name->category_name;
305
$details['title'] = $event->event_title;
@@ -313,6 +316,7 @@ $date = date(get_option('date_format'),strtotime($event->event_begin));
313
$details['link_title'] = $event->event_title;
314
}
315
$details['date'] = $date;
316
$details['location'] = $event->event_label;
317
$details['street'] = $event->event_street;
318
$details['street2'] = $event->event_street2;
9
extract($args);
10
$the_title = get_option('my_calendar_today_title');
11
$widget_title = empty($the_title) ? __('Today\'s Events','my-calendar') : $the_title;
12
+ $the_events = my_calendar_todays_events();
13
if ($the_events != '') {
14
echo $before_widget;
15
echo $before_title . $widget_title . $after_title;
54
extract($args);
55
$the_title = get_option('my_calendar_upcoming_title');
56
$widget_title = empty($the_title) ? __('Upcoming Events','my-calendar') : $the_title;
57
+ $the_events = my_calendar_upcoming_events();
58
if ($the_events != '') {
59
echo $before_widget;
60
echo $before_title . $widget_title . $after_title;
138
139
140
// Widget upcoming events
141
+ function my_calendar_upcoming_events() {
142
global $wpdb;
143
144
// This function cannot be called unless calendar is up to date
145
+ check_my_calendar();
146
$template = get_option('my_calendar_upcoming_template');
147
$display_upcoming_type = get_option('display_upcoming_type');
148
160
if ($display_upcoming_type == "date") {
161
while ($day_count < $future_days+1) {
162
list($y,$m,$d) = split("-",date("Y-m-d",mktime($day_count*24,0,0,date("m"),date("d"),date("Y"))));
163
+ $events = my_calendar_grab_events( $y,$m,$d );
164
165
+ usort($events, "my_calendar_time_cmp");
166
foreach($events as $event) {
167
$event_details = event_as_array($event);
168
+ $output .= "<li>".jd_draw_widget_event($event_details,$template)."</li>";
169
}
170
$day_count = $day_count+1;
171
}
172
} else {
173
+ $events = mc_get_all_events( ); // grab all events WITHIN reasonable proximity
174
+ usort($events, "my_calendar_timediff_cmp");// sort all events by proximity to current date
175
for ($i=0;$i<=($past_events+$future_events);$i++) {
176
if ($events[$i]) {
177
$near_events[] = $events[$i]; // split off a number of events equal to the past + future settings
179
}
180
181
$events = $near_events;
182
+ usort($events, "my_calendar_datetime_cmp"); // sort split events by date
183
184
foreach($events as $event) {
185
$event_details = event_as_array($event);
186
$today = date('Y').'-'.date('m').'-'.date('d');
187
$date = date('Y-m-d',strtotime($event_details['date']));
188
+ if (my_calendar_date_comp($date,$today)===true) {
189
$class = "past-event";
190
} else {
191
$class = "future-event";
192
}
193
+ if (my_calendar_date_equal($date,$today)) {
194
$class = "today";
195
}
196
+ $output .= "<li class=\"$class\">".jd_draw_widget_event($event_details,$template)."</li>\n";
197
}
198
$day_count = $day_count+1;
199
}
205
}
206
207
// Widget todays events
208
+ function my_calendar_todays_events() {
209
global $wpdb;
210
211
// This function cannot be called unless calendar is up to date
212
+ check_my_calendar();
213
214
$template = get_option('my_calendar_today_template');
215
216
+ $events = my_calendar_grab_events(date("Y"),date("m"),date("d"));
217
if (count($events) != 0) {
218
$output = "<ul>";
219
}
220
+ usort($events, "my_calendar_time_cmp");
221
foreach($events as $event) {
222
$event_details = event_as_array($event);
223
228
}
229
// correct displayed time to today
230
$event_details['date'] = $date;
231
+ $output .= "<li>".jd_draw_widget_event($event_details,$template)."</li>";
232
}
233
if (count($events) != 0) {
234
$output .= "</ul>";
236
}
237
}
238
239
+ function jd_draw_widget_event($array,$template) {
240
//1st argument: array of details
241
//2nd argument: template to print details into
242
foreach ($array as $key=>$value) {
250
function event_as_array($event) {
251
global $wpdb;
252
// My Calendar must be updated to run this function
253
+ check_my_calendar();
254
255
$sql = "SELECT category_name FROM " . MY_CALENDAR_CATEGORIES_TABLE . " WHERE category_id=".$event->event_category;
256
$category_name = $wpdb->get_row($sql);
296
297
if (get_option('my_calendar_date_format') != '') {
298
$date = date(get_option('my_calendar_date_format'),strtotime($event->event_begin));
299
+ $date_end = date(get_option('my_calendar_date_format'),strtotime($event->event_end));
300
} else {
301
$date = date(get_option('date_format'),strtotime($event->event_begin));
302
+ $date_end = date(get_option('date_format'),strtotime($event->event_end));
303
}
304
305
+
306
$details = array();
307
$details['category'] = $category_name->category_name;
308
$details['title'] = $event->event_title;
316
$details['link_title'] = $event->event_title;
317
}
318
$details['date'] = $date;
319
+ $details['enddate'] = $date_end;
320
$details['location'] = $event->event_label;
321
$details['street'] = $event->event_street;
322
$details['street2'] = $event->event_street2;
my-calendar.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.joedolson.com/articles/my-calendar/
5
Description: Accessible WordPress event calendar plugin. Show events from multiple calendars on pages, in posts, or in widgets.
6
Author: Joseph C Dolson
7
Author URI: http://www.joedolson.com
8
- Version: 1.0.0
9
*/
10
/* Copyright 2009 Joe Dolson (email : joe@joedolson.com)
11
@@ -27,16 +27,16 @@ Version: 1.0.0
27
// Enable internationalisation
28
$plugin_dir = basename(dirname(__FILE__));
29
load_plugin_textdomain( 'my-calendar','wp-content/plugins/'.$plugin_dir, $plugin_dir);
30
-
31
// Define the tables used in My Calendar
32
- define('MY_CALENDAR_TABLE', $table_prefix . 'my_calendar');
33
- define('MY_CALENDAR_CATEGORIES_TABLE', $table_prefix . 'my_calendar_categories');
34
// Create a master category for My Calendar and its sub-pages
35
add_action('admin_menu', 'my_calendar_menu');
36
// Add the function that puts style information in the header
37
add_action('wp_head', 'my_calendar_wp_head');
38
// Add the function that deals with deleted users
39
- add_action('delete_user', 'wp_deal_with_deleted_user');
40
// Add the widgets if we are using version 2.8
41
add_action('widgets_init', 'init_my_calendar_today');
42
add_action('widgets_init', 'init_my_calendar_upcoming');
@@ -58,7 +58,7 @@ include(dirname(__FILE__).'/date-utilities.php' );
58
59
// Before we get on with the functions, we need to define the initial style used for My Calendar
60
61
- function show_support_box() {
62
?>
63
<div class="resources">
64
<ul>
@@ -79,10 +79,10 @@ function show_support_box() {
79
}
80
81
// Function to deal with events posted by a user when that user is deleted
82
- function deal_with_deleted_user($id) {
83
global $wpdb;
84
// This wouldn't work unless the database was up to date. Lets check.
85
- check_calendar();
86
// Do the query
87
$wpdb->get_results( "UPDATE ".MY_CALENDAR_TABLE." SET event_author=".$wpdb->get_var("SELECT MIN(ID) FROM ".$wpdb->prefix."users",0,0)." WHERE event_author=".$id );
88
}
@@ -91,7 +91,7 @@ function deal_with_deleted_user($id) {
91
function my_calendar_wp_head() {
92
global $wpdb;
93
// If the calendar isn't installed or upgraded this won't work
94
- check_calendar();
95
$styles = stripcslashes(get_option('my_calendar_style'));
96
if ( get_option('my_calendar_use_styles') != 'true' ) {
97
echo "
@@ -108,7 +108,7 @@ $styles
108
function my_calendar_menu() {
109
global $wpdb;
110
// We make use of the My Calendar tables so we must have installed My Calendar
111
- check_calendar();
112
// Set admin as the only one who can use My Calendar for security
113
$allowed_group = 'manage_options';
114
// Use the database to *potentially* override the above if allowed
@@ -117,14 +117,14 @@ function my_calendar_menu() {
117
118
// Add the admin panel pages for My Calendar. Use permissions pulled from above
119
if (function_exists('add_menu_page')) {
120
- add_menu_page(__('My Calendar','my-calendar'), __('My Calendar','my-calendar'), $allowed_group, 'my-calendar', 'edit_calendar');
121
}
122
if (function_exists('add_submenu_page')) {
123
- add_submenu_page('my-calendar', __('Add/Edit Events','my-calendar'), __('Add/Edit Events','my-calendar'), $allowed_group, 'my-calendar', 'edit_calendar');
124
add_action( "admin_head", 'my_calendar_write_js' );
125
add_action( "admin_head", 'my_calendar_add_styles' );
126
// Note only admin can change calendar options
127
- add_submenu_page('my-calendar', __('Manage Categories','my-calendar'), __('Manage Categories','my-calendar'), 'manage_options', 'my-calendar-categories', 'manage_categories');
128
add_submenu_page('my-calendar', __('Settings','my-calendar'), __('Settings','my-calendar'), 'manage_options', 'my-calendar-config', 'edit_my_calendar_config');
129
add_submenu_page('my-calendar', __('My Calendar Help','my-calendar'), __('Help','my-calendar'), 'manage_options', 'my-calendar-help', 'my_calendar_help');
130
}
@@ -265,6 +265,15 @@ text-decoration: none;
265
border: 1px solid #999;
266
background: #b11;
267
}
268
.n4 {width: 16px;}
269
.n5 {width: 32px;}
270
.n6 {width: 64px;}
@@ -287,7 +296,7 @@ function my_calendar_insert($atts) {
287
add_shortcode('my_calendar','my_calendar_insert');
288
289
// Function to check what version of My Calendar is installed and install if needed
290
- function check_calendar() {
291
// Checks to make sure My Calendar is installed, if not it adds the default
292
// database tables and populates them with test data. If it is, then the
293
// version is checked through various means and if it is not up to date
@@ -564,10 +573,10 @@ $default_template = "<strong>{date}</strong> &#8211; {link_title}<br /><span>{ti
564
add_option('display_upcoming_days',7);
565
add_option('my_calendar_version','1.0');
566
add_option('display_upcoming_type','false');
567
- add_option('display_upcoming_events',3);
568
add_option('display_past_days',0);
569
add_option('display_past_events',2);
570
- add_option('my_calendar_use_styles','true');
571
add_option('my_calendar_show_months',1);
572
add_option('my_calendar_show_map','true');
573
add_option('my_calendar_show_address','false');
@@ -575,8 +584,8 @@ $default_template = "<strong>{date}</strong> &#8211; {link_title}<br /><span>{ti
575
add_option('my_calendar_upcoming_template',$default_template);
576
add_option('my_calendar_today_title','Today\'s Events');
577
add_option('my_calendar_upcoming_title','Upcoming Events');
578
- add_option('calendar_javascript',1);
579
- add_option('list_javascript',1);
580
$sql = "UPDATE " . MY_CALENDAR_TABLE . " SET event_category=1";
581
$wpdb->get_results($sql);
582
@@ -615,7 +624,7 @@ function jd_cal_checkSelect( $theFieldname,$theValue ) {
615
616
// Function to return a prefix which will allow the correct
617
// placement of arguments into the query string.
618
- function permalink_prefix() {
619
// Get the permalink structure from WordPress
620
$p_link = get_permalink();
621
@@ -652,18 +661,18 @@ function permalink_prefix() {
652
}
653
654
// Configure the "Next" link in the calendar
655
- function next_link($cur_year,$cur_month) {
656
$mod_rewrite_months = array(1=>'jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec');
657
$next_year = $cur_year + 1;
658
659
$num_months = get_option('my_calendar_show_months');
660
if ($num_months <= 1) {
661
if ($cur_month == 12) {
662
- return '<a href="' . permalink_prefix() . 'month=jan&amp;yr=' . $next_year . '" rel="nofollow">'.__('Next Events','my-calendar').' &raquo;</a>';
663
} else {
664
$next_month = $cur_month + 1;
665
$month = $mod_rewrite_months[$next_month];
666
- return '<a href="' . permalink_prefix() . 'month='.$month.'&amp;yr=' . $cur_year . '" rel="nofollow">'.__('Next Events','my-calendar').' &raquo;</a>';
667
}
668
} else {
669
if (($cur_month + $num_months) > 12) {
@@ -673,26 +682,26 @@ $num_months = get_option('my_calendar_show_months');
673
}
674
$month = $mod_rewrite_months[$next_month];
675
if ($cur_month >= (12-$num_months)) {
676
- return '<a href="' . permalink_prefix() . 'month='.$month.'&amp;yr=' . $next_year . '" rel="nofollow">'.__('Next Events','my-calendar').' &raquo;</a>';
677
} else {
678
- return '<a href="' . permalink_prefix() . 'month='.$month.'&amp;yr=' . $cur_year . '" rel="nofollow">'.__('Next Events','my-calendar').' &raquo;</a>';
679
}
680
}
681
}
682
683
// Configure the "Previous" link in the calendar
684
- function prev_link($cur_year,$cur_month) {
685
$mod_rewrite_months = array(1=>'jan','feb','mar','apr','may','jun','jul','aug','sept','oct','nov','dec');
686
$last_year = $cur_year - 1;
687
688
$num_months = get_option('my_calendar_show_months');
689
if ($num_months <= 1) {
690
if ($cur_month == 1) {
691
- return '<a href="' . permalink_prefix() . 'month=dec&amp;yr='. $last_year .'" rel="nofollow">&laquo; '.__('Previous Events','my-calendar').'</a>';
692
} else {
693
$next_month = $cur_month - 1;
694
$month = $mod_rewrite_months[$next_month];
695
- return '<a href="' . permalink_prefix() . 'month='.$month.'&amp;yr=' . $cur_year . '" rel="nofollow">&laquo; '.__('Previous Events','my-calendar').'</a>';
696
}
697
} else {
698
if ($cur_month > $num_months) {
@@ -702,29 +711,29 @@ $num_months = get_option('my_calendar_show_months');
702
}
703
$month = $mod_rewrite_months[$next_month];
704
if ($cur_month <= $num_months) {
705
- return '<a href="' . permalink_prefix() . 'month='.$month.'&amp;yr=' . $last_year . '" rel="nofollow">&laquo; '.__('Previous Events','my-calendar').'</a>';
706
} else {
707
- return '<a href="' . permalink_prefix() . 'month='.$month.'&amp;yr=' . $cur_year . '" rel="nofollow">&laquo; '.__('Previous Events','my-calendar').'</a>';
708
}
709
}
710
}
711
712
// Used to draw multiple events
713
- function draw_events($events, $type) {
714
// We need to sort arrays of objects by time
715
- usort($events, "time_cmp");
716
foreach($events as $event) {
717
- $output .= draw_event($event, $type);
718
}
719
return $output;
720
}
721
722
// Used to draw an event to the screen
723
- function draw_event($event, $type="calendar") {
724
global $wpdb;
725
726
// My Calendar must be updated to run this function
727
- check_calendar();
728
729
$display_author = get_option('display_author');
730
$display_map = get_option('my_calendar_show_map');
@@ -816,10 +825,11 @@ $my_calendar_directory = get_bloginfo( 'wpurl' ) . '/' . PLUGINDIR . '/' . dirna
816
return $details;
817
}
818
// used to generate upcoming events lists
819
- function get_all_events() {
820
global $wpdb;
821
$events = $wpdb->get_results("SELECT * FROM " . MY_CALENDAR_TABLE);
822
- $date = date('Y').'-'.date('m').'-'.date('d');
823
if (!empty($events)) {
824
foreach($events as $event) {
825
if ($event->event_recur != "S") {
@@ -831,8 +841,8 @@ global $wpdb;
831
switch ($event->event_recur) {
832
case "D":
833
for ($i=$numback;$i<=$numforward;$i++) {
834
- $begin = add_date($orig_begin,$i,0,0);
835
- $end = add_date($orig_end,$i,0,0);
836
${$i} = clone $event;
837
${$i}->event_begin = $begin;
838
${$i}->event_end = $end;
@@ -841,8 +851,8 @@ global $wpdb;
841
break;
842
case "W":
843
for ($i=$numback;$i<=$numforward;$i++) {
844
- $begin = add_date($orig_begin,($i*7),0,0);
845
- $end = add_date($orig_end,($i*7),0,0);
846
${$i} = clone $event;
847
${$i}->event_begin = $begin;
848
${$i}->event_end = $end;
@@ -851,8 +861,8 @@ global $wpdb;
851
break;
852
case "M":
853
for ($i=$numback;$i<=$numforward;$i++) {
854
- $begin = add_date($orig_begin,0,$i,0);
855
- $end = add_date($orig_end,0,$i,0);
856
${$i} = clone $event;
857
${$i}->event_begin = $begin;
858
${$i}->event_end = $end;
@@ -861,8 +871,8 @@ global $wpdb;
861
break;
862
case "Y":
863
for ($i=$numback;$i<=$numforward;$i++) {
864
- $begin = add_date($orig_begin,0,0,$i);
865
- $end = add_date($orig_end,0,0,$i);
866
${$i} = clone $event;
867
${$i}->event_begin = $begin;
868
${$i}->event_end = $end;
@@ -874,11 +884,11 @@ global $wpdb;
874
switch ($event->event_recur) {
875
case "D":
876
$event_begin = $event->event_begin;
877
- $today = date('Y').'-'.date('m').'-'.date('d');
878
$nDays = get_option('display_past_events');
879
- $fDays = get_option('display_upcoming_events');
880
- if ( date_comp($event_begin, $today) ) { // compare first date against today's date
881
- if (date_comp( $event_begin, add_date($this_date,-($nDays),0,0) )) {
882
$diff = jd_date_diff_precise(strtotime($event_begin));
883
$diff_days = $diff/(86400);
884
$days = explode(".",$diff_days);
@@ -886,8 +896,8 @@ global $wpdb;
886
$realFinish = $days[0] + $fDays;
887
888
for ($realStart;$realStart<=$realFinish;$realStart++) { // jump forward to near present.
889
- $this_date = add_date($event_begin,($realStart),0,0);
890
- if ( date_comp( $event->event_begin,$this_date ) ) {
891
${$realStart} = clone $event;
892
${$realStart}->event_begin = $this_date;
893
$arr_events[] = ${$realStart};
@@ -897,8 +907,8 @@ global $wpdb;
897
} else {
898
$realDays = -($nDays);
899
for ($realDays;$realDays<=$fDays;$realDays++) { // for each event within plus or minus range, mod date and add to array.
900
- $this_date = add_date($event_begin,$realDays,0,0);
901
- if ( date_comp( $event->event_begin,$this_date ) == true ) {
902
${$realDays} = clone $event;
903
${$realDays}->event_begin = $this_date;
904
$arr_events[] = ${$realDays};
@@ -912,12 +922,12 @@ global $wpdb;
912
913
case "W":
914
$event_begin = $event->event_begin;
915
- $today = date('Y').'-'.date('m').'-'.date('d');
916
$nDays = get_option('display_past_events');
917
- $fDays = get_option('display_upcoming_events');
918
919
- if ( date_comp($event_begin, $today) ) { // compare first date against today's date
920
- if (date_comp( $event_begin, add_date($this_date,-($nDays*7),0,0) )) {
921
$diff = jd_date_diff_precise(strtotime($event_begin));
922
$diff_weeks = $diff/(86400*7);
923
$weeks = explode(".",$diff_weeks);
@@ -925,8 +935,8 @@ global $wpdb;
925
$realFinish = $weeks[0] + $fDays;
926
927
for ($realStart;$realStart<=$realFinish;$realStart++) { // jump forward to near present.
928
- $this_date = add_date($event_begin,($realStart*7),0,0);
929
- if ( date_comp( $event->event_begin,$this_date ) ) {
930
${$realStart} = clone $event;
931
${$realStart}->event_begin = $this_date;
932
$arr_events[] = ${$realStart};
@@ -936,8 +946,8 @@ global $wpdb;
936
} else {
937
$realDays = -($nDays);
938
for ($realDays;$realDays<=$fDays;$realDays++) { // for each event within plus or minus range, mod date and add to array.
939
- $this_date = add_date($event_begin,($realDays*7),0,0);
940
- if ( date_comp( $event->event_begin,$this_date ) ) {
941
${$realDays} = clone $event;
942
${$realDays}->event_begin = $this_date;
943
$arr_events[] = ${$realDays};
@@ -951,12 +961,12 @@ global $wpdb;
951
952
case "M":
953
$event_begin = $event->event_begin;
954
- $today = date('Y').'-'.date('m').'-'.date('d');
955
$nDays = get_option('display_past_events');
956
- $fDays = get_option('display_upcoming_events');
957
958
- if ( date_comp($event_begin, $today) ) { // compare first date against today's date
959
- if (date_comp( $event_begin, add_date($this_date,-($nDays),0,0) )) {
960
$diff = jd_date_diff_precise(strtotime($event_begin));
961
$diff_days = $diff/(86400*30);
962
$days = explode(".",$diff_days);
@@ -964,8 +974,8 @@ global $wpdb;
964
$realFinish = $days[0] + $fDays;
965
966
for ($realStart;$realStart<=$realFinish;$realStart++) { // jump forward to near present.
967
- $this_date = add_date($event_begin,0,$realStart,0);
968
- if ( date_comp( $event->event_begin,$this_date ) ) {
969
${$realStart} = clone $event;
970
${$realStart}->event_begin = $this_date;
971
$arr_events[] = ${$realStart};
@@ -975,8 +985,8 @@ global $wpdb;
975
} else {
976
$realDays = -($nDays);
977
for ($realDays;$realDays<=$fDays;$realDays++) { // for each event within plus or minus range, mod date and add to array.
978
- $this_date = add_date($event_begin,0,$realDays,0);
979
- if ( date_comp( $event->event_begin,$this_date ) == true ) {
980
${$realDays} = clone $event;
981
${$realDays}->event_begin = $this_date;
982
$arr_events[] = ${$realDays};
@@ -990,12 +1000,12 @@ global $wpdb;
990
991
case "Y":
992
$event_begin = $event->event_begin;
993
- $today = date('Y').'-'.date('m').'-'.date('d');
994
$nDays = get_option('display_past_events');
995
- $fDays = get_option('display_upcoming_events');
996
997
- if ( date_comp($event_begin, $today) ) { // compare first date against today's date
998
- if (date_comp( $event_begin, add_date($this_date,-($nDays),0,0) )) {
999
$diff = jd_date_diff_precise(strtotime($event_begin));
1000
$diff_days = $diff/(86400*365);
1001
$days = explode(".",$diff_days);
@@ -1003,8 +1013,8 @@ global $wpdb;
1003
$realFinish = $days[0] + $fDays;
1004
1005
for ($realStart;$realStart<=$realFinish;$realStart++) { // jump forward to near present.
1006
- $this_date = add_date($event_begin,0,0,$realStart);
1007
- if ( date_comp( $event->event_begin,$this_date ) ) {
1008
${$realStart} = clone $event;
1009
${$realStart}->event_begin = $this_date;
1010
$arr_events[] = ${$realStart};
@@ -1014,8 +1024,8 @@ global $wpdb;
1014
} else {
1015
$realDays = -($nDays);
1016
for ($realDays;$realDays<=$fDays;$realDays++) { // for each event within plus or minus range, mod date and add to array.
1017
- $this_date = add_date($event_begin,0,0,$realDays);
1018
- if ( date_comp( $event->event_begin,$this_date ) == true ) {
1019
${$realDays} = clone $event;
1020
${$realDays}->event_begin = $this_date;
1021
$arr_events[] = ${$realDays};
@@ -1036,7 +1046,7 @@ global $wpdb;
1036
return $arr_events;
1037
}
1038
// Grab all events for the requested date from calendar
1039
- function grab_events($y,$m,$d,$category=null) {
1040
global $wpdb;
1041
1042
if ( $category!=null ) {
@@ -1248,8 +1258,9 @@ function grab_events($y,$m,$d,$category=null) {
1248
return $arr_events;
1249
}
1250
1251
- function month_comparison($month) {
1252
- $current_month = strtolower(date("M", time()));
1253
if (isset($_GET['yr']) && isset($_GET['month'])) {
1254
if ($month == $_GET['month']) {
1255
return ' selected="selected"';
@@ -1258,8 +1269,10 @@ function month_comparison($month) {
1258
return ' selected="selected"';
1259
}
1260
}
1261
- function year_comparison($year) {
1262
- $current_year = strtolower(date("Y", time()));
1263
if (isset($_GET['yr']) && isset($_GET['month'])) {
1264
if ($year == $_GET['yr']) {
1265
return ' selected="selected"';
@@ -1268,7 +1281,7 @@ function year_comparison($year) {
1268
return ' selected="selected"';
1269
}
1270
}
1271
- function build_date_switcher() {
1272
$my_calendar_body = "";
1273
$my_calendar_body .= '<div class="my-calendar-date-switcher">
1274
<form method="get" action=""><div>';
@@ -1282,41 +1295,43 @@ function build_date_switcher() {
1282
// We build the months in the switcher
1283
$my_calendar_body .= '
1284
<label for="my-calendar-month">'.__('Month','my-calendar').':</label> <select id="my-calendar-month" name="month" style="width:100px;">
1285
- <option value="jan"'.month_comparison('jan').'>'.__('January','my-calendar').'</option>
1286
- <option value="feb"'.month_comparison('feb').'>'.__('February','my-calendar').'</option>
1287
- <option value="mar"'.month_comparison('mar').'>'.__('March','my-calendar').'</option>
1288
- <option value="apr"'.month_comparison('apr').'>'.__('April','my-calendar').'</option>
1289
- <option value="may"'.month_comparison('may').'>'.__('May','my-calendar').'</option>
1290
- <option value="jun"'.month_comparison('jun').'>'.__('June','my-calendar').'</option>
1291
- <option value="jul"'.month_comparison('jul').'>'.__('July','my-calendar').'</option>
1292
- <option value="aug"'.month_comparison('aug').'>'.__('August','my-calendar').'</option>
1293
- <option value="sept"'.month_comparison('sept').'>'.__('September','my-calendar').'</option>
1294
- <option value="oct"'.month_comparison('oct').'>'.__('October','my-calendar').'</option>
1295
- <option value="nov"'.month_comparison('nov').'>'.__('November','my-calendar').'</option>
1296
- <option value="dec"'.month_comparison('dec').'>'.__('December','my-calendar').'</option>
1297
</select>
1298
<label for="my-calendar-year">'.__('Year','my-calendar').':</label> <select id="my-calendar-year" name="yr">
1299
';
1300
// The year builder is string mania. If you can make sense of this, you know your PHP!
1301
- $past = 2;
1302
- $future = 2;
1303
$fut = 1;
1304
while ($past > 0) {
1305
$p .= ' <option value="';
1306
- $p .= date("Y",time())-$past;
1307
- $p .= '"'.year_comparison(date("Y",time())-$past).'>';
1308
- $p .= date("Y",time())-$past."</option>\n";
1309
$past = $past - 1;
1310
}
1311
while ($fut < $future) {
1312
$f .= ' <option value="';
1313
- $f .= date("Y",time())+$fut;
1314
- $f .= '"'.year_comparison(date("Y",time())+$fut).'>';
1315
- $f .= date("Y",time())+$fut."</option>\n";
1316
$fut = $fut + 1;
1317
}
1318
$my_calendar_body .= $p;
1319
- $my_calendar_body .= '<option value="'.date("Y",time()).'"'.year_comparison(date("Y",time())).'>'.date("Y",time())."</option>\n";
1320
$my_calendar_body .= $f;
1321
$my_calendar_body .= '</select> <input type="submit" value="'.__('Go','my-calendar').'" /></div>
1322
</form></div>';
@@ -1332,7 +1347,7 @@ function my_calendar($name,$format,$category,$showkey) {
1332
$category=null;
1333
}
1334
// First things first, make sure calendar is up to date
1335
- check_calendar();
1336
1337
// Deal with the week not starting on a monday
1338
if (get_option('start_of_week') == 0) {
@@ -1344,12 +1359,13 @@ function my_calendar($name,$format,$category,$showkey) {
1344
1345
// Carry on with the script
1346
$name_months = array(1=>__('January','my-calendar'),__('February','my-calendar'),__('March','my-calendar'),__('April','my-calendar'),__('May','my-calendar'),__('June','my-calendar'),__('July','my-calendar'),__('August','my-calendar'),__('September','my-calendar'),__('October','my-calendar'),__('November','my-calendar'),__('December','my-calendar'));
1347
1348
// If we don't pass arguments we want a calendar that is relevant to today