Version Description
(2014-06-18) = * added month and day support in date_filter * added available date and date range formats description in admin about page * added support for wpautop in event details * added "Past" entry in admin event table filter
Download this release
Release Info
Developer | mibuthu |
Plugin | Event List |
Version | 0.6.7 |
Comparing to | |
See all releases |
Code changes from version 0.6.6 to 0.6.7
- admin/css/admin_about.css +27 -1
- admin/includes/admin-about.php +34 -6
- admin/includes/admin-main.php +0 -7
- admin/includes/admin-new.php +1 -5
- admin/includes/event_table.php +3 -3
- admin/js/admin_new.js +0 -3
- event-list.php +1 -1
- includes/db.php +52 -16
- includes/options.php +48 -0
- includes/sc_event-list.php +3 -2
- readme.txt +7 -1
admin/css/admin_about.css
CHANGED
@@ -3,7 +3,9 @@
|
|
3 |
}
|
4 |
|
5 |
.el-headline {
|
6 |
-
margin-top:
|
|
|
|
|
7 |
}
|
8 |
|
9 |
.el-atts-table {
|
@@ -53,3 +55,27 @@
|
|
53 |
.el-filterbar-desc2, .el-filterbar-for {
|
54 |
width: 270px;
|
55 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
}
|
4 |
|
5 |
.el-headline {
|
6 |
+
margin-top: 1.5em;
|
7 |
+
margin-bottom: 0.5em;
|
8 |
+
clear: both;
|
9 |
}
|
10 |
|
11 |
.el-atts-table {
|
55 |
.el-filterbar-desc2, .el-filterbar-for {
|
56 |
width: 270px;
|
57 |
}
|
58 |
+
|
59 |
+
ul.el-formats {
|
60 |
+
list-style: none;
|
61 |
+
}
|
62 |
+
|
63 |
+
.el-format-entry {
|
64 |
+
overflow: hidden;
|
65 |
+
clear: both;
|
66 |
+
padding-bottom: 0.5em;
|
67 |
+
}
|
68 |
+
|
69 |
+
div.el-format-name {
|
70 |
+
float: left;
|
71 |
+
width: 90px;
|
72 |
+
font-weight: bold;
|
73 |
+
}
|
74 |
+
|
75 |
+
div.el-format-desc {
|
76 |
+
float: left;
|
77 |
+
}
|
78 |
+
|
79 |
+
div.el-format-desc em {
|
80 |
+
font-weight: bold;
|
81 |
+
}
|
admin/includes/admin-about.php
CHANGED
@@ -6,6 +6,7 @@ if(!defined('ABSPATH')) {
|
|
6 |
// This class handles all data for the admin about page
|
7 |
class EL_Admin_About {
|
8 |
private static $instance;
|
|
|
9 |
|
10 |
public static function &get_instance() {
|
11 |
// Create class instance if required
|
@@ -17,7 +18,7 @@ class EL_Admin_About {
|
|
17 |
}
|
18 |
|
19 |
private function __construct() {
|
20 |
-
|
21 |
}
|
22 |
|
23 |
public function show_about() {
|
@@ -26,7 +27,7 @@ class EL_Admin_About {
|
|
26 |
}
|
27 |
echo '<div class="wrap">
|
28 |
<div id="icon-edit-pages" class="icon32"><br /></div><h2>About Event List</h2>
|
29 |
-
<h3>Help and Instructions</h3>
|
30 |
<p>You can manage your events <a href="admin.php?page=el_admin_main">here</a>.</p>
|
31 |
<p>To show the events on your site you have two possibilities:
|
32 |
<ul class="el-show-event-options"><li>you can place the <strong>shortcode</strong> <code>[event-list]</code> on any page or post</li>
|
@@ -94,8 +95,8 @@ class EL_Admin_About {
|
|
94 |
|
95 |
private function show_filter_syntax() {
|
96 |
return '
|
97 |
-
<h3>'.__('Filter Syntax').'</h3>
|
98 |
-
<p>'.__('For date and cat filters you can specify complex filters with the following syntax
|
99 |
<p>'.__('You can use AND ( "<b>&</b>" ) and OR ( "<b>|</b>" or "<b>,</b>" ) connections to define complex filters. Additionally you can set brackets ( "<b>(</b>" and ("<b>)</b>" ) for nested queries.').'</p>
|
100 |
'.__('Examples for cat filters:').'
|
101 |
<p><code>tennis</code> ... '.__('Show all events with category "tennis".').'<br />
|
@@ -104,11 +105,38 @@ class EL_Admin_About {
|
|
104 |
}
|
105 |
|
106 |
private function show_date_syntax() {
|
107 |
-
return '
|
|
|
|
|
|
|
|
|
|
|
108 |
}
|
109 |
|
110 |
private function show_daterange_syntax() {
|
111 |
-
return '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
}
|
113 |
}
|
114 |
?>
|
6 |
// This class handles all data for the admin about page
|
7 |
class EL_Admin_About {
|
8 |
private static $instance;
|
9 |
+
private $options;
|
10 |
|
11 |
public static function &get_instance() {
|
12 |
// Create class instance if required
|
18 |
}
|
19 |
|
20 |
private function __construct() {
|
21 |
+
$this->options = EL_Options::get_instance();
|
22 |
}
|
23 |
|
24 |
public function show_about() {
|
27 |
}
|
28 |
echo '<div class="wrap">
|
29 |
<div id="icon-edit-pages" class="icon32"><br /></div><h2>About Event List</h2>
|
30 |
+
<h3 class="el-headline">Help and Instructions</h3>
|
31 |
<p>You can manage your events <a href="admin.php?page=el_admin_main">here</a>.</p>
|
32 |
<p>To show the events on your site you have two possibilities:
|
33 |
<ul class="el-show-event-options"><li>you can place the <strong>shortcode</strong> <code>[event-list]</code> on any page or post</li>
|
95 |
|
96 |
private function show_filter_syntax() {
|
97 |
return '
|
98 |
+
<h3 class="el-headline">'.__('Filter Syntax').'</h3>
|
99 |
+
<p>'.__('For date and cat filters you can specify complex filters with the following syntax:').'</p>
|
100 |
<p>'.__('You can use AND ( "<b>&</b>" ) and OR ( "<b>|</b>" or "<b>,</b>" ) connections to define complex filters. Additionally you can set brackets ( "<b>(</b>" and ("<b>)</b>" ) for nested queries.').'</p>
|
101 |
'.__('Examples for cat filters:').'
|
102 |
<p><code>tennis</code> ... '.__('Show all events with category "tennis".').'<br />
|
105 |
}
|
106 |
|
107 |
private function show_date_syntax() {
|
108 |
+
return '
|
109 |
+
<h3 class="el-headline">'.__('Available Date Formats').'</h3>
|
110 |
+
<p>'.__('For date filters you can use the following date formats:').'</p>
|
111 |
+
<ul class="el-formats">
|
112 |
+
'.$this->show_formats($this->options->date_formats).'
|
113 |
+
</ul>';
|
114 |
}
|
115 |
|
116 |
private function show_daterange_syntax() {
|
117 |
+
return '
|
118 |
+
<h3 class="el-headline">'.__('Available Date Range Formats').'</h3>
|
119 |
+
<p>'.__('For date filters you can use the following daterange formats:').'</p>
|
120 |
+
<ul class="el-formats">
|
121 |
+
'.$this->show_formats($this->options->daterange_formats).'
|
122 |
+
</ul>';
|
123 |
+
}
|
124 |
+
|
125 |
+
private function show_formats(&$formats_array) {
|
126 |
+
$out = '';
|
127 |
+
foreach($formats_array as $format) {
|
128 |
+
$out .= '
|
129 |
+
<li><div class="el-format-entry"><div class="el-format-name">'.$format['name'].':</div><div class="el-format-desc">';
|
130 |
+
if(isset($format['value'])) {
|
131 |
+
$out .= __('Value').': <em>'.$format['value'].'</em><br />';
|
132 |
+
}
|
133 |
+
$out .= $format['desc'].'<br />';
|
134 |
+
if(isset($format['examp'])) {
|
135 |
+
$out .= __('Example').': <em>'.$format['examp'].'</em>';
|
136 |
+
}
|
137 |
+
$out .= '</div></div></li>';
|
138 |
+
}
|
139 |
+
return $out;
|
140 |
}
|
141 |
}
|
142 |
?>
|
admin/includes/admin-main.php
CHANGED
@@ -29,13 +29,6 @@ class EL_Admin_Main {
|
|
29 |
$this->filterbar = &EL_Filterbar::get_instance();
|
30 |
$this->event_table = new EL_Event_Table();
|
31 |
$this->action = $this->event_table->current_action();
|
32 |
-
error_log("Action: ".$this->action);
|
33 |
-
foreach($_GET as $key => $value) {
|
34 |
-
error_log('GET value "'.$key.'": '.$value);
|
35 |
-
}
|
36 |
-
foreach($_POST as $key => $value) {
|
37 |
-
error_log('POST value "'.$key.'": '.$value);
|
38 |
-
}
|
39 |
// check for real actions
|
40 |
if($this->action) {
|
41 |
switch($this->action) {
|
29 |
$this->filterbar = &EL_Filterbar::get_instance();
|
30 |
$this->event_table = new EL_Event_Table();
|
31 |
$this->action = $this->event_table->current_action();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
// check for real actions
|
33 |
if($this->action) {
|
34 |
switch($this->action) {
|
admin/includes/admin-new.php
CHANGED
@@ -99,9 +99,6 @@ class EL_Admin_New {
|
|
99 |
<td><input type="text" class="text datepicker form-required" name="start_date" id="start_date" value="'.date('Y-m-d', $start_date).'" />
|
100 |
<span id="end_date_area"> - <input type="text" class="text datepicker" name="end_date" id="end_date" value="'.date('Y-m-d', $end_date).'" /></span>
|
101 |
<label><input type="checkbox" name="multiday" id="multiday" value="1" /> Multi-Day Event</label>
|
102 |
-
TestText: <input type="text" name="test_text" id="test_text" value ="" />
|
103 |
-
TestDate1: <input type="text" name="test_date1" id="test_date1" value ="" />
|
104 |
-
TestDate2: <input type="text" name="test_date2" id="test_date2" value ="" />
|
105 |
<input type="hidden" id="sql_start_date" name="sql_start_date" value="" />
|
106 |
<input type="hidden" id="sql_end_date" name="sql_end_date" value="" />
|
107 |
</td>
|
@@ -117,8 +114,7 @@ class EL_Admin_New {
|
|
117 |
<tr>
|
118 |
<th><label>Event Details</label></th>
|
119 |
<td>';
|
120 |
-
$editor_settings = array('
|
121 |
-
'wpautop' => false,
|
122 |
'textarea_rows' => 20);
|
123 |
ob_start();
|
124 |
wp_editor(isset($event->details) ? $event->details : '', 'details', $editor_settings);
|
99 |
<td><input type="text" class="text datepicker form-required" name="start_date" id="start_date" value="'.date('Y-m-d', $start_date).'" />
|
100 |
<span id="end_date_area"> - <input type="text" class="text datepicker" name="end_date" id="end_date" value="'.date('Y-m-d', $end_date).'" /></span>
|
101 |
<label><input type="checkbox" name="multiday" id="multiday" value="1" /> Multi-Day Event</label>
|
|
|
|
|
|
|
102 |
<input type="hidden" id="sql_start_date" name="sql_start_date" value="" />
|
103 |
<input type="hidden" id="sql_end_date" name="sql_end_date" value="" />
|
104 |
</td>
|
114 |
<tr>
|
115 |
<th><label>Event Details</label></th>
|
116 |
<td>';
|
117 |
+
$editor_settings = array('drag_drop_upload' => true,
|
|
|
118 |
'textarea_rows' => 20);
|
119 |
ob_start();
|
120 |
wp_editor(isset($event->details) ? $event->details : '', 'details', $editor_settings);
|
admin/includes/event_table.php
CHANGED
@@ -45,7 +45,7 @@ class EL_Event_Table extends WP_List_Table {
|
|
45 |
case 'date' :
|
46 |
return $this->format_event_date($item->start_date, $item->end_date, $item->time);
|
47 |
case 'details' :
|
48 |
-
return '<div>'.$this->db->truncate($item->details, 80).'</div>';
|
49 |
case 'pub_user' :
|
50 |
return get_userdata($item->pub_user)->user_login;
|
51 |
case 'pub_date' :
|
@@ -167,7 +167,7 @@ class EL_Event_Table extends WP_List_Table {
|
|
167 |
if('top' === $which) {
|
168 |
$out = '
|
169 |
<div class="alignleft actions">';
|
170 |
-
$out .= $this->filterbar->show_years('?page=el_admin_main', $this->args, 'dropdown', 'admin');
|
171 |
$out .= $this->filterbar->show_cats('?page=el_admin_main', $this->args, 'dropdown', 'admin');
|
172 |
$out .= '
|
173 |
<input type="hidden" name="noheader" value="true" />
|
@@ -218,7 +218,7 @@ class EL_Event_Table extends WP_List_Table {
|
|
218 |
$this->args['cat_filter'] = 'all';
|
219 |
// actual_date
|
220 |
$this->args['actual_date'] = 'upcoming';
|
221 |
-
if(isset($_GET['date']) && (is_numeric($_GET['date']) || 'all' == $_GET['date'] || 'upcoming' == $_GET['date'])) {
|
222 |
$this->args['actual_date'] = $_GET['date'];
|
223 |
}
|
224 |
// actual_cat
|
45 |
case 'date' :
|
46 |
return $this->format_event_date($item->start_date, $item->end_date, $item->time);
|
47 |
case 'details' :
|
48 |
+
return '<div>'.$this->db->truncate(wpautop($item->details), 80).'</div>';
|
49 |
case 'pub_user' :
|
50 |
return get_userdata($item->pub_user)->user_login;
|
51 |
case 'pub_date' :
|
167 |
if('top' === $which) {
|
168 |
$out = '
|
169 |
<div class="alignleft actions">';
|
170 |
+
$out .= $this->filterbar->show_years('?page=el_admin_main', $this->args, 'dropdown', 'admin', array('show_past'=>true));
|
171 |
$out .= $this->filterbar->show_cats('?page=el_admin_main', $this->args, 'dropdown', 'admin');
|
172 |
$out .= '
|
173 |
<input type="hidden" name="noheader" value="true" />
|
218 |
$this->args['cat_filter'] = 'all';
|
219 |
// actual_date
|
220 |
$this->args['actual_date'] = 'upcoming';
|
221 |
+
if(isset($_GET['date']) && (is_numeric($_GET['date']) || 'all' == $_GET['date'] || 'upcoming' == $_GET['date'] || 'past' == $_GET['date'])) {
|
222 |
$this->args['actual_date'] = $_GET['date'];
|
223 |
}
|
224 |
// actual_cat
|
admin/js/admin_new.js
CHANGED
@@ -30,9 +30,6 @@ jQuery(document).ready(function($) {
|
|
30 |
onClose: function(selectedDate) {
|
31 |
// set minDate for end_date picker
|
32 |
minDate = $.datepicker.parseDate( conf.el_date_format, selectedDate );
|
33 |
-
$("#test_text").val("Test");
|
34 |
-
$("#test_date1").val(minDate);
|
35 |
-
$("#test_date2").val($.datepicker.formatDate("yy-mm-dd", minDate));
|
36 |
minDate.setDate(minDate.getDate()+1);
|
37 |
$("#end_date").datepicker("option", "minDate", minDate);
|
38 |
}
|
30 |
onClose: function(selectedDate) {
|
31 |
// set minDate for end_date picker
|
32 |
minDate = $.datepicker.parseDate( conf.el_date_format, selectedDate );
|
|
|
|
|
|
|
33 |
minDate.setDate(minDate.getDate()+1);
|
34 |
$("#end_date").datepicker("option", "minDate", minDate);
|
35 |
}
|
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.6.
|
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.6.7
|
7 |
Author: Michael Burtscher
|
8 |
Author URI: http://wordpress.org/extend/plugins/event-list/
|
9 |
License: GPLv2
|
includes/db.php
CHANGED
@@ -263,28 +263,64 @@ class EL_Db {
|
|
263 |
}
|
264 |
|
265 |
private function sql_date_filter($element) {
|
266 |
-
|
267 |
-
|
268 |
-
$
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
}
|
276 |
-
else { // upcoming
|
277 |
-
// get only events from today and in the future
|
278 |
-
$range_start = date('Y-m-d', current_time('timestamp'));
|
279 |
-
$range_end = '9999-12-31';
|
280 |
-
}
|
281 |
-
return '(end_date >= "'.$range_start.'" AND start_date <= "'.$range_end.'")';
|
282 |
}
|
283 |
|
284 |
private function sql_cat_filter ($element) {
|
285 |
return 'categories LIKE "%|'.$element.'|%"';
|
286 |
}
|
287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
/** ************************************************************************************************************
|
289 |
* Function to truncate and shorten text
|
290 |
*
|
263 |
}
|
264 |
|
265 |
private function sql_date_filter($element) {
|
266 |
+
$range = $this->check_date_formats($element);
|
267 |
+
if(null === $range) {
|
268 |
+
$range = $this->check_daterange_formats($element);
|
269 |
+
}
|
270 |
+
if(null === $range) {
|
271 |
+
//set to standard (upcoming)
|
272 |
+
$range = $this->get_date_range($element, $this->options->daterange_formats['upcoming']);
|
273 |
+
}
|
274 |
+
return '(end_date >= "'.$range[0].'" AND start_date <= "'.$range[1].'")';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
}
|
276 |
|
277 |
private function sql_cat_filter ($element) {
|
278 |
return 'categories LIKE "%|'.$element.'|%"';
|
279 |
}
|
280 |
|
281 |
+
private function check_date_formats($element) {
|
282 |
+
foreach($this->options->date_formats as $date_type) {
|
283 |
+
if(preg_match('@'.$date_type['regex'].'@', $element)) {
|
284 |
+
return $this->get_date_range($element, $date_type);
|
285 |
+
}
|
286 |
+
}
|
287 |
+
return null;
|
288 |
+
}
|
289 |
+
|
290 |
+
private function check_daterange_formats($element) {
|
291 |
+
foreach($this->options->daterange_formats as $key => $daterange_type) {
|
292 |
+
if(preg_match('@'.$daterange_type['regex'].'@', $element)) {
|
293 |
+
//check for date_range which requires special handling
|
294 |
+
if('date_range' == $key) {
|
295 |
+
$sep_pos = strpos($element, "~");
|
296 |
+
$startrange = $this->check_date_range(substr($element, 0, $sep_pos));
|
297 |
+
$endrange = $this->check_date_range(substr($element, $sep_pos+1));
|
298 |
+
return array($startrange[0], $endrange[1]);
|
299 |
+
}
|
300 |
+
return $this->get_date_range($element, $daterange_type);
|
301 |
+
}
|
302 |
+
}
|
303 |
+
return null;
|
304 |
+
}
|
305 |
+
|
306 |
+
private function get_date_range($element, &$range_type) {
|
307 |
+
// range start
|
308 |
+
if(substr($range_type['start'], 0, 8) == '--func--') {
|
309 |
+
eval('$range[0] = '.substr($range_type['start'], 8));
|
310 |
+
}
|
311 |
+
else {
|
312 |
+
$range[0] = str_replace('%v%', $element, $range_type['start']);
|
313 |
+
}
|
314 |
+
// range end
|
315 |
+
if(substr($range_type['end'], 0, 8) == '--func--') {
|
316 |
+
eval('$range[1] = '.substr($range_type['end'], 8));
|
317 |
+
}
|
318 |
+
else {
|
319 |
+
$range[1] = str_replace('%v%', $element, $range_type['end']);
|
320 |
+
}
|
321 |
+
return $range;
|
322 |
+
}
|
323 |
+
|
324 |
/** ************************************************************************************************************
|
325 |
* Function to truncate and shorten text
|
326 |
*
|
includes/options.php
CHANGED
@@ -9,6 +9,8 @@ class EL_Options {
|
|
9 |
private static $instance;
|
10 |
public $group;
|
11 |
public $options;
|
|
|
|
|
12 |
|
13 |
public static function &get_instance() {
|
14 |
// Create class instance if required
|
@@ -145,6 +147,52 @@ class EL_Options {
|
|
145 |
'desc' => __('This option specifies if the an image should be dispayed in the feed link in front of the text.<br />
|
146 |
You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
|
147 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
public function init() {
|
9 |
private static $instance;
|
10 |
public $group;
|
11 |
public $options;
|
12 |
+
public $date_formats;
|
13 |
+
public $daterange_formats;
|
14 |
|
15 |
public static function &get_instance() {
|
16 |
// Create class instance if required
|
147 |
'desc' => __('This option specifies if the an image should be dispayed in the feed link in front of the text.<br />
|
148 |
You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
|
149 |
);
|
150 |
+
|
151 |
+
$this->date_formats = array(
|
152 |
+
'year' => array('name' => 'Year',
|
153 |
+
'regex' => '^[12]\d{3}$',
|
154 |
+
'examp' => '2015',
|
155 |
+
'start' => '%v%-01-01',
|
156 |
+
'end' => '%v%-12-31',
|
157 |
+
'desc' => __('You can specify a year in 4 digit format.<br /> Other formats will not be accepted.')),
|
158 |
+
'month' => array('name' => 'Month',
|
159 |
+
'regex' => '^[12]\d{3}-(0[1-9]|1[012])$',
|
160 |
+
'examp' => '2015-03',
|
161 |
+
'start' => '%v%-01',
|
162 |
+
'end' => '%v%-31',
|
163 |
+
'desc' => __('You can specify a month with 4 digits for the year and 2 digits for the month, seperated by a hyphen (-).<br />Other formats will not be accepted.')),
|
164 |
+
'day' => array('name' => 'Day',
|
165 |
+
'regex' => '^[12]\d{3}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$',
|
166 |
+
'examp' => '2015-03-29',
|
167 |
+
'start' => '%v%',
|
168 |
+
'end' => '%v%',
|
169 |
+
'desc' => __('You can specify a day with 4 digits for the year, 2 digits for the month and 2 digets for the day, seperated by a hyphen (-).<br /> Other formats will not be accepted.')),
|
170 |
+
);
|
171 |
+
|
172 |
+
$this->daterange_formats = array(
|
173 |
+
'date_range' => array('name' => 'Date range',
|
174 |
+
'regex' => '.+~.+',
|
175 |
+
'examp' => '2015-03-29~2016',
|
176 |
+
'desc' => __('You can specify a rage or dates seperated by a tilde (~).<br >You can specify any available date format before and after the tilde.')),
|
177 |
+
'all' => array('name' => 'All',
|
178 |
+
'regex' => '^all$',
|
179 |
+
'value' => 'all',
|
180 |
+
'start' => '1000-01-01',
|
181 |
+
'end' => '2999-12-31',
|
182 |
+
'desc' => __('"all" specifies the full time range without any limitation.')),
|
183 |
+
'upcoming' => array('name' => 'Upcoming',
|
184 |
+
'regex' => '^upcoming$',
|
185 |
+
'value' => 'upcoming',
|
186 |
+
'start' => '--func--date("Y-m-d", current_time("timestamp"));',
|
187 |
+
'end' => '2999-12-31',
|
188 |
+
'desc' => __('"upcoming" specifies a time range from the actual day to the future.')),
|
189 |
+
'past' => array('name' => 'Past',
|
190 |
+
'regex' => '^past$',
|
191 |
+
'value' => 'past',
|
192 |
+
'start' => '1000-01-01',
|
193 |
+
'end' => '--func--date("Y-m-d", current_time("timestamp")-86400);', // previous day (86400 seconds = 1*24*60*60 = 1 day
|
194 |
+
'desc' => __('"past" specifies a time rage from the past to the previous day.')),
|
195 |
+
);
|
196 |
}
|
197 |
|
198 |
public function init() {
|
includes/sc_event-list.php
CHANGED
@@ -53,7 +53,8 @@ class SC_Event_List {
|
|
53 |
'std_val' => 'all',
|
54 |
'desc' => 'This attribute specifies the dates and date ranges of which events are displayed. The standard is "all" to show all events.<br />
|
55 |
Filtered events according to date_filter value are not available in the event list.<br />
|
56 |
-
|
|
|
57 |
When you only use OR connections (no AND connection) the years selection in the filterbar will also be filtered accordingly.'),
|
58 |
|
59 |
'cat_filter' => array('val' => 'all<br />category slugs',
|
@@ -345,7 +346,7 @@ class SC_Event_List {
|
|
345 |
$out .= '<div class="event-cat">'.esc_attr($this->categories->get_category_string($event->categories)).'</div>';
|
346 |
}
|
347 |
if( $this->is_visible( $a['show_details'] ) ) {
|
348 |
-
$out .= '<div class="event-details">'.$this->db->truncate(do_shortcode($event->details), $a['details_length'], $this->single_event).'</div>';
|
349 |
}
|
350 |
$out .= '</div>
|
351 |
</li>';
|
53 |
'std_val' => 'all',
|
54 |
'desc' => 'This attribute specifies the dates and date ranges of which events are displayed. The standard is "all" to show all events.<br />
|
55 |
Filtered events according to date_filter value are not available in the event list.<br />
|
56 |
+
You can find all available values with a description and examples in "Available Date Formats" and "Available Date Range Formats" below.<br />
|
57 |
+
See "Filter Syntax" description if you want to define complex filters.<br />
|
58 |
When you only use OR connections (no AND connection) the years selection in the filterbar will also be filtered accordingly.'),
|
59 |
|
60 |
'cat_filter' => array('val' => 'all<br />category slugs',
|
346 |
$out .= '<div class="event-cat">'.esc_attr($this->categories->get_category_string($event->categories)).'</div>';
|
347 |
}
|
348 |
if( $this->is_visible( $a['show_details'] ) ) {
|
349 |
+
$out .= '<div class="event-details">'.$this->db->truncate(do_shortcode(wpautop($event->details)), $a['details_length'], $this->single_event).'</div>';
|
350 |
}
|
351 |
$out .= '</div>
|
352 |
</li>';
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: event, events, list, listview, calendar, schedule, shortcode, page, category, categories, filter, admin, attribute, widget, sidebar, feed, rss
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 0.6.
|
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
|
@@ -71,6 +71,12 @@ Another possibility would be to call the wordpress function "do_shortcode()".
|
|
71 |
|
72 |
== Changelog ==
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
= 0.6.6 (2014-06-16) =
|
75 |
* added date_filter shortcode option
|
76 |
* added option to change text for filterbar reset item
|
4 |
Tags: event, events, list, listview, calendar, schedule, shortcode, page, category, categories, filter, admin, attribute, widget, sidebar, feed, rss
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 0.6.7
|
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
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 0.6.7 (2014-06-18) =
|
75 |
+
* added month and day support in date_filter
|
76 |
+
* added available date and date range formats description in admin about page
|
77 |
+
* added support for wpautop in event details
|
78 |
+
* added "Past" entry in admin event table filter
|
79 |
+
|
80 |
= 0.6.6 (2014-06-16) =
|
81 |
* added date_filter shortcode option
|
82 |
* added option to change text for filterbar reset item
|