Plugin Directory

RS EVENT multiday

"RS EVENT multiday" is an easy to use and highly flexible tool to manage and print events in your blog.

Download Version 1.2.1

"RS EVENT multiday" is a modification of "RS EVENT" by Robert Sargant.

The plugin offers the possibility to create events by easily adding some meta-data to ordinary posts. Furthermore, you can add the "RS EVENT multiday" widget to the sidebar or an RS EVENT multiday function to a template of your blog. Thus, it allows you to show a list of upcoming and/or past events.

"RS EVENT multiday" includes three different functions, which can be used in templates. rs_event_list(), rs_event_post(), rs_event_id()



FUNCTIONS

  1. rs_event_list()
    This is the function used for the widget. Of course, it can be used in templates as well. It prints an unordered list of events according to the parameters given to it (see below). Both, the <ul> and the <li> include class="rsevent", so you can costumize the output with stylesheets. Furthermore, the output can be customized with the parameters "html_list_v1", "html_list_v2", "html_list_v3" and "html_list_v4".
    For details see the parameters-section below.

  2. rs_event_post()
    This function should be used in the single-post-template (usually the file single.php of your theme). It prints the date of the event. The output can be customized with the parameters "html_post_v1", "html_post_v2", "html_post_v3" and "html_post_v4".
    For details see the parameters-section below.
    Note: If you just want to get the return values from rs_event\post(), so they do not get printed, you should use the function rs_event_post_return(). (This might be useful for e.g. Thematic themes.)

  3. rs_event_id()
    This function returns an array with IDs of posts, which include event-data. This array of IDs can then be used in other functions.

Each function can be customized by parameters.



PARAMETERS

title
(string) The widget-title in your sidebar. Not used, when the function is added to a template.
default value: 'Upcoming Events'

timespan
(integer) The maximum distance into the future events will be retrieved for, in days.
default value: 365

history
(integer) The maximum distance into the past that events will be retrieved for, in days. This can also be set to a negative negative number, e.g. -2 to prevent events that are occuring in the next two days from appearing.
default value: 0

date_format_1
(string) The style in which the date is formatted. date_format_1 is used for single-day events, for the end date of multi-day events, and for the start date of multi-day events if the two dates are NOT within the same year. default value: 'd.m.Y'

date_format_2
(string) The style in which the date is formatted. date_format_2 is used for the start date of multi-day events if the two dates are within the same year.
default value: 'd.m.'

time_format
(string) The style in which the time is formatted.
Note: 'second' cannot be entered for event time and must not be used because of variable $fake_second (used to mark empty time value.)
default value: 'H:i'

html_list_v1
(string) Used for rs_event_list(). Formats the output, if first date and time of an event is entered with "multi-day"-option off.
default value:
' <hr />%DATE% @ %TIME%<br /><strong>%TITLE%</strong> <br />» <a href="%URL%">read more</a> « '

html_list_v2
(string) Used for rs_event_list(). Formats the output, if first date but no time is entered with "multi-day"-option off; if %TIME% is used here anyway (which usually does not make any sense), output of %TIME% equals "--:--".
default value:
' <hr />%DATE% <br /><strong>%TITLE%</strong> <br />» <a href="%URL%">read more</a> « '

html_list_v3
(string) Used for rs_event_list(). Formats the output, if "multi-day"-option is on and first date and end date is entered.
default value:
' <hr />%DATE% - %ENDDATE%<br /><strong>%TITLE%</strong> <br />» <a href="%URL%">read more</a> « '

html_list_v4
(string) Used for rs_event_list(). Formats the output, if "multi-day"-option is on but no end date is entered.
default value:
' <hr />%DATE% (multi-day)<br /><strong>%TITLE%</strong> <br />» <a href="%URL%">read more</a> « '

html_post_v1
(string) Used for rs_event_post(). Formats the output, if first date and time of an event is entered with "multi-day"-option off.
default value:
' <div class="rseventpost">%DATE% @ %TIME%</div> '

html_post_v2
(string) Used for rs_event_post(). Formats the output, if first date but no time is entered with "multi-day"-option off; if %TIME% is used here anyway

(which usually does not make any sense), output of %TIME% equals "--:--".
default value:
' <div class="rseventpost">%DATE%</div> '

html_post_v3
(string) Used for rs_event_post(). Formats the output, if "multi-day"-option is on and first date and end date is entered.
default value:
' <div class="rseventpost">%DATE% - %ENDDATE%</div> '

html_post_v4
(string) Used for rs_event_post(). Formats the output, if "multi-day"-option is on but no end date is entered.
default value:
' <div class="rseventpost">%DATE% (multi-day event)</div> '

max_events
(integer) The maximum number of events to show. If this is set to 0, then all events will be shown.
default value: 0 (i.e. show all)

group_by_date
(integer) If this is set to No (value: 0), then each event will be separated into individual list element <li>. If this is set to Yes (value: 1), then the Date Formatting is checked for each post. Events with the same Date Formatting value are grouped together in a single <li> element, with the date first and subsequent posts separated by break rules <br>.
By setting the Date Formatting to different values, you can group by different date properties, e.g. use "Y" to group by year, or "W Y" to group by week.
default value: 0 (i.e. "no")

no_events_msg
(string) The output when the are no events within the set timespan.
default value: 'no upcoming events'

sort_order
(string) Whether to list the events in ascending (value: 'ASC') or descending (value: 'DESC') date order.
default value: 'ASC'

category
(integer) Show only events listed against posts in the category with this ID number. If this is set to 0, then all events will be shown.
default value: 0 (i.e. show all)



Customizing the html-output

The values "html_list_vX" and "html_post_vX" can be styled both for the widget and within templates. Simply use html-code and the following parameters:

%URL% the URL of the post with the event

%DATE% the start-date of the event, formatted as date_format_1 in _v1, _v2 and _v4 and as date_format_2 in _v3.

%ENDDATE% the end-date of the event, formatted as date_format_2

%TIME% the event time, formatted as time_format

%LOCATION% an ordinary text value which might be used to enter e.g. the location of the event

%TITLE% the title of the post.

%FULLTEXT% the entire text of the post.

%EXCERPT% the post excerpt.

%ID% the ID of the post.



How to pass on parameters to one of the functions

Here is an example of how to pass on some parameters to the function rs_event_list(), when used within a template. It works similar with rs_event_post() [and rs_event_post_return()], just use the html_post_vX parameters instead of the html_list_vX parameters.
Note: Parameters for the widget can be simply passed via the Widget-Panel of your blog-backend.

<?php         

    $argsevent = array( 
        'timespan'    => 60,
        'date_format_1'   => 'm|d|Y',
        'date_format_2'   => 'm|d',

        'html_list_v1'    => '<a class="list1" href="%URL%">%DATE%, %TIME%<br /><b>%TITLE%</b></a>',
        'html_list_v2'    => '<a class="list1" href="%URL%">%DATE%<br /><b>%TITLE%</b></a>',
        'html_list_v3'    => '<a class="list1" href="%URL%">%DATE% to %ENDDATE%<br /><b>%TITLE%</b></a>',
        'html_list_v4'    => '<a class="list1" href="%URL%">%DATE% (multiday!!!)<br /><b>%TITLE%</b></a>',
        'max_events'  => 4,
        );

    rs_event_list($argsevent); 
?>
Author: wp-lefty

Requires: 2.7 or higher
Compatible up to: 3.1.4
Last Updated: 2011-10-20 Downloads: 10,759

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(16 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

100,1,1
75,4,3 100,1,1
100,3,3 100,2,2
100,1,1
100,2,2
100,4,4
100,1,1
100,2,2
100,1,1