Event List - Version 0.6.5

Version Description

(2014-04-26) = * added shortcode attribute "initial_event_id" * added an option to only show umpcoming events in the feed * fixed a problem in truncate function

Download this release

Release Info

Developer mibuthu
Plugin Icon 128x128 Event List
Version 0.6.5
Comparing to
See all releases

Code changes from version 0.6.4 to 0.6.5

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.4
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.5
7
  Author: Michael Burtscher
8
  Author URI: http://wordpress.org/extend/plugins/event-list/
9
  License: GPLv2
includes/db.php CHANGED
@@ -299,7 +299,7 @@ class EL_Db {
299
  $position = 0;
300
  $tags = array();
301
  $out = '';
302
- while($printedLength < $length && preg_match('{</?([a-z]+)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position)) {
303
  list($tag, $tagPosition) = $match[0];
304
  // Print text leading up to the tag
305
  $str = substr($html, $position, $tagPosition - $position);
299
  $position = 0;
300
  $tags = array();
301
  $out = '';
302
+ while($printedLength < $length && preg_match('{</?([a-z]+\d?)[^>]*>|&#?[a-zA-Z0-9]+;}', $html, $match, PREG_OFFSET_CAPTURE, $position)) {
303
  list($tag, $tagPosition) = $match[0];
304
  // Print text leading up to the tag
305
  $str = substr($html, $position, $tagPosition - $position);
includes/feed.php CHANGED
@@ -41,7 +41,7 @@ class EL_Feed {
41
 
42
  public function print_eventlist_feed() {
43
  header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
44
- $events = $this->db->get_events();
45
 
46
  // Print feeds
47
  echo
@@ -140,4 +140,4 @@ class EL_Feed {
140
  return $event_date;
141
  }
142
  }
143
- ?>
41
 
42
  public function print_eventlist_feed() {
43
  header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
44
+ $events = $this->db->get_events($this->options->get('el_feed_upcoming_only') ? 'upcoming' : null);
45
 
46
  // Print feeds
47
  echo
140
  return $event_date;
141
  }
142
  }
143
+ ?>
includes/options.php CHANGED
@@ -24,118 +24,126 @@ class EL_Options {
24
  $this->group = 'event-list';
25
 
26
  $this->options = array(
27
- 'el_db_version' => array('section' => 'system',
28
- 'type' => 'text',
29
- 'std_val' => '',
30
- 'label' => '',
31
- 'caption' => '',
32
- 'desc' => __('Database version')),
33
-
34
- 'el_categories' => array('section' => 'categories',
35
- 'type' => 'category',
36
- 'std_val' => null,
37
- 'label' => __('Event Categories'),
38
- 'caption' => '',
39
- 'desc' => __('This option specifies all event category data.')),
40
-
41
- 'el_sync_cats' => array('section' => 'categories',
42
- 'type' => 'checkbox',
43
- 'std_val' => '',
44
- 'label' => __('Sync Categories'),
45
- 'caption' => __('Keep event categories in sync with post categories automatically'),
46
- 'desc' => '<table><tr style="vertical-align:top"><td><strong>'.__('Attention').':</strong></td>
47
- <td>'.__('Please note that this option will delete all categories which are not available in the post categories! Existing Categories with the same slug will be updated.').'</td></tr></table>'),
48
-
49
- 'el_no_event_text' => array('section' => 'general',
50
- 'type' => 'text',
51
- 'std_val' => 'no event',
52
- 'label' => __('Text for no events'),
53
- 'caption' => '',
54
- 'desc' => __('This option defines the text which is displayed if no events are available for the selected view.')),
55
-
56
- 'el_date_once_per_day' => array('section' => 'general',
57
- 'type' => 'checkbox',
58
- 'std_val' => '',
59
- 'label' => __('Date display'),
60
- 'caption' => __('Show date only once per day'),
61
- 'desc' => __('With this option you can display the date only once per day if multiple events are available on the same day.<br />
62
- If this option is enabled the events are ordered in a different way (end date before start time) to allow using the same date for as much events as possible.')),
63
-
64
- 'el_html_tags_in_time' => array('section' => 'general',
65
- 'type' => 'checkbox',
66
- 'std_val' => '',
67
- 'label' => __('HTML tags'),
68
- 'caption' => __('Allow HTML tags in event time field'),
69
- 'desc' => __('This option specifies if HTML tags are allowed in the event start time field.')),
70
-
71
- 'el_html_tags_in_loc' => array('section' => 'general',
72
- 'type' => 'checkbox',
73
- 'std_val' => '',
74
- 'label' => '', // only one label for all html tags settings
75
- 'caption' => __('Allow HTML tags in event location field'),
76
- 'desc' => __('This option specifies if HTML tags are allowed in the event location field.')),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
- 'el_edit_dateformat' => array('section' => 'admin',
79
  'type' => 'text',
80
- 'std_val' => '',
81
- 'label' => __('Date format in edit form'),
82
- 'caption' => __('Specific date format in new/edit event form'),
83
- 'desc' => __('This option sets a specific date format for the event date fields in the new/edit event form.<br />
84
- The standard is an empty string to use the wordpress standard setting.<br />
85
- All available options to specify the format can be found <a href="http://php.net/manual/en/function.date.php" target="_blank">here</a>')),
86
-
87
- 'el_enable_feed' => array('section' => 'feed',
88
- 'type' => 'checkbox',
89
- 'std_val' => '',
90
- 'label' => __('Enable RSS feed'),
91
- 'caption' => __('Enable support for an event RSS feed'),
92
- 'desc' => __('This option activates a RSS feed for the events.<br />
93
- You have to enable this option if you want to use one of the RSS feed features.')),
94
 
95
- 'el_head_feed_link' => array('section' => 'feed',
96
  'type' => 'checkbox',
97
- 'std_val' => '',
98
- 'label' => __('Add RSS feed link in head'),
99
- 'caption' => __('Add RSS feed link in the html head'),
100
- 'desc' => __('This option adds a RSS feed in the html head for the events.<br />
101
- You have 2 possibilities to include the RSS feed:<br />
102
- The first option is to use this option to include a link in the html head. This link will be recognized by browers or feed readers.<br />
103
- The second possibility is to include a visible feed link directly in the event list. This can be done by setting the shortcode attribute "add_feed_link" to "true"<br />
104
- This option is only valid if the option "Enable RSS feed" is enabled.')),
105
-
106
- 'el_feed_link_pos' => array('section' => 'feed',
107
- 'type' => 'radio',
108
- 'std_val' => 'bottom',
109
- 'label' => __('Position of the RSS feed link'),
110
- 'caption' => array('top' => 'at the top (above the navigation bar)', 'below_nav' => 'between navigation bar and events', 'bottom' => 'at the bottom'),
111
- 'desc' => __('This option specifies the position of the RSS feed link in the event list.<br />
112
- The options are to display the link at the top, at the bottom or between the navigation bar and the event list.<br />
113
  You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
114
-
115
- 'el_feed_link_align' => array('section' => 'feed',
116
- 'type' => 'radio',
117
- 'std_val' => 'left',
118
- 'label' => __('Align of the RSS feed link'),
119
- 'caption' => array('left' => 'left', 'center' => 'center', 'right' => 'right'),
120
- 'desc' => __('This option specifies the align of the RSS feed link in the event list.<br />
121
- The link can be displayed on the left side, centered or on the right.<br />
122
- You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
123
-
124
- 'el_feed_link_text' => array('section' => 'feed',
125
- 'type' => 'text',
126
- 'std_val' => 'RSS Feed',
127
- 'label' => __('Feed link text'),
128
- 'desc' => __('This option specifies the caption of the RSS feed link in the event list.<br />
129
- Insert an empty text to hide any text if you only want to show the rss image.<br />
130
- You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
131
-
132
- 'el_feed_link_img' => array('section' => 'feed',
133
- 'type' => 'checkbox',
134
- 'std_val' => '1',
135
- 'label' => __('Feed link image'),
136
- 'caption' => __('Show rss image in feed link'),
137
- 'desc' => __('This option specifies if the an image should be dispayed in the feed link in front of the text.<br />
138
- You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
139
  );
140
  }
141
 
24
  $this->group = 'event-list';
25
 
26
  $this->options = array(
27
+ 'el_db_version' => array('section' => 'system',
28
+ 'type' => 'text',
29
+ 'std_val' => '',
30
+ 'label' => '',
31
+ 'caption' => '',
32
+ 'desc' => __('Database version')),
33
+
34
+ 'el_categories' => array('section' => 'categories',
35
+ 'type' => 'category',
36
+ 'std_val' => null,
37
+ 'label' => __('Event Categories'),
38
+ 'caption' => '',
39
+ 'desc' => __('This option specifies all event category data.')),
40
+
41
+ 'el_sync_cats' => array('section' => 'categories',
42
+ 'type' => 'checkbox',
43
+ 'std_val' => '',
44
+ 'label' => __('Sync Categories'),
45
+ 'caption' => __('Keep event categories in sync with post categories automatically'),
46
+ 'desc' => '<table><tr style="vertical-align:top"><td><strong>'.__('Attention').':</strong></td>
47
+ <td>'.__('Please note that this option will delete all categories which are not available in the post categories! Existing Categories with the same slug will be updated.').'</td></tr></table>'),
48
+
49
+ 'el_no_event_text' => array('section' => 'general',
50
+ 'type' => 'text',
51
+ 'std_val' => 'no event',
52
+ 'label' => __('Text for no events'),
53
+ 'caption' => '',
54
+ 'desc' => __('This option defines the text which is displayed if no events are available for the selected view.')),
55
+
56
+ 'el_date_once_per_day' => array('section' => 'general',
57
+ 'type' => 'checkbox',
58
+ 'std_val' => '',
59
+ 'label' => __('Date display'),
60
+ 'caption' => __('Show date only once per day'),
61
+ 'desc' => __('With this option you can display the date only once per day if multiple events are available on the same day.<br />
62
+ If this option is enabled the events are ordered in a different way (end date before start time) to allow using the same date for as much events as possible.')),
63
+
64
+ 'el_html_tags_in_time' => array('section' => 'general',
65
+ 'type' => 'checkbox',
66
+ 'std_val' => '',
67
+ 'label' => __('HTML tags'),
68
+ 'caption' => __('Allow HTML tags in event time field'),
69
+ 'desc' => __('This option specifies if HTML tags are allowed in the event start time field.')),
70
+
71
+ 'el_html_tags_in_loc' => array('section' => 'general',
72
+ 'type' => 'checkbox',
73
+ 'std_val' => '',
74
+ 'label' => '', // only one label for all html tags settings
75
+ 'caption' => __('Allow HTML tags in event location field'),
76
+ 'desc' => __('This option specifies if HTML tags are allowed in the event location field.')),
77
+
78
+ 'el_edit_dateformat' => array('section' => 'admin',
79
+ 'type' => 'text',
80
+ 'std_val' => '',
81
+ 'label' => __('Date format in edit form'),
82
+ 'caption' => __('Specific date format in new/edit event form'),
83
+ 'desc' => __('This option sets a specific date format for the event date fields in the new/edit event form.<br />
84
+ The standard is an empty string to use the wordpress standard setting.<br />
85
+ All available options to specify the format can be found <a href="http://php.net/manual/en/function.date.php" target="_blank">here</a>')),
86
+
87
+ 'el_enable_feed' => array('section' => 'feed',
88
+ 'type' => 'checkbox',
89
+ 'std_val' => '',
90
+ 'label' => __('Enable RSS feed'),
91
+ 'caption' => __('Enable support for an event RSS feed'),
92
+ 'desc' => __('This option activates a RSS feed for the events.<br />
93
+ You have to enable this option if you want to use one of the RSS feed features.')),
94
+
95
+ 'el_feed_upcoming_only' => array('section' => 'feed',
96
+ 'type' => 'checkbox',
97
+ 'std_val' => '',
98
+ 'label' => __('Listed events'),
99
+ 'caption' => __('Only show upcoming events in feed'),
100
+ 'desc' => __('If this option is enabled only the upcoming events are listed in the feed.<br />
101
+ If disabled all events (upcoming and past) will be listed.')),
102
+
103
+ 'el_head_feed_link' => array('section' => 'feed',
104
+ 'type' => 'checkbox',
105
+ 'std_val' => '',
106
+ 'label' => __('Add RSS feed link in head'),
107
+ 'caption' => __('Add RSS feed link in the html head'),
108
+ 'desc' => __('This option adds a RSS feed in the html head for the events.<br />
109
+ You have 2 possibilities to include the RSS feed:<br />
110
+ The first option is to use this option to include a link in the html head. This link will be recognized by browers or feed readers.<br />
111
+ The second possibility is to include a visible feed link directly in the event list. This can be done by setting the shortcode attribute "add_feed_link" to "true"<br />
112
+ This option is only valid if the option "Enable RSS feed" is enabled.')),
113
+
114
+ 'el_feed_link_pos' => array('section' => 'feed',
115
+ 'type' => 'radio',
116
+ 'std_val' => 'bottom',
117
+ 'label' => __('Position of the RSS feed link'),
118
+ 'caption' => array('top' => 'at the top (above the navigation bar)', 'below_nav' => 'between navigation bar and events', 'bottom' => 'at the bottom'),
119
+ 'desc' => __('This option specifies the position of the RSS feed link in the event list.<br />
120
+ The options are to display the link at the top, at the bottom or between the navigation bar and the event list.<br />
121
+ You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
122
+
123
+ 'el_feed_link_align' => array('section' => 'feed',
124
+ 'type' => 'radio',
125
+ 'std_val' => 'left',
126
+ 'label' => __('Align of the RSS feed link'),
127
+ 'caption' => array('left' => 'left', 'center' => 'center', 'right' => 'right'),
128
+ 'desc' => __('This option specifies the align of the RSS feed link in the event list.<br />
129
+ The link can be displayed on the left side, centered or on the right.<br />
130
+ You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
131
 
132
+ 'el_feed_link_text' => array('section' => 'feed',
133
  'type' => 'text',
134
+ 'std_val' => 'RSS Feed',
135
+ 'label' => __('Feed link text'),
136
+ 'desc' => __('This option specifies the caption of the RSS feed link in the event list.<br />
137
+ Insert an empty text to hide any text if you only want to show the rss image.<br />
138
+ You have to set the shortcode attribute "add_feed_link" to "true" if you want to show the feed link.')),
 
 
 
 
 
 
 
 
 
139
 
140
+ 'el_feed_link_img' => array('section' => 'feed',
141
  'type' => 'checkbox',
142
+ 'std_val' => '1',
143
+ 'label' => __('Feed link image'),
144
+ 'caption' => __('Show rss image in feed link'),
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
 
includes/sc_event-list.php CHANGED
@@ -34,28 +34,29 @@ class SC_Event_List {
34
  // All available attributes
35
  $this->atts = array(
36
 
37
- 'initial_date' => array( 'val' => 'all<br />upcoming<br />year e.g. "2014"',
 
 
 
 
 
38
  'std_val' => 'upcoming',
39
- 'visible' => true,
40
- 'desc' => 'This attribute specifies which events are initially shown. The standard is to show the upcoming events.<br />
41
- Specify a year e.g. "2014" to change this behavior.'),
42
 
43
- 'initial_cat' => array( 'val' => 'all<br />category slug',
44
  'std_val' => 'all',
45
- 'visible' => true,
46
- 'desc' => 'This attribute specifies the category of which events are initially shown. The standard is to show events of all categories.<br />
47
- Specify a category slug to change this behavior. You can include a category selection in the filterbar to give users the possibility to change the displayed categories.'),
48
  /*
49
- 'date_filter' => array( 'val' => 'all<br />upcoming<br />year e.g. "2014"',
50
  'std_val' => 'all',
51
- 'visible' => true,
52
  'desc' => 'This attribute specifies the date range of which events are displayed. The standard is "all" to show all events.<br />
53
  Events defined in date ranges not listed here are also not available in the date selection in the filterbar. It is also not possible to show them with a manual added url parameter<br />
54
  Specify a year or a list of years separated by a comma "," e.g. "2014,2015,2016".'),
55
  */
56
- 'cat_filter' => array( 'val' => 'all<br />category slugs',
57
  'std_val' => 'all',
58
- 'visible' => true,
59
  'desc' => 'This attribute specifies the categories of which events are shown. The standard is "all" or an empty string to show all events.<br />
60
  Events defined in categories which doesn´t match cat_filter are not shown in the event list. They are also not available if a manual url parameter is added.<br />
61
  The filter is specified via the given category slug. You can use AND ("&") and OR ("|" or ",") connections to define complex filters. Additionally you can set brackets for nested queries.<br />
@@ -65,23 +66,20 @@ class SC_Event_List {
65
  <code>tennis|(hockey&winter)</code> ... Show all events with category "tennis" and all events where category "hockey" as well as "winter" is selected.<br />
66
  If you only use OR connections (no AND connection) the category selection in the filterbar will also be filtered according to the given filter.<br />'),
67
 
68
- 'num_events' => array( 'val' => 'number',
69
  'std_val' => '0',
70
- 'visible' => true,
71
  'desc' => 'This attribute specifies how many events should be displayed if upcoming events is selected.<br />
72
  0 is the standard value which means that all events will be displayed.<br />
73
  Please not that in the actual version there is no pagination of the events available.'),
74
 
75
- 'show_filterbar' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
76
  'std_val' => 'true',
77
- 'visible' => true,
78
  'desc' => 'This attribute specifies if the filterbar should be displayed. The filterbar allows the users to select filters to limit the listed events.<br />
79
  Choose "false" to always hide and "true" to always show the navigation.<br />
80
  With "event_list_only" the filterbar is only visible in the event list and with "single_event_only" only for a single event'),
81
 
82
- 'filterbar_items' => array( 'val' => 'years_hlist<br />years_dropdown<br />cats_hlist<br />cats_dropdown<br />reset_link',
83
  'std_val' => 'years_hlist',
84
- 'visible' => true,
85
  'desc' => 'This attribute specifies the available items in the filterbar. This options are only valid if the filterbar is displayed (see show_filterbar attribute).<br /><br />
86
  Find below an overview of the available filterbar items and their options:<br />
87
  <small><table class="el-filterbar-table">
@@ -100,85 +98,79 @@ class SC_Event_List {
100
  <p>Find below some declaration examples with descriptions:</p>
101
  <code>years_hlist,cats_dropdown</code><br />
102
  In this example you can see that the filterbar item and the used display option is seperated by "_". You can define several filterbar items seperated by comma (","). The items will be aligned on the left side.
103
- <p><code>years_dropdown(show-all=false|show-past=true),cats_dropdown;;reset_link</code><br />
104
  In this example you can see that filterbar options can be added in brackets in format "option_name=value". You can also add multiple options seperated by a pipe ("|").<br />
105
  The 2 semicolon (";") devides the bar in 3 section. The first section will be displayed left-justified, the second section will be centered and the third section will be right-aligned. So in this example the 2 dropdown will be left-aligned and the reset link will be on the right side.</p>'),
106
 
107
- 'show_starttime' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
108
  'std_val' => 'true',
109
- 'visible' => true,
110
  'desc' => 'This attribute specifies if the starttime is displayed in the event list.<br />
111
  Choose "false" to always hide and "true" to always show the starttime.<br />
112
  With "event_list_only" the starttime is only visible in the event list and with "single_event_only" only for a single event'),
113
 
114
- 'show_location' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
115
  'std_val' => 'true',
116
- 'visible' => true,
117
  'desc' => 'This attribute specifies if the location is displayed in the event list.<br />
118
  Choose "false" to always hide and "true" to always show the location.<br />
119
  With "event_list_only" the location is only visible in the event list and with "single_event_only" only for a single event'),
120
 
121
- 'show_cat' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
122
  'std_val' => 'false',
123
- 'visible' => true,
124
  'desc' => 'This attribute specifies if the categories are displayed in the event list.<br />
125
  Choose "false" to always hide and "true" to always show the category.<br />
126
  With "event_list_only" the categories are only visible in the event list and with "single_event_only" only for a single event'),
127
 
128
- 'show_details' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
129
  'std_val' => 'true',
130
  'visible' => true,
131
  'desc' => 'This attribute specifies if the details are displayed in the event list.<br />
132
  Choose "false" to always hide and "true" to always show the details.<br />
133
  With "event_list_only" the details are only visible in the event list and with "single_event_only" only for a single event'),
134
 
135
- 'details_length' => array( 'val' => 'number',
136
  'std_val' => '0',
137
- 'visible' => true,
138
  'desc' => 'This attribute specifies if the details should be truncate to the given number of characters in the event list.<br />
139
  With the standard value 0 the full details are displayed.<br />
140
  This attribute has no influence if only a single event is shown.'),
141
 
142
- 'link_to_event' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
143
  'std_val' => 'event_list_only',
144
- 'visible' => true,
145
  'desc' => 'This attribute specifies if a link to the single event should be added onto the event name in the event list.<br />
146
  Choose "false" to never add and "true" to always add the link.<br />
147
  With "event_list_only" the link is only added in the event list and with "single_event_only" only for a single event'),
148
 
149
- 'add_feed_link' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
150
  'std_val' => 'false',
151
- 'visible' => true,
152
  'desc' => 'This attribute specifies if a rss feed link should be added.<br />
153
  You have to enable the feed in the eventlist settings to make this attribute workable.<br />
154
  On that page you can also find some settings to modify the output.<br />
155
  Choose "false" to never add and "true" to always add the link.<br />
156
  With "event_list_only" the link is only added in the event list and with "single_event_only" only for a single event'),
157
  // Invisible attributes ('visibe' = false): This attributes are required for the widget but will not be listed in the attributes table on the admin info page
158
- 'title_length' => array( 'val' => 'number',
159
  'std_val' => '0',
160
- 'visible' => false,
161
  'desc' => 'This attribute specifies if the title should be truncate to the given number of characters in the event list.<br />
162
  With the standard value 0 the full details are displayed.<br />
163
  This attribute has no influence if only a single event is shown.'),
164
 
165
- 'location_length' => array( 'val' => 'number',
166
  'std_val' => '0',
167
- 'visible' => false,
168
  'desc' => 'This attribute specifies if the title should be truncate to the given number of characters in the event list.<br />
169
  With the standard value 0 the full details are displayed.<br />
170
  This attribute has no influence if only a single event is shown.'),
171
 
172
- 'url_to_page' => array( 'val' => 'url',
173
  'std_val' => '',
174
- 'visible' => false,
175
  'desc' => 'This attribute specifies that the link should follow the given url.<br />
176
  The standard is to leave this attribute empty, then the url will be calculated automatically from the actual page or post url.<br />
177
  This is o.k. for the normal use of the shortcode. This attribute is normally only required for the event-list widget.' ),
178
 
179
- 'sc_id_for_url' => array( 'val' => 'number',
180
  'std_val' => '',
181
- 'visible' => false,
182
  'desc' => 'This attribute the specifies shortcode id of the used shortcode on the page specified with "url_to_page" attribute.<br />
183
  The empty standard value is o.k. for the normal use. This attribute is normally only required for the event-list widget.' ),
184
  // Internal attributes: This parameters will be added by the script and are not available in the shortcode
@@ -191,11 +183,11 @@ class SC_Event_List {
191
  $this->single_event = false;
192
  }
193
 
194
- public function get_atts( $only_visible=true ) {
195
- if( $only_visible ) {
196
  $atts = null;
197
- foreach( $this->atts as $aname => $attr ) {
198
- if( true === $attr['visible'] ) {
199
  $atts[$aname] = $attr;
200
  }
201
  }
@@ -207,36 +199,44 @@ class SC_Event_List {
207
  }
208
 
209
  // main function to show the rendered HTML output
210
- public function show_html( $atts ) {
211
  // change number of shortcodes
212
  $this->num_sc_loaded++;
213
  // check shortcode attributes
214
  $std_values = array();
215
- foreach( $this->atts as $aname => $attribute ) {
216
  $std_values[$aname] = $attribute['std_val'];
217
  }
218
- $a = shortcode_atts( $std_values, $atts );
219
  // add internal attributes
220
  $a['sc_id'] = $this->num_sc_loaded;
221
- $a['event_id'] = isset($_GET['event_id'.$a['sc_id']]) ? (int)$_GET['event_id'.$a['sc_id']] : null;
 
 
 
 
 
 
 
 
 
 
222
  // fix sc_id_for_url if required
223
- if( !is_numeric( $a['sc_id_for_url'] ) ) {
224
  $a['sc_id_for_url'] = $a['sc_id'];
225
  }
226
- $a['actual_date'] = $this->get_actual_date($a);
227
- $a['actual_cat'] = $this->get_actual_cat($a);
228
 
229
  $out = '
230
  <div class="event-list">';
231
- if( is_numeric( $a['event_id'] ) ) {
232
  // show events details if event_id is set
233
  $this->single_event = true;
234
- $out .= $this->html_event_details( $a );
235
  }
236
  else {
237
  // show full event list
238
  $this->single_event = false;
239
- $out .= $this->html_events( $a );
240
  }
241
  $out .= '
242
  </div>';
34
  // All available attributes
35
  $this->atts = array(
36
 
37
+ 'initial_event_id' => array('val' => 'all<br />event-id',
38
+ 'std_val' => 'all',
39
+ 'desc' => __('With this attribute you can specify an event from which the event-details are shown initially. The standard is to show the event-list.<br />
40
+ Specify an event-id e.g. "13" to change this behavior. It is still possible to go back to the event-list via the filterbar or url parameters.')),
41
+
42
+ 'initial_date' => array('val' => 'all<br />upcoming<br />year e.g. "2014"',
43
  'std_val' => 'upcoming',
44
+ 'desc' => __('This attribute specifies which events are initially shown. The standard is to show the upcoming events.<br />
45
+ Specify a year e.g. "2014" to change this behavior. It is still possible to change the displayed event date range via the filterbar or url parameters.')),
 
46
 
47
+ 'initial_cat' => array('val' => 'all<br />category slug',
48
  'std_val' => 'all',
49
+ 'desc' => __('This attribute specifies the category of which events are initially shown. The standard is to show events of all categories.<br />
50
+ Specify a category slug to change this behavior. It is still possible to change the displayed categories via the filterbar or url parameters.')),
 
51
  /*
52
+ 'date_filter' => array('val' => 'all<br />upcoming<br />year e.g. "2014"',
53
  'std_val' => 'all',
 
54
  'desc' => 'This attribute specifies the date range of which events are displayed. The standard is "all" to show all events.<br />
55
  Events defined in date ranges not listed here are also not available in the date selection in the filterbar. It is also not possible to show them with a manual added url parameter<br />
56
  Specify a year or a list of years separated by a comma "," e.g. "2014,2015,2016".'),
57
  */
58
+ 'cat_filter' => array('val' => 'all<br />category slugs',
59
  'std_val' => 'all',
 
60
  'desc' => 'This attribute specifies the categories of which events are shown. The standard is "all" or an empty string to show all events.<br />
61
  Events defined in categories which doesn´t match cat_filter are not shown in the event list. They are also not available if a manual url parameter is added.<br />
62
  The filter is specified via the given category slug. You can use AND ("&") and OR ("|" or ",") connections to define complex filters. Additionally you can set brackets for nested queries.<br />
66
  <code>tennis|(hockey&winter)</code> ... Show all events with category "tennis" and all events where category "hockey" as well as "winter" is selected.<br />
67
  If you only use OR connections (no AND connection) the category selection in the filterbar will also be filtered according to the given filter.<br />'),
68
 
69
+ 'num_events' => array('val' => 'number',
70
  'std_val' => '0',
 
71
  'desc' => 'This attribute specifies how many events should be displayed if upcoming events is selected.<br />
72
  0 is the standard value which means that all events will be displayed.<br />
73
  Please not that in the actual version there is no pagination of the events available.'),
74
 
75
+ 'show_filterbar' => array('val' => 'false<br />true<br />event_list_only<br />single_event_only',
76
  'std_val' => 'true',
 
77
  'desc' => 'This attribute specifies if the filterbar should be displayed. The filterbar allows the users to select filters to limit the listed events.<br />
78
  Choose "false" to always hide and "true" to always show the navigation.<br />
79
  With "event_list_only" the filterbar is only visible in the event list and with "single_event_only" only for a single event'),
80
 
81
+ 'filterbar_items' => array('val' => 'years_hlist<br />years_dropdown<br />cats_hlist<br />cats_dropdown<br />reset_link',
82
  'std_val' => 'years_hlist',
 
83
  'desc' => 'This attribute specifies the available items in the filterbar. This options are only valid if the filterbar is displayed (see show_filterbar attribute).<br /><br />
84
  Find below an overview of the available filterbar items and their options:<br />
85
  <small><table class="el-filterbar-table">
98
  <p>Find below some declaration examples with descriptions:</p>
99
  <code>years_hlist,cats_dropdown</code><br />
100
  In this example you can see that the filterbar item and the used display option is seperated by "_". You can define several filterbar items seperated by comma (","). The items will be aligned on the left side.
101
+ <p><code>years_dropdown(show_all=false|show_past=true),cats_dropdown;;reset_link</code><br />
102
  In this example you can see that filterbar options can be added in brackets in format "option_name=value". You can also add multiple options seperated by a pipe ("|").<br />
103
  The 2 semicolon (";") devides the bar in 3 section. The first section will be displayed left-justified, the second section will be centered and the third section will be right-aligned. So in this example the 2 dropdown will be left-aligned and the reset link will be on the right side.</p>'),
104
 
105
+ 'show_starttime' => array('val' => 'false<br />true<br />event_list_only<br />single_event_only',
106
  'std_val' => 'true',
 
107
  'desc' => 'This attribute specifies if the starttime is displayed in the event list.<br />
108
  Choose "false" to always hide and "true" to always show the starttime.<br />
109
  With "event_list_only" the starttime is only visible in the event list and with "single_event_only" only for a single event'),
110
 
111
+ 'show_location' => array('val' => 'false<br />true<br />event_list_only<br />single_event_only',
112
  'std_val' => 'true',
 
113
  'desc' => 'This attribute specifies if the location is displayed in the event list.<br />
114
  Choose "false" to always hide and "true" to always show the location.<br />
115
  With "event_list_only" the location is only visible in the event list and with "single_event_only" only for a single event'),
116
 
117
+ 'show_cat' => array('val' => 'false<br />true<br />event_list_only<br />single_event_only',
118
  'std_val' => 'false',
 
119
  'desc' => 'This attribute specifies if the categories are displayed in the event list.<br />
120
  Choose "false" to always hide and "true" to always show the category.<br />
121
  With "event_list_only" the categories are only visible in the event list and with "single_event_only" only for a single event'),
122
 
123
+ 'show_details' => array('val' => 'false<br />true<br />event_list_only<br />single_event_only',
124
  'std_val' => 'true',
125
  'visible' => true,
126
  'desc' => 'This attribute specifies if the details are displayed in the event list.<br />
127
  Choose "false" to always hide and "true" to always show the details.<br />
128
  With "event_list_only" the details are only visible in the event list and with "single_event_only" only for a single event'),
129
 
130
+ 'details_length' => array('val' => 'number',
131
  'std_val' => '0',
 
132
  'desc' => 'This attribute specifies if the details should be truncate to the given number of characters in the event list.<br />
133
  With the standard value 0 the full details are displayed.<br />
134
  This attribute has no influence if only a single event is shown.'),
135
 
136
+ 'link_to_event' => array( 'val' => 'false<br />true<br />event_list_only<br />single_event_only',
137
  'std_val' => 'event_list_only',
 
138
  'desc' => 'This attribute specifies if a link to the single event should be added onto the event name in the event list.<br />
139
  Choose "false" to never add and "true" to always add the link.<br />
140
  With "event_list_only" the link is only added in the event list and with "single_event_only" only for a single event'),
141
 
142
+ 'add_feed_link' => array('val' => 'false<br />true<br />event_list_only<br />single_event_only',
143
  'std_val' => 'false',
 
144
  'desc' => 'This attribute specifies if a rss feed link should be added.<br />
145
  You have to enable the feed in the eventlist settings to make this attribute workable.<br />
146
  On that page you can also find some settings to modify the output.<br />
147
  Choose "false" to never add and "true" to always add the link.<br />
148
  With "event_list_only" the link is only added in the event list and with "single_event_only" only for a single event'),
149
  // Invisible attributes ('visibe' = false): This attributes are required for the widget but will not be listed in the attributes table on the admin info page
150
+ 'title_length' => array('val' => 'number',
151
  'std_val' => '0',
152
+ 'hidden' => true,
153
  'desc' => 'This attribute specifies if the title should be truncate to the given number of characters in the event list.<br />
154
  With the standard value 0 the full details are displayed.<br />
155
  This attribute has no influence if only a single event is shown.'),
156
 
157
+ 'location_length' => array( 'val' => 'number',
158
  'std_val' => '0',
159
+ 'hidden' => true,
160
  'desc' => 'This attribute specifies if the title should be truncate to the given number of characters in the event list.<br />
161
  With the standard value 0 the full details are displayed.<br />
162
  This attribute has no influence if only a single event is shown.'),
163
 
164
+ 'url_to_page' => array('val' => 'url',
165
  'std_val' => '',
166
+ 'hidden' => true,
167
  'desc' => 'This attribute specifies that the link should follow the given url.<br />
168
  The standard is to leave this attribute empty, then the url will be calculated automatically from the actual page or post url.<br />
169
  This is o.k. for the normal use of the shortcode. This attribute is normally only required for the event-list widget.' ),
170
 
171
+ 'sc_id_for_url' => array('val' => 'number',
172
  'std_val' => '',
173
+ 'hidden' => true,
174
  'desc' => 'This attribute the specifies shortcode id of the used shortcode on the page specified with "url_to_page" attribute.<br />
175
  The empty standard value is o.k. for the normal use. This attribute is normally only required for the event-list widget.' ),
176
  // Internal attributes: This parameters will be added by the script and are not available in the shortcode
183
  $this->single_event = false;
184
  }
185
 
186
+ public function get_atts($only_visible=true) {
187
+ if($only_visible) {
188
  $atts = null;
189
+ foreach($this->atts as $aname => $attr) {
190
+ if(!isset($attr['hidden']) || true !== $attr['hidden'] ) {
191
  $atts[$aname] = $attr;
192
  }
193
  }
199
  }
200
 
201
  // main function to show the rendered HTML output
202
+ public function show_html($atts) {
203
  // change number of shortcodes
204
  $this->num_sc_loaded++;
205
  // check shortcode attributes
206
  $std_values = array();
207
+ foreach($this->atts as $aname => $attribute) {
208
  $std_values[$aname] = $attribute['std_val'];
209
  }
210
+ $a = shortcode_atts($std_values, $atts);
211
  // add internal attributes
212
  $a['sc_id'] = $this->num_sc_loaded;
213
+ $a['actual_date'] = $this->get_actual_date($a);
214
+ $a['actual_cat'] = $this->get_actual_cat($a);
215
+ if(isset($_GET['event_id'.$a['sc_id']])) {
216
+ $a['event_id'] = (int)$_GET['event_id'.$a['sc_id']];
217
+ }
218
+ elseif('all' != $a['initial_event_id'] && !isset($_GET['date'.$a['sc_id']]) && !isset($_GET['cat'.$a['sc_id']])) {
219
+ $a['event_id'] = (int)$a['initial_event_id'];
220
+ }
221
+ else {
222
+ $a['event_id'] = null;
223
+ }
224
  // fix sc_id_for_url if required
225
+ if(!is_numeric($a['sc_id_for_url'])) {
226
  $a['sc_id_for_url'] = $a['sc_id'];
227
  }
 
 
228
 
229
  $out = '
230
  <div class="event-list">';
231
+ if(is_numeric($a['event_id'])) {
232
  // show events details if event_id is set
233
  $this->single_event = true;
234
+ $out .= $this->html_event_details($a);
235
  }
236
  else {
237
  // show full event list
238
  $this->single_event = false;
239
+ $out .= $this->html_events($a);
240
  }
241
  $out .= '
242
  </div>';
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, filter, admin, attribute, widget, sidebar, feed, rss
5
  Requires at least: 3.3
6
- Tested up to: 3.8.1
7
- Stable tag: 0.6.4
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,11 @@ Another possibility would be to call the wordpress function "do_shortcode()".
71
 
72
  == Changelog ==
73
 
 
 
 
 
 
74
  = 0.6.4 (2014-02-10) =
75
  * fixed css file inclusion for shortcodes with parameters
76
  * fixed css file inclusion for shortcodes outside post content (e.g. theme template)
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, filter, admin, attribute, widget, sidebar, feed, rss
5
  Requires at least: 3.3
6
+ Tested up to: 3.9
7
+ Stable tag: 0.6.5
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.5 (2014-04-26) =
75
+ * added shortcode attribute "initial_event_id"
76
+ * added an option to only show umpcoming events in the feed
77
+ * fixed a problem in truncate function
78
+
79
  = 0.6.4 (2014-02-10) =
80
  * fixed css file inclusion for shortcodes with parameters
81
  * fixed css file inclusion for shortcodes outside post content (e.g. theme template)