Version Description
(2013-02-24) =
- removed empty settings page (will be added again when settings are available)
- fixed view of details in admin event table
- fixed adding or modifying events with alternative date formats
- only set time format in output if a known time format was entered
Download this release
Release Info
Developer | mibuthu |
Plugin | Event List |
Version | 0.3.2 |
Comparing to | |
See all releases |
Code changes from version 0.3.1 to 0.3.2
- event-list.php +1 -1
- php/admin.php +12 -10
- php/admin_event_table.php +60 -52
- php/db.php +39 -6
- php/sc_event-list.php +6 -1
- readme.txt +12 -2
event-list.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Event List
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/event-list/
|
5 |
Description: Manage your events and show them in a list view on your site.
|
6 |
-
Version: 0.3.
|
7 |
Author: Michael Burtscher
|
8 |
Author URI: http://wordpress.org/extend/plugins/event-list/
|
9 |
License: GPLv2
|
3 |
Plugin Name: Event List
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/event-list/
|
5 |
Description: Manage your events and show them in a list view on your site.
|
6 |
+
Version: 0.3.2
|
7 |
Author: Michael Burtscher
|
8 |
Author URI: http://wordpress.org/extend/plugins/event-list/
|
9 |
License: GPLv2
|
php/admin.php
CHANGED
@@ -9,6 +9,7 @@ class el_admin {
|
|
9 |
private $db;
|
10 |
private $options;
|
11 |
private $shortcode;
|
|
|
12 |
private $event_action = false;
|
13 |
private $event_action_error = false;
|
14 |
|
@@ -16,6 +17,8 @@ class el_admin {
|
|
16 |
$this->db = el_db::get_instance();
|
17 |
//$this->options = &el_options::get_instance();
|
18 |
$this->shortcode = &sc_event_list::get_instance();
|
|
|
|
|
19 |
$this->event_action = null;
|
20 |
$this->event_action_error = null;
|
21 |
}
|
@@ -29,12 +32,12 @@ class el_admin {
|
|
29 |
add_action( 'admin_print_scripts-'.$page, array( &$this, 'embed_admin_main_scripts' ) );
|
30 |
$page = add_submenu_page( 'el_admin_main', 'Add New Event', 'Add New', 'edit_posts', 'el_admin_new', array( &$this, 'show_new' ) );
|
31 |
add_action( 'admin_print_scripts-'.$page, array( &$this, 'embed_admin_new_scripts' ) );
|
32 |
-
add_submenu_page( 'el_admin_main', 'Event List Settings', 'Settings', 'manage_options', 'el_admin_settings', array( &$this, 'show_settings' ) );
|
33 |
$page = add_submenu_page( 'el_admin_main', 'About Event List', 'About', 'edit_posts', 'el_admin_about', array( &$this, 'show_about' ) );
|
34 |
add_action( 'admin_print_scripts-'.$page, array( &$this, 'embed_admin_about_scripts' ) );
|
35 |
}
|
36 |
|
37 |
-
// show the main admin page
|
38 |
public function show_main() {
|
39 |
if ( !current_user_can( 'edit_posts' ) ) {
|
40 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
@@ -42,7 +45,7 @@ class el_admin {
|
|
42 |
$action = '';
|
43 |
// is there POST data an event was edited must be updated
|
44 |
if( !empty( $_POST ) ) {
|
45 |
-
$this->event_action_error = !$this->db->update_event( $_POST );
|
46 |
$this->event_action = isset( $_POST['id'] ) ? 'modified' : 'added';
|
47 |
}
|
48 |
// get action
|
@@ -96,7 +99,7 @@ class el_admin {
|
|
96 |
$out .= '</div>';
|
97 |
echo $out;
|
98 |
}
|
99 |
-
|
100 |
public function show_settings () {
|
101 |
if (!current_user_can('manage_options')) {
|
102 |
wp_die( __('You do not have sufficient permissions to access this page.') );
|
@@ -156,13 +159,13 @@ class el_admin {
|
|
156 |
ob_start();
|
157 |
submit_button();
|
158 |
$out .= ob_get_contents();
|
159 |
-
ob_end_clean()
|
160 |
$out .='
|
161 |
</form>
|
162 |
</div>';
|
163 |
echo $out;
|
164 |
}
|
165 |
-
|
166 |
public function show_about() {
|
167 |
$out = '<div class="wrap">
|
168 |
<div class="wrap nosubsub" style="padding-bottom:15px">
|
@@ -234,7 +237,6 @@ class el_admin {
|
|
234 |
}
|
235 |
|
236 |
private function edit_event() {
|
237 |
-
$date_format = __( 'Y/m/d' ); // similar date format than in list tables (e.g. post, pages, media)
|
238 |
$edit = false;
|
239 |
if( isset( $_GET['id'] ) && is_numeric( $_GET['id'] ) ) {
|
240 |
// existing event
|
@@ -254,7 +256,7 @@ class el_admin {
|
|
254 |
|
255 |
// Add required data for javascript in a hidden field
|
256 |
$json = json_encode( array( 'el_url' => EL_URL,
|
257 |
-
'el_date_format' => $this->datepicker_format( $
|
258 |
$out = "<input type='hidden' id='json_for_js' value='".$json."' />";
|
259 |
$out .= '<form method="POST" action="?page=el_admin_main">';
|
260 |
if( true === $edit ) {
|
@@ -267,8 +269,8 @@ class el_admin {
|
|
267 |
</tr>
|
268 |
<tr>
|
269 |
<th><label>Event Date (required)</label></th>
|
270 |
-
<td><input type="text" class="text datepicker form-required" name="start_date" id="start_date" value="'.date_i18n( $
|
271 |
-
<span id="end_date_area"> - <input type="text" class="text datepicker" name="end_date" id="end_date" value="'.date_i18n( $
|
272 |
<label><input type="checkbox" name="multiday" id="multiday" value="1" /> Multi-Day Event</label></td>
|
273 |
</tr>
|
274 |
<tr>
|
9 |
private $db;
|
10 |
private $options;
|
11 |
private $shortcode;
|
12 |
+
private $dateformat;
|
13 |
private $event_action = false;
|
14 |
private $event_action_error = false;
|
15 |
|
17 |
$this->db = el_db::get_instance();
|
18 |
//$this->options = &el_options::get_instance();
|
19 |
$this->shortcode = &sc_event_list::get_instance();
|
20 |
+
$this->dateformat = __( 'Y/m/d' ); // similar date format than in list tables (e.g. post, pages, media)
|
21 |
+
// $this->dateformat = 'd/m/Y'; // for debugging only
|
22 |
$this->event_action = null;
|
23 |
$this->event_action_error = null;
|
24 |
}
|
32 |
add_action( 'admin_print_scripts-'.$page, array( &$this, 'embed_admin_main_scripts' ) );
|
33 |
$page = add_submenu_page( 'el_admin_main', 'Add New Event', 'Add New', 'edit_posts', 'el_admin_new', array( &$this, 'show_new' ) );
|
34 |
add_action( 'admin_print_scripts-'.$page, array( &$this, 'embed_admin_new_scripts' ) );
|
35 |
+
//add_submenu_page( 'el_admin_main', 'Event List Settings', 'Settings', 'manage_options', 'el_admin_settings', array( &$this, 'show_settings' ) );
|
36 |
$page = add_submenu_page( 'el_admin_main', 'About Event List', 'About', 'edit_posts', 'el_admin_about', array( &$this, 'show_about' ) );
|
37 |
add_action( 'admin_print_scripts-'.$page, array( &$this, 'embed_admin_about_scripts' ) );
|
38 |
}
|
39 |
|
40 |
+
// show the main admin page
|
41 |
public function show_main() {
|
42 |
if ( !current_user_can( 'edit_posts' ) ) {
|
43 |
wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
|
45 |
$action = '';
|
46 |
// is there POST data an event was edited must be updated
|
47 |
if( !empty( $_POST ) ) {
|
48 |
+
$this->event_action_error = !$this->db->update_event( $_POST, $this->dateformat );
|
49 |
$this->event_action = isset( $_POST['id'] ) ? 'modified' : 'added';
|
50 |
}
|
51 |
// get action
|
99 |
$out .= '</div>';
|
100 |
echo $out;
|
101 |
}
|
102 |
+
/*
|
103 |
public function show_settings () {
|
104 |
if (!current_user_can('manage_options')) {
|
105 |
wp_die( __('You do not have sufficient permissions to access this page.') );
|
159 |
ob_start();
|
160 |
submit_button();
|
161 |
$out .= ob_get_contents();
|
162 |
+
ob_end_clean();
|
163 |
$out .='
|
164 |
</form>
|
165 |
</div>';
|
166 |
echo $out;
|
167 |
}
|
168 |
+
*/
|
169 |
public function show_about() {
|
170 |
$out = '<div class="wrap">
|
171 |
<div class="wrap nosubsub" style="padding-bottom:15px">
|
237 |
}
|
238 |
|
239 |
private function edit_event() {
|
|
|
240 |
$edit = false;
|
241 |
if( isset( $_GET['id'] ) && is_numeric( $_GET['id'] ) ) {
|
242 |
// existing event
|
256 |
|
257 |
// Add required data for javascript in a hidden field
|
258 |
$json = json_encode( array( 'el_url' => EL_URL,
|
259 |
+
'el_date_format' => $this->datepicker_format( $this->dateformat ) ) );
|
260 |
$out = "<input type='hidden' id='json_for_js' value='".$json."' />";
|
261 |
$out .= '<form method="POST" action="?page=el_admin_main">';
|
262 |
if( true === $edit ) {
|
269 |
</tr>
|
270 |
<tr>
|
271 |
<th><label>Event Date (required)</label></th>
|
272 |
+
<td><input type="text" class="text datepicker form-required" name="start_date" id="start_date" value="'.date_i18n( $this->dateformat, $start_date ).'" />
|
273 |
+
<span id="end_date_area"> - <input type="text" class="text datepicker" name="end_date" id="end_date" value="'.date_i18n( $this->dateformat, $end_date ).'" /></span>
|
274 |
<label><input type="checkbox" name="multiday" id="multiday" value="1" /> Multi-Day Event</label></td>
|
275 |
</tr>
|
276 |
<tr>
|
php/admin_event_table.php
CHANGED
@@ -32,7 +32,7 @@ class Admin_Event_Table extends WP_List_Table {
|
|
32 |
case 'date' :
|
33 |
return $this->format_event_date( $item->start_date, $item->end_date, $item->time );
|
34 |
case 'details' :
|
35 |
-
return '<div
|
36 |
case 'pub_user' :
|
37 |
return get_userdata( $item->pub_user )->user_login;
|
38 |
case 'pub_date' :
|
@@ -239,8 +239,13 @@ class Admin_Event_Table extends WP_List_Table {
|
|
239 |
}
|
240 |
// event time
|
241 |
if( '' !== $start_time ) {
|
|
|
|
|
|
|
|
|
|
|
242 |
$out .= '<br />
|
243 |
-
<span class="time">'
|
244 |
}
|
245 |
return $out;
|
246 |
}
|
@@ -264,64 +269,67 @@ class Admin_Event_Table extends WP_List_Table {
|
|
264 |
* Function to truncate and shorten text
|
265 |
*
|
266 |
* @param int $max_length The length to which the text should be shortened
|
267 |
-
* @param string $
|
268 |
***************************************************************************/
|
269 |
-
private static function truncate( $max_length, $
|
270 |
-
$
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
$
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
$out .= $str;
|
284 |
-
$printedLength += strlen($str);
|
285 |
-
if ($tag[0] == '&') {
|
286 |
-
// Handle the entity.
|
287 |
-
$out .= $tag;
|
288 |
-
$printedLength++;
|
289 |
-
}
|
290 |
-
else {
|
291 |
-
// Handle the tag.
|
292 |
-
$tagName = $match[1][0];
|
293 |
-
if ($tag[1] == '/')
|
294 |
-
{
|
295 |
-
// This is a closing tag.
|
296 |
-
$openingTag = array_pop($tags);
|
297 |
-
assert($openingTag == $tagName); // check that tags are properly nested.
|
298 |
-
$out .= $tag;
|
299 |
}
|
300 |
-
|
301 |
-
|
|
|
|
|
302 |
$out .= $tag;
|
|
|
303 |
}
|
304 |
else {
|
305 |
-
//
|
306 |
-
$
|
307 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
308 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
}
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
if ($printedLength < $max_length && $position < strlen($text)) {
|
315 |
-
$out .= substr($text, $position, $max_length - $printedLength);
|
316 |
-
}
|
317 |
-
if ($max_length < strlen($text)) {
|
318 |
-
$out .= "...";
|
319 |
-
}
|
320 |
-
// Close any open tags.
|
321 |
-
while (!empty($tags)) {
|
322 |
-
$out .= "</" . array_pop($tags) . ">";
|
323 |
}
|
324 |
-
return $out;
|
325 |
}
|
326 |
}
|
327 |
|
32 |
case 'date' :
|
33 |
return $this->format_event_date( $item->start_date, $item->end_date, $item->time );
|
34 |
case 'details' :
|
35 |
+
return '<div>'.$this->truncate( 80, $item->details ).'</div>';
|
36 |
case 'pub_user' :
|
37 |
return get_userdata( $item->pub_user )->user_login;
|
38 |
case 'pub_date' :
|
239 |
}
|
240 |
// event time
|
241 |
if( '' !== $start_time ) {
|
242 |
+
// set time format if a known format is available, else only show the text
|
243 |
+
$date_array = date_parse( $start_time );
|
244 |
+
if( empty( $date_array['errors']) && is_numeric( $date_array['hour'] ) && is_numeric( $date_array['minute'] ) ) {
|
245 |
+
$start_time = mysql2date( get_option( 'time_format' ), $start_time );
|
246 |
+
}
|
247 |
$out .= '<br />
|
248 |
+
<span class="time">'.$start_time.'</span></span>';
|
249 |
}
|
250 |
return $out;
|
251 |
}
|
269 |
* Function to truncate and shorten text
|
270 |
*
|
271 |
* @param int $max_length The length to which the text should be shortened
|
272 |
+
* @param string $html The html code which should be shortened
|
273 |
***************************************************************************/
|
274 |
+
private static function truncate( $max_length, $html ) {
|
275 |
+
if( strlen( $html ) > $max_length ) {
|
276 |
+
$printedLength = 0;
|
277 |
+
$position = 0;
|
278 |
+
$tags = array();
|
279 |
+
$out = '';
|
280 |
+
while ($printedLength < $max_length && preg_match('{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position)) {
|
281 |
+
list($tag, $tagPosition) = $match[0];
|
282 |
+
// Print text leading up to the tag
|
283 |
+
$str = substr($html, $position, $tagPosition - $position);
|
284 |
+
if ($printedLength + strlen($str) > $max_length) {
|
285 |
+
$out .= substr($str, 0, $max_length - $printedLength);
|
286 |
+
$printedLength = $max_length;
|
287 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
}
|
289 |
+
$out .= $str;
|
290 |
+
$printedLength += strlen($str);
|
291 |
+
if ($tag[0] == '&') {
|
292 |
+
// Handle the entity
|
293 |
$out .= $tag;
|
294 |
+
$printedLength++;
|
295 |
}
|
296 |
else {
|
297 |
+
// Handle the tag
|
298 |
+
$tagName = $match[1][0];
|
299 |
+
if ($tag[1] == '/')
|
300 |
+
{
|
301 |
+
// This is a closing tag
|
302 |
+
$openingTag = array_pop($tags);
|
303 |
+
assert($openingTag == $tagName); // check that tags are properly nested
|
304 |
+
$out .= $tag;
|
305 |
+
}
|
306 |
+
else if ($tag[strlen($tag) - 2] == '/') {
|
307 |
+
// Self-closing tag
|
308 |
+
$out .= $tag;
|
309 |
+
}
|
310 |
+
else {
|
311 |
+
// Opening tag
|
312 |
+
$out .= $tag;
|
313 |
+
$tags[] = $tagName;
|
314 |
+
}
|
315 |
}
|
316 |
+
// Continue after the tag
|
317 |
+
$position = $tagPosition + strlen($tag);
|
318 |
+
}
|
319 |
+
// Print any remaining text
|
320 |
+
if ($printedLength < $max_length && $position < strlen($html)) {
|
321 |
+
$out .= substr($html, $position, $max_length - $printedLength);
|
322 |
+
}
|
323 |
+
$out .= '...';
|
324 |
+
// Close any open tags.
|
325 |
+
while (!empty($tags)) {
|
326 |
+
$out .= '</'.array_pop($tags).'>';
|
327 |
}
|
328 |
+
return $out;
|
329 |
+
}
|
330 |
+
else {
|
331 |
+
return $html;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
332 |
}
|
|
|
333 |
}
|
334 |
}
|
335 |
|
php/db.php
CHANGED
@@ -103,7 +103,7 @@ class el_db {
|
|
103 |
return $date;
|
104 |
}
|
105 |
|
106 |
-
public function update_event( $event_data ) {
|
107 |
global $wpdb;
|
108 |
// prepare and validate sqldata
|
109 |
$sqldata = array();
|
@@ -114,13 +114,13 @@ class el_db {
|
|
114 |
//start_date
|
115 |
if( !isset( $event_data['start_date']) ) { return false; }
|
116 |
$start_timestamp = 0;
|
117 |
-
$sqldata['start_date'] = $this->extract_date( $event_data['start_date'], "Y-m-d", $start_timestamp );
|
118 |
if( false === $sqldata['start_date'] ) { return false; }
|
119 |
//end_date
|
120 |
if( !isset( $event_data['end_date']) ) { return false; }
|
121 |
if( isset( $event_data['multiday'] ) && "1" === $event_data['multiday'] ) {
|
122 |
$end_timestamp = 0;
|
123 |
-
$sqldata['end_date'] = $this->extract_date( $event_data['end_date'], "Y-m-d", $end_timestamp );
|
124 |
if( false === $sqldata['end_date'] ) { $sqldata['end_date'] = $sqldata['start_date']; }
|
125 |
elseif( $end_timestamp < $start_timestamp ) { $sqldata['end_date'] = $sqldata['start_date']; }
|
126 |
}
|
@@ -154,7 +154,7 @@ class el_db {
|
|
154 |
public function delete_events( $event_ids ) {
|
155 |
global $wpdb;
|
156 |
// sql query
|
157 |
-
$num_deleted = (int) $wpdb->query( $wpdb->prepare( 'DELETE FROM
|
158 |
if( $num_deleted == count( explode( ',', $event_ids ) ) ) {
|
159 |
return true;
|
160 |
}
|
@@ -163,8 +163,20 @@ class el_db {
|
|
163 |
}
|
164 |
}
|
165 |
|
166 |
-
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
if( !empty( $date_array['errors']) ) {
|
169 |
return false;
|
170 |
}
|
@@ -180,5 +192,26 @@ class el_db {
|
|
180 |
}
|
181 |
return date( $ret_format, $timestamp );
|
182 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
}
|
184 |
?>
|
103 |
return $date;
|
104 |
}
|
105 |
|
106 |
+
public function update_event( $event_data, $dateformat=NULL ) {
|
107 |
global $wpdb;
|
108 |
// prepare and validate sqldata
|
109 |
$sqldata = array();
|
114 |
//start_date
|
115 |
if( !isset( $event_data['start_date']) ) { return false; }
|
116 |
$start_timestamp = 0;
|
117 |
+
$sqldata['start_date'] = $this->extract_date( $event_data['start_date'], "Y-m-d", $dateformat, $start_timestamp );
|
118 |
if( false === $sqldata['start_date'] ) { return false; }
|
119 |
//end_date
|
120 |
if( !isset( $event_data['end_date']) ) { return false; }
|
121 |
if( isset( $event_data['multiday'] ) && "1" === $event_data['multiday'] ) {
|
122 |
$end_timestamp = 0;
|
123 |
+
$sqldata['end_date'] = $this->extract_date( $event_data['end_date'], "Y-m-d", $dateformat, $end_timestamp );
|
124 |
if( false === $sqldata['end_date'] ) { $sqldata['end_date'] = $sqldata['start_date']; }
|
125 |
elseif( $end_timestamp < $start_timestamp ) { $sqldata['end_date'] = $sqldata['start_date']; }
|
126 |
}
|
154 |
public function delete_events( $event_ids ) {
|
155 |
global $wpdb;
|
156 |
// sql query
|
157 |
+
$num_deleted = (int) $wpdb->query( $wpdb->prepare( 'DELETE FROM %s WHERE id IN (%s)', $this->table, $event_ids ) );
|
158 |
if( $num_deleted == count( explode( ',', $event_ids ) ) ) {
|
159 |
return true;
|
160 |
}
|
163 |
}
|
164 |
}
|
165 |
|
166 |
+
private function extract_date( $datestring, $ret_format, $dateformat=NULL, &$ret_timestamp=NULL, &$ret_datearray=NULL ) {
|
167 |
+
if( NULL === $dateformat ) {
|
168 |
+
$date_array = date_parse( $datestring );
|
169 |
+
}
|
170 |
+
else {
|
171 |
+
if( function_exists( 'date_parse_from_format' ) ) {
|
172 |
+
// for php version >= 5.3.0
|
173 |
+
$date_array = date_parse_from_format( $dateformat, $datestring );
|
174 |
+
}
|
175 |
+
else {
|
176 |
+
// for older php versions
|
177 |
+
$date_array = $this->date_parse_from_format( $dateformat, $datestring );
|
178 |
+
}
|
179 |
+
}
|
180 |
if( !empty( $date_array['errors']) ) {
|
181 |
return false;
|
182 |
}
|
192 |
}
|
193 |
return date( $ret_format, $timestamp );
|
194 |
}
|
195 |
+
|
196 |
+
/*
|
197 |
+
* date_parse_from_format function is only required for php versions < 5.3.0
|
198 |
+
* see http://php.net/manual/en/function.date-parse-from-format.php for details
|
199 |
+
*/
|
200 |
+
private function date_parse_from_format( string $format, string $date ) {
|
201 |
+
$dMask = array(
|
202 |
+
'H'=>'hour',
|
203 |
+
'i'=>'minute',
|
204 |
+
's'=>'second',
|
205 |
+
'y'=>'year',
|
206 |
+
'm'=>'month',
|
207 |
+
'd'=>'day'
|
208 |
+
);
|
209 |
+
$format = preg_split('//', $format, -1, PREG_SPLIT_NO_EMPTY);
|
210 |
+
$date = preg_split('//', $date, -1, PREG_SPLIT_NO_EMPTY);
|
211 |
+
foreach ($date as $k => $v) {
|
212 |
+
if ($dMask[$format[$k]]) $dt[$dMask[$format[$k]]] .= $v;
|
213 |
+
}
|
214 |
+
return $dt;
|
215 |
+
}
|
216 |
}
|
217 |
?>
|
php/sc_event-list.php
CHANGED
@@ -199,7 +199,12 @@ class sc_event_list {
|
|
199 |
}
|
200 |
$out .= '</h3>';
|
201 |
if( $event->time != '' ) {
|
202 |
-
|
|
|
|
|
|
|
|
|
|
|
203 |
}
|
204 |
if( null === $a || 0 != $a['show_location'] ) {
|
205 |
$out .= '<span class="event-location">'.$event->location.'</span>';
|
199 |
}
|
200 |
$out .= '</h3>';
|
201 |
if( $event->time != '' ) {
|
202 |
+
// set time format if a known format is available, else only show the text
|
203 |
+
$date_array = date_parse( $event->time );
|
204 |
+
if( empty( $date_array['errors']) && is_numeric( $date_array['hour'] ) && is_numeric( $date_array['minute'] ) ) {
|
205 |
+
$event->time = mysql2date( get_option( 'time_format' ), $event->time );
|
206 |
+
}
|
207 |
+
$out .= '<span class="event-time">'.$event->time.'</span>';
|
208 |
}
|
209 |
if( null === $a || 0 != $a['show_location'] ) {
|
210 |
$out .= '<span class="event-location">'.$event->location.'</span>';
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: mibuthu
|
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W54LNZMWF9KW2
|
4 |
Tags: event, events, list, listview, calendar, schedule, shortcode, page, category, categories, admin, attribute, widget, sidebar
|
5 |
Requires at least: 3.3
|
6 |
-
Tested up to: 3.5
|
7 |
-
Stable tag: 0.3.
|
8 |
Plugin URI: http://wordpress.org/extend/plugins/event-list
|
9 |
Licence: GPLv2
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -48,6 +48,9 @@ Insert the shortcode [event-list] in your page.
|
|
48 |
= How do I use styled text and images in the event descriptions? =
|
49 |
Event List uses the built-in Wordpress WYSIWYG editor. It's exactly the same process you use when creating Posts or Pages.
|
50 |
|
|
|
|
|
|
|
51 |
|
52 |
== Screenshots ==
|
53 |
|
@@ -60,6 +63,13 @@ Event List uses the built-in Wordpress WYSIWYG editor. It's exactly the same pro
|
|
60 |
|
61 |
== Changelog ==
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
= 0.3.1 (2013-01-03) =
|
64 |
|
65 |
* added widget option "show_location"
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W54LNZMWF9KW2
|
4 |
Tags: event, events, list, listview, calendar, schedule, shortcode, page, category, categories, admin, attribute, widget, sidebar
|
5 |
Requires at least: 3.3
|
6 |
+
Tested up to: 3.5.1
|
7 |
+
Stable tag: 0.3.2
|
8 |
Plugin URI: http://wordpress.org/extend/plugins/event-list
|
9 |
Licence: GPLv2
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
48 |
= How do I use styled text and images in the event descriptions? =
|
49 |
Event List uses the built-in Wordpress WYSIWYG editor. It's exactly the same process you use when creating Posts or Pages.
|
50 |
|
51 |
+
= Can I call the shortcode directly via php e.g. for my own template, theme or plugin? =
|
52 |
+
Yes, you can create an instance of the "sc_event_list" class which located in "php/sc_event-list.php" in the plugin folder and call the function show_html($atts).With $atts you can specify all the shortcode attributes you require. Another possibility would be to call the wordpress function "do_shortcode()".
|
53 |
+
|
54 |
|
55 |
== Screenshots ==
|
56 |
|
63 |
|
64 |
== Changelog ==
|
65 |
|
66 |
+
= 0.3.2 (2013-02-24) =
|
67 |
+
|
68 |
+
* removed empty settings page (will be added again when settings are available)
|
69 |
+
* fixed view of details in admin event table
|
70 |
+
* fixed adding or modifying events with alternative date formats
|
71 |
+
* only set time format in output if a known time format was entered
|
72 |
+
|
73 |
= 0.3.1 (2013-01-03) =
|
74 |
|
75 |
* added widget option "show_location"
|