Quantcast
Channel: Events Manager for WordPress
Viewing all 394 articles
Browse latest View live

Modifying Placeholder Default Information

$
0
0

Some default placeholders can be directly modified with template files. However, since some placeholders require such small information, it’s not worth making every bit of information require a template file.

This also works exactly like creating your own custom placeholder, but instead you replace the contents that were previously being output compared to a blank string. In the following example, we’ll make a simple modification to the #_LOCATIONNAME placeholder.

add_filter('em_location_output_placeholder','my_em_placeholder_mod',1,3);
function my_em_placeholder_mod($replace, $EM_Location, $result){
	if ( $result == '#_LOCATIONNAME' ) {
		$replace = $replace . " plus some modifications";
	}
	return $replace;
}

Firstly, we add a function to the em_location_output_placeholder filter, which is just like the em_event_output_placeholder filter but for locations. This function will take three arguments:

  • $replace – is the value of what this placeholder would be replaced with (and since this is not an EM placeholder, this would always be an empty string)
  • $EM_Location – is the EM_Location object
  • $result - is the placeholder that was matched

By checking  $result we’re making sure we’re dealing with the right placeholder, and if we are, we can alter the $replace variable before it’s returned and change the placeholder information.

This doesn’t mean you can’t use template files should you want to, you can create your own file in your theme folder and link to it using the em_locate_template function during the filter that you would have to create in order to modify the placeholder contents. Here’s an example where I created a file in mytheme/plugins/events-manager/placeholders/locationname.php for more complex HTML

add_filter('em_location_output_placeholder','my_em_placeholder_mod',1,3);
function my_em_placeholder_mod($replace, $EM_Location, $result){
	if ( $result == '#_LOCATIONNAME' ) {
		ob_start();
		$template = em_locate_template('placeholders/locationname.php', true, array('EM_Event'=>$EM_Location));
		$replace = ob_get_clean();
	}
	return $replace;
}

Create a Custom Placeholder for Event Formatting

$
0
0

This tutorial forms part of our series of tutorials for creating an custom add-on for Events Manager called “Styles”, where we will be able to select from a list of styles during event registration. In our previous tutorial, we added a custom field to the events search form.

Events Manager uses placeholders like #_EVENTNAME so that you can easily insert
snippets of html via the events settings page and change the way events, locations, categories and contact information are displayed. Moreover, you can use these in shortcodes, template tags, or when directly working with objects.

The great thing about placeholders is you can easily insert chunks of information with one word. Events Manager 3 onwards also has the ability for you to use your own custom placeholders or modify the way the default placeholders work. This could have many uses:

  • Create a shortcut placeholder you can use across many formats.
  • Adding a new placeholder for extra event information you have added to Events Manager
  • Use placeholders to do execute custom PHP code whilst displaying event information.
  • Change the formatting or behaviour of current placeholders

In this tutorial, we’re going to extend our custom Events Manager addon “Styles” plugin by adding a #_STYLES placeholder, which prints a comma separated list of the styles our event has.

So, here’s the code needed to do this:

add_filter('em_event_output_placeholder','my_em_styles_placeholders',1,3);
function my_em_styles_placeholders($replace, $EM_Event, $result){
	global $wp_query, $wp_rewrite;
	switch( $result ){
		case '#_STYLES':
			$replace = 'none';
			if( count($EM_Event->styles) > 0 ){
				$my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array();
				$styles = array();
				foreach( $my_em_styles as $id => $name ){
					if(in_array($id, $EM_Event->styles)){
						$styles[] = $name;
					}
				}
				$replace = implode(', ', $styles);
			}
			break;
	}
	return $replace;
}

We start off by adding a filter for the ‘em_event_output_placeholder’ filter. This function will get called every time a placeholder is found and needs replacing. This filter returns three variables; $replace is the value of what this placeholder would be replaced with (and since this is not an EM placeholder, this would always be an empty string), $EM_Event is the EM_Event object, and $result is the placeholder that was matched.

We use $result to check for the use of our custom placeholder #_STYLES. If we find a match, we will firstly set the default replacement to ‘none’ so that if nothing is found a blank value isn’t used

Lets focus on this bit:

if( count($EM_Event->styles) > 0 ){
	$my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array();
	$styles = array();
	foreach( $my_em_styles as $id => $name ){

Here we double-check the object is EM_Event and has more than one style, which we loaded on event instantiation.

If styles exist, we load the full list of styles from the wp_options database into $my_em_styles and loop through them to obtain the names of the style ids this event has. As we find the relevant styles, we add them to a $styles array and output that as a comma separated list.

As you can see, the possibilities are endless once you’ve hooked into the right placeholder name. We’ll leave that bit up to you….

In the following tutorial, we’re going to learn how to create a custom conditional placeholder for your events.

Creating Conditional Placeholders for Events

$
0
0

In our previous tutorial in this series we created a custom placeholder for our “Styles” example add-on for Events Manager. We will now do something similar but with a very different purpose, add CONDITIONAL placeholders for our events.

Each event can have a unique combination of certain enabled/disabled features such as bookings, event prices, attributes, recurrences etc. The problem with placeholders and the use of event formats is that without using PHP, we previously had no way of disabling certain content such as removing booking forms and buttons if there are no bookings. Events Manager 4.0 allows custom placeholders such as {has_bookings}this, and these contents would only appear if my event had bookings{/has_bookings}.

We would really benefit from having custom placeholders like that so we can tell if our event has a specific style. Note the last bit of that sentence… SPECIFIC style. We’ll add a twist here to show how flexible this can be with a little creativity.

add_action('em_event_output_condition', 'my_em_styles_event_output_condition', 1, 4);
function my_em_styles_event_output_condition($replacement, $condition, $match, $EM_Event){
	if( is_object($EM_Event) && preg_match('/^has_style_(.+)$/',$condition, $matches) && is_array( $EM_Event->styles ) ){
		if( in_array($matches[1],$EM_Event->styles) ){
			$replacement = preg_replace("/\{\/?$condition\}/", '', $match);
		}else{
			$replacement = '';
		}
	}
	return $replacement;
}

We begin by hooking to the em_event_output condition (note that same principle would apply for locations and categories).

if( is_object($EM_Event) && preg_match('/^has_style_(.+)$/',$condition, $matches) && is_array( $EM_Event->styles ) ){

This is the most important line in our function. To avoid any runtime errors, we’ll just return the original replacement value if the $EM_Event isn’t an object. The preg_match method runs a regex matching operation to make sure we’re dealing with a conditional placeholder with the name of has_style_x , where x is the id number of that style. The last function is just a precaution to avoid unexpected PHP warnings in case the styles weren’t loaded correctly, but we could probably even do without it (as a plugin dev it’s now a habit for me).

This regex also stores the found number in the $matches array, which we use in the next line to check if this event has this style id in its styles array. If it does, we remove the start and end placeholder tags with a preg_replace statement and return the contents, otherwise we just return a blank string.

You can use this function within any formats that accept Event placeholders from within your settings page, shortcode, template tags or directly accessing the event objects. In our next tutorial, we’re going to create a custom event information page which will show a list of styles and display the upcoming events under each style, as well as our single style pages.

Create Custom Event Information Pages

$
0
0

We’re continuing our series of tutorials for our custom add-on called “Styles” by creating a custom page that will dynamically display a list of all available Styles and upcoming events associated with it. We had previously added a custom conditional placeholder for styles.

Creating our own content pages that are generated by Events Manager is pretty straightforward, and only requires us to hook into two filters, the em_content_pre and em_content_page_title_pre filters.  These filters are called before Events Manager generates any output, meaning we can decide first if something needs to be shown and save some unnecessary processing.

It is also possible to modify or override event page information using em_content and em_content_page_title filters too.

So, without further ado, here is the function that displays the styles page:

add_filter('em_content_pre','my_em_styles_content');
function my_em_styles_content($content){
	global $wp_query;
	$my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array();
	if( is_numeric($wp_query->get('style_id')) ){
		$content = EM_Events::output(array('style'=>$wp_query->get('style_id')));
	}elseif($wp_query->get('styles_page')){
		$content ='';
		foreach($my_em_styles as $style_id => $style_name){
			$content .= "<h4>$style_name</h4>";
			$content .= EM_Events::output(array('style'=>$style_id));
		}
	}
	return $content;
}

What we’re doing here is intercepting the em_content_pre filter and checking if there were any querystring variables indicating we need to show our styles page. We also load style data into $my_em_styles from the database in order to access style names.

In this case, we’ll show a single style page if style_id is a numeric ID, and show a page of styles if styles_page is set to 1. Note that when showing a styles page, we loop through each style in the $my_em_styles array and feed the style ID into an EM_Event output function. This was made possible by adding custom

If we are supposed to show our custom pages, we need to add our content to the $content variable and return it regardless of whether we changed the value at all. When using em_content_pre, $content will usually be given to you with a blank string value, if you add any content to that and return it, Events Manager will stop trying to show the default content and let wordpress finish loading the rest of the page.

Next, we need to modify the titles of the page.

add_filter('em_content_page_title_pre','my_em_styles_content_page_title_pre');
function my_em_styles_content_page_title_pre($content){
	global $wp_query;
	$my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array();
	if( is_numeric($wp_query->get('style_id')) ){
		$content = $my_em_styles[$wp_query->get('style_id')];
	}elseif($wp_query->get('styles_page')){
		$content ='Styles';
	}
	return $content;
}

We now hook into the em_content_page_title_pre filter, but as you can see the only changes are the filter and function names and the values set in $content. Like with em_content_pre, by returning content via $content, Events Manager will not try to create its own event titles.

To access this new page, we would access a site url similar to mysite.com/eventspage/?styles_page=1

This isn’t very pretty, and looks out of place when using permalinks everywhere else, so we will proceed with creating some custom permalinks for these pages, so that they look like part of the plugin and better yet provide greater SEO value to your site.

Creating Custom Permalinks in WordPress

$
0
0

This tutorial forms (the final) part of our series of tutorials for creating an custom add-on for Events Manager called “Styles”, where we will be able to select from a list of styles during event registration. In our previous tutorial we created our own custom event pages for our Styles.

For those that don’t know, permalinks are those pretty formatted links you see on websites such as this page you’re reading (I hope)! They’re more commonly known as SEO-Friendly or clean urls.

WordPress allows you to run your site with permalinks turned off or on. It also automatically handles redirections if you switch from non-permalinks to a permalinks site. For example, the page http://wp-events-plugin.com/?p=442 is the non-permalink equivalent of what you see in your address bar.

In this tutorial, we’ll be continuing our extension of our custom Events Manager add-on. We previously created our custom styles pages and now we need to add permalinks to the mix so that the pages don’t have ugly urls like mysite.com/eventspage/?styles_page=1 whilst the rest of your site doesn’t.

This tutorial sort of doubles as a wordpress tutorial (although I found the codex tutorial most helpful when creating permalinks in Events Manager) as this principle could be adapted to work for any plugin. This doesn’t use any plugin-specific functions whatsoever.

Creating the rewrite rules

Firstly, we’ll have to add some rewrite rules to the array. We’ll hook into the rewrite_rules_array filter and add our own rules to the $rules array. For the purposes of this example, we’ll assume our events page is located at our imaginary site mysite.com/events/ What we want to acheive is the following:

  • mysite.com/events/styles/ – displays the list of styles and upcoming events
  • mysite.com/events/style/id#/ – displays the single style name with this id and its upcoming events
add_filter('rewrite_rules_array','my_em_styles_rewrite_rules_array');
function my_em_styles_rewrite_rules_array($rules){
	//get the slug of the event page
	$events_page_id = get_option ( 'dbem_events_page' );
	$events_page = get_post($events_page_id);
	$my_em_rules = array();
	if( is_object($events_page) ){
		$events_slug = $events_page-&gt;post_name;
		$my_em_rules[$events_slug.'/styles$'] = 'index.php?pagename='.$events_slug.'&amp;styles_page=1'; //styles list
		$my_em_rules[$events_slug.'/style/(\d+)$'] = 'index.php?pagename='.$events_slug.'&amp;style_id=$matches[1]'; //single style
	}
	return $my_em_rules + $rules;
}

The first four lines involve retrieving the url of the events page and deciding to add our rules only if there is a valid events page. Lines 8 and 9 are the redirection rules, which use regex to identify when we access style pages.

$my_em_rules[$events_slug.'/styles$'] = 'index.php?pagename='.$events_slug.'&amp;styles_page=1'; //styles list
$my_em_rules[$events_slug.'/style/(\d+)$'] = 'index.php?pagename='.$events_slug.'&amp;style_id=$matches[1]'; //single style

The first line will only catch our styles list page. Since we don’t need to obtain any information from here, we’ll just add an extra querystring variable called styles_page and set it to 1.

The second line handles requests for specific style pages. The (\d+) bit will catch the id number and when we pass $matches[1] into the style_id querystring variable it will be replaced by the actual number in the requested url. If this stuff confuses you, you should read up more on regex and the preg_match php function

Register your querystring variables

That was the hard part… the rest is a piece of cake! Now that we’ve added our rewrite rules, we also need to register the new GET parameters we just created, as they will not be made available to the $wp_query object, which can have various adverse implications.

add_filter('query_vars','my_em_styles_query_vars');
function my_em_styles_query_vars($vars){
	array_push($vars, 'style_id','styles_page');
    return $vars;
}

All we’re doing here is pushing our variable names into the $vars array, and passing it back onto the query_vars filter.

Flush the rewrite rules

Next, we need to tell WordPress to flush the old permalink rules and rebuild them so they include our new permalink structures. To do that, we could use the following:

function my_em_rewrite_flush(){
	global $wp_rewrite;
   	$wp_rewrite-&gt;flush_rules();
}
add_action('init','my_em_rewrite_flush');

For the purposes of our example add-on, we will not need this, because Events Manager flushes rewrite rules on activation/deactivation. Do bear in mind that this shouldn’t be called on every page load (the above is an example only), only when there is a change to the permalink rules.

Overriding Event Page Content With Filters

$
0
0

When users access the events page, Events Manager decides what to show based on the rest of the URL. So, for example, mysite.com/eventspage/locations/ or mysite.com?p=x&locations_page=1 would return a list of current locations.

There may be times where you want to override certain content generated by Events Manager either replacing it entirely, replacing parts, or adding to the default html generated. If we use the wordpress filters em_content and em_content_pre, we can intercept the output process and add what we need.

em_content_pre

This filter is best used if you want to prevent Events Manager from trying to output content altogether. In some cases you may want to add your own custom pages, and therefore it would make sense to check for this first before EM goes and does unnecessary work.

This works pretty much exactly like em_content, except a second parameter is passed to your function, which is the original content of the wordpress page that will be overwritten by Events Manager. To find out how to use em_content_pre, we have a tutorial for creating a custom event information page

em_content

If you need to add certain content to event pages, or do further processing on the HTML output of Events Manager, this is the filter for you!

function my_em_custom_content($content){
	if( /* Do something here to decide whether to override */ ){
		$content .= "Here, I'm adding this extra text to the end of my event content.";
	}
	//Whatever happens, you must return the $content variable, altered or not.
	return $content;
}
add_filter('em_content','my_em_custom_content');

Note that if you want to change the title text (e.g. the texts that appear in your window title bar and the title of the event), you should also hook into the em_content_page_title filter, which works exactly like the em_content filter. In fact, you only should need to change your function name (so there’s no duplicates), filter name and custom content to get this to work:

function my_em_custom_content_title($content){
	if( /* Do something here to decide whether to override */ ){
		$content .= "My Custom Title";
	}
	//Whatever happens, you must return the $content variable, altered or not.
	return $content;
}
add_filter('em_content_page_title','my_em_custom_content_title');

Trigger a Plugin Update or Activation

$
0
0

There have been some occasions in the past where for some reason or another when updating the plugin, the right functions were not fired which are sometimes to update parts of Events Manager such as the database structure or updating settings.

In most cases, this is easily remedied by deactivating and reactivating the theme, but sometimes this still doesn’t trigger the update. The way to force an update is to go to yoursite.com/wp-admin/options.php and look for a dbem_version value.

Whatever that value is, lower it by the minimum amount possible. For example this screenshot shows version 4.019, so we want to set this to 4.018 and click the save button at the bottom.

Now, we just need to go to the plugins page and de/reactivate the plugin.

Modifying Event Location Google Maps

$
0
0

“How do I modify the centering of the maps?”
“How can I do x to the maps?”

These are very common (and valid) questions! Currently, integration with Google Maps is fairly limited and is something we intend to remedy in the future. However, as always we try to make it possible for developers to do their thing in a upgrade-safe manner.

How Google Maps work in Events Manager

Firstly, let me quickly explain how maps work in Events Manager (this will probably go into documentation rather than tutorials in the future).

Google Maps itself is loaded and handled purely by javascript, all of it located within the includes/js/events-manager.js file (or events-manager-source.js for viewing purposes 4.0 onwards). When maps are “created” by Events Manager, it just creates the grey loading map div class and a couple of other elements with some data for the javascript to retrieve and use to build the maps. Here’s what’s output by a single event map:

<div id="em-location-map-f3d18" class="em-location-map" style="background: #<span class=;">CDCDCD; width: 400px; height: 300px">Loading Map....</div>
<div class='em-location-map-info' id='em-location-map-info-f3d18' style="display:none; visibility:hidden;">
<div class="em-map-balloon" style="font-size: <span class=;">12px;"></div>
		<div class="em-map-balloon-content" >Balloon Content Here</div>
	</div>
</div>
<div class='em-location-map-coords' id='em-location-map-coords-f3d18' style="display:none; visibility:hidden;">
	<span class="lat">123</span>
	<span class="lng">123</span>
</div>

As you can see there’s two hidden divs with the balloon contents and also some coordinate information for Google Maps to center on. When a page is loaded, the javascript checks for the location map divs by class and loads google maps only if it finds one.

After loading the map, a specific jQuery event is triggered, called em_maps_location_hook, which passes the map data onto event listeners.

Modifying maps with javascript

To make modifications via javascript, you need to bind a function to this javascript event, you can do this at any point in your theme or in another javascript file:

jQuery(document).bind('em_maps_location_hook', function( e, map, infowindow, marker ){
	....
});

The three variables this function accepts are:

  • map – this is a Google Maps Map object
  • infowindow – a Google Maps InfoWindow object attached to marker
  • marker – the Google Maps Markerobject attached to map

The map has been loaded, so at this point the changes you make are final.

For the global maps, it’s the same principle, except the hook is called em_maps_locations_hook and one variable is supplied which is an array of markers.

Modifying maps with templates

The HTML generated resides in two files that you can override using template files to customize the HTML, and you could even remove the classes that trigger the Javascript and handle it yourself. The maps templates are located in two places:

  • templates/map-global.php – this is the multi-locations map
  • placeholders/locationmap.php – this is #_LOCATIONMAP placeholder

Modifying the Event Calendar HTML

$
0
0

The event calendar, as with most other part of Events Manager, can be modified using template files. By adding a specific file to your theme folder which overrides the default calendar format, you can use the information passed on by Events Manager to generate the calendar to your exact specifications.

There are two files for calendars, both which are located within the templates/templates folder:

  • calendar-full.php – This is the full calendar, which is called if you modify your Event Page settings or use full=1 in shortcodes or ph functions.
  • calendar-small.php – This file is used to generate widgets and default calendars where the full=1 attribute was not passed.

There are two variables which are made available to you inside both files:

  • $calendar – contains an array of information regarding the calendar and is used to generate the content
  • $args – the arguments passed to EM_Calendar::output() and was used by EM_Events::get() to retrieve the correct event information

$calendar looks something like this (this is not PHP, just the summarized result of a print_r statement):

Array(
	[cells] => Array(
		[2011-03-28] => Array(
			[date] => 1301270400
			[type] => pre
			[link_title] => Event Name
			[link] => http://mysite.com/events/2011-03-28/
			[events] => Array (
				[0] => EM_Event Object
			)
		)
		[2011-03-29] => Array	(
			[date] => 1301356800
			[type] => pre
		)
		[2011-04-01] => Array	(
			[date] => 1301616000
		)
		[2011-04-02] => Array	(
			[date] => 1301702400
			[link_title] => Event Name 1, Event Name 2, etc.
			[link] => http://mysite.com/events/2011-04-02/
			[events] => Array (
				[0] => EM_Event Object
				[1] => EM_Event Object
				etc.
			)
		)
		.....
		[2011-04-30] => Array (
			[date] => 1304121600
		)
		[2011-05-01] => Array	(
			[date] => 1304208000
			[type] => post
			[link_title] => Event Name 1, Event Name 2, etc.
			[link] => http://mysite.com/events/2011-05-01/
			[events] => Array (
				[0] => EM_Event Object
				[1] => EM_Event Object
				etc.
			)
		 )
	)
	[month_start] => 1301616000
	[month_next] => 5
	[year_next] => 2011
	[month_last] => 3
	[year_last] => 2011
	[links] => Array(
		[previous_url] => ?ajaxCalendar=1&amp;month=3&amp;year=2011&amp;
		[next_url] => ?ajaxCalendar=1&amp;month=5&amp;year=2011&amp;
	)
	[row_headers] => Array (
		[0] => M
		[1] => T
		[2] => W
		[3] => T
		[4] => F
		[5] => S
		[6] => S
	)
)

$calendar['cells'] will contain an array with the exact number of days required to fill a calendar grid format. Each array item has a yyyy-mm-dd date key and can contain various attributes:

  • date (required) – This is a unix timestamp of that date.
  • type – The type of date which can consist of three possible values, pre, post and today, which if present means that this day in question falls in the previous month, next month or today respectively
  • link_title – The title of the anchor tag linking to the calendar day page.
  • link – The link to the full list of events that day.
  • events – An array of EM_Events which occur on that day.

Aside from the individual day information, some more variables are passed on to aid in making this calendar work.

  • month_start – timestamp for the first day of the month
  • month_next – next month number value (1-12)
  • year_next – next year number value (e.g. 2011)
  • month_last- next month number value (1-12)
  • year_last- next year number value (e.g. 2011)
  • links – An array of the previous and next links
  • row_headers – Array of calendar column header names for $calendar['cells'] which will always divide evenly by the number of row_headers

Using the above information, you can determine everything you need to display custom calendars, or just make minor changes to the current calendar templates. Simply copy either or both calendar templates to your theme folder as instructed here and make your changes.

Caching thumbnails generated by TimThumb

$
0
0

Events Manager uses TimThumb to generate images. This is a great bit of script that makes showing thumbnails of any size very quick and very easy.

The major downside of TimThumb though is that every time you show a thumbnail on your page, the link to the image is actually to a timthumb.php file which then generates a thumbnail or grabs a cached version from our uploads/em-cache directory. The fact that there already is some form of caching is great, however there is a unecessary load on the server since each time you request a thumbnail some PHP processing is needed to serve the file. This becomes a bigger problem when you’re showing many thumbnails on one page and/or have high volumes of traffic.

Fortunately there is a solution! In particular you can use the combination of a caching plugin along with a CDN, which can store cached versions of your timthumb images without accessing your server each time for the same thumbnail.

In this example, we’ll highlight how you can use the popular W3 Total Cache plugin and Amazon CloudFront. This tutorial expands on suggestions already made by Ben Gillbanks at BinaryMoon (current maintainers of TimThumb).

We’re not going to cover how to set up W3TC, we’ll assume at this point you’ve already successfully set up a CloudFront CDN and your normal images, stylesheets and scripts are already being correctly served by the CDN. If you look at a thumbnail generated by EM, you’ll notice that it is not being served by the CDN yet, as there’s two steps you need to take.

1. Add a Behaviour for TimThumb on CloudFront

By default, CloudFront urls will not accept and pass on Query Strings, meaning timthumb.php will not receive the relevant information it needs to find the right thumbnail and return the right size. However, it is very easy to add a rule to your CloudFront account which will allow this to happen.

Firstly, visit your CloudFront management console, you will see a list of your current distributions as seen below. You then need to access the distribution settings for the site you are working on by clicking the information icon (the grey i icon).

Then, visit the Behaviours tab, the screenshot below shows a CDN with the behaviour we’ll be adding already there, chances are you’ll only see one row.

Now you’ll create a behaviour which will allow timthumb.php requests to have querystrings passed on. Click the Create Behaviour button and fill out the form to contain these values:

Path Pattern : */timthumb.php
Origin : Choose an origin from the dropdown, by default you only have one to choose
Forwarded Query Strings : Yes

You’re done configuring CloudFront. In the event that you’ve done this step after step 2, if you test this out you’ll still see errors because you are still viewing incorrectly cached versions of your thumbnails, you should visit the invalidations tab (or use the purge tool in W3TC) and invalidate the current cache of your timthumb.php file. After a few minutes it will start working as expected.

Now onto configuring W3TC

2. Configure W3TC to use the CDN for TimThumb images

Visit your W3TC CDN settings and scroll down to the advanced options.

You’ll see an option called Custom file list, in this textbox add a new line and write timthumb.php or alternatively the full path to your Events Manager timthumb file which is by default wp-content/plugins/events-manager/includes/thumbnails/timthumb.php

Save your settings, purge your page cache  if applicable.

3. Test your site

That’s it! It’s time to check out your site, if you view the source of your thumbnails they should now be pointing to your CloudFront CDN url!

If all is done well, then you should start seeing decreased page loading times and server loads.

5.2.6 and Pro 2.2.3 Released

$
0
0

Released late last week actually, but here’s a breakdown of the changes!

5.2.6

  • changed validation order for bookings (no validation done in EM_Event::get_post())
  • EM_Tickets_Bookings::$tickets_bookings now an associative array, keys are ticket id
  • EM_Notices now accepts 2 level arrays for nested errors
  • added em_bookings_table_export_options, em_bookings_admin_ticket_row actions
  • added em_bookings_table_get_headers filter
  • admins can now manually approve bookings regardless of whether events are fully booked and overbooking enabled
  • fixed search page bugs
  • removed some unecessary validations on get_post functions, assumed these are only run on validate() and save(), eventually it’ll just be validate()
  • fixed js issues when updating ticket options with checkboxes
  • hooked into the_excerpt_rss filter to allow overriding event formats on normal rss feed
  • fixed recurring event not correctly saving timestamps
  • fixed minimum spaces problem on booking form, added ‘required’ tickets option to allow more possibilities
  • fixed js incompatability
  • fixed link on single booking admin page if user is a guest in no-user mode
  • updated German, French, Hebrew, Dutch, added partial Chinese translation
  • hid some unecessary localized JS strings depending on what features are enabled (bookings/recurrences)
  • fixed negative non-existant category id searches showning no events instead of all events
  • fixed pagination problem on templates/calendar-day.php
  • added js triggers em_booking_error and em_booking_complete
  • fixed event price placeholders not accounting for unavailable tickets

Pro 2.2.3

  • added attendee forms – alpha – add define(‘EM_ATTENDEES’,true); to your wp-config.php file
  • fixed some display / validation errors in booking forms when modifying booking
  • fixed #_BOOKINGTXNID returning placeholder if there’s an empty value, now returns an empty value
  • fixed minimum spaces calculations for attendees, as per fix in 5.2.5.2
  • fixed non-editable user fields breaking validation
  • updated German translation
  • fixed link still showing on the single booking view to the assigned default user for no-user bookings
  • hid some js localized vars if bookings disabled

Updated demo, new Pro trial site!

$
0
0

For those of you wanting to see EM and EM Pro in action, check out our newly updated demo site which has undergone a small face-lift.

The first, most obvious thing is the theme… we’ve gone and installed the latest Twenty Twelve theme which will be available by default on WordPress 3.5 and is already available on the theme repo. As usual, the WP theme design team have outdone themselves!

Additionally, we’ve added more custom forms and form fields for people to show some of our recently added features  as well as including our new Attendee Fields feature which is still in Alpha, but can already be enabled in the latest update.

Another cool thing is that we’ve added sandbox PayPal and Authorize.net accounts and set them up so it’s easy to make test transactions with dummy accounts and see the exact booking process from a customer’s point of view! Authorize.net requires no extra steps, just a fake card number as seen when booking, PayPal unfortunately does require that you register at their dev site and create a test account.

Alongside all this, you’ll see more explanations regarding the functionality, and eventually we hope to add a ‘how we made this’ page so that you can see every change we made to the default settings (which aren’t that many) to make this site look like it does.

Last but not least, for those of you wanting to try out EM and/or Pro, check out our new trial site and take it for a free 7 day spin!

This will be the start of some major changes that we’ll be rolling out over the coming weeks, so stay tuned for more!

Events Manager 5.2.7 Released

$
0
0

We’ve released another minor update with various tweaks and improvements.

Expect a release for Pro within a few days, mostly including more minor fixes, but also with the Attendee forms coming out of alpha into beta!

Template files affected

A few template files required tweaking to fix/improve certain aspects, here’s a summary:

  • /templates/forms/bookingform/ticket-single.php
    • added ticket-price class to p tag surrounding ticket price
  • /templates/forms/event-editor.php
    • added condition on last few lines to prevent tickets overlay form from being output
  • /templates/forms/event/location.php
    • fixed private locations showing to users when using drop down selection of locations on event editor
  • /templates/placeholders/attendees.php
    •  added fix to include non-registered attendees when in no-user mode (recommended)
  • /templates/placeholders/attendeeslist.php
    • added fix to include non-registered attendees when in no-user mode (recommended)
  • /templates/tables/locations.php
    • removed a loop regarding offsets (recommended)

For an exact summary of all changes to these files, view the diffs on the wordpress.org trac

Changelog

  • fixed min ticket space number calculation issues in booking forms
  • fixed multiple admin emails for event submission by members with publish rights
  • added em_bookings_ajax_complete/error jquery events/hooks
  • updated/added Swedish, Chinese, and Finnish translations, kudos to Tommy Wahlund, Leonardo Losoviz and @Daedalon respectively
  • fixed mailer charset problem in SMTP mails
  • added dbem to some __ functions
  • added ticket-price class to single ticket booking form html
  • fixed datepicker breaking on themes inserting br tags into search/booking forms
  • fixed html email setting not working in MultiSite
  • added Guadaloupe to countries list
  • added em_csv_header_output action (e.g. for Excel hack)
  • changed/prevented registration email going out until after booking is completely saved
  • added filter em_object_json_encode_pre
  • fixed country searches on events page/search form
  • added conditional placeholders is_private not_private is_recurrence not_recurrence
  • fixed #_EVENTEXCERPT not having formatting filters applied
  • changed the_content run at priority 9 for category pages
  • fixed private location autocomplete/search issues
  • fixed recurrences not being deleted when done from front-end
  • fixed edit user link on booking admin area
  • fixed edit location link showing to all
  • fixed typo in map balloon hint on settings page
  • removed default contact person setting (used in < v5.0, now uses author)
  • added width/height property to thumbnail img html
  • fixed deleted MS subsites not deleting events/locations from global tables
  • fixed maps showing undefined fields on first load of edit event with location ddm enabled
  • fixed non-registered attendees not being included in no-user mode for #_ATTENDEE and #_ATTENDEELIST
  • fixed front-end location admin pagination
  • reduced sql statements for county my/all locations on front-end locations admin page
  • fixed select all ui problem (thx @Daedalon)
  • fixed array_key_exists php warning in EM_Object::can_manage
  • changed is_main_blog to is_main_site
  • added grandchildren detection when generating permalink rules for events page
  • added auto br to emails option in email settings

5.2.8 (hotfix) Released

$
0
0

Within a few hours of releasing 5.2.7, some users reported two issues with the plugin, which included:

  • The category page content not showing up.
  • The end date picker whilst saving correctly, loaded the start date when refreshing the edit page.

These are bugs that needed immediate fixes, so less than 24 hours have past and we have a new update to 5.2.8 which fixes the above.

We apologize for any inconvenience caused, sometimes bugs get through, but rest assured that they will always get fixed ASAP!

5.2.9 and Pro 2.2.4 Released

$
0
0

Another update, various improvements!

One notable improvement is that our Attendee forms is now in Beta and available for use in Pro 2.2.4 within the Form Editor admin area. This has undergone a fair amount of testing, and the main thing preventing this from coming out of beta is lack of documentation, which we’ll be remedying very soon. However, given the interface is near identical to the normal Booking Forms editor, we hope you’ll be up and running in a few clicks.

We’re also in the middle/end of some big improvements to our site, some even bigger ones regarding the inner workings of the site, which we’ll explain (and you’ll see!) within a couple of weeks when we launch  Thanks for your patience whilst we shift some of our focus on these important improvements, we’re looking forward to finishing this off and having more time than ever to focus exclusively on making EM and Pro even more awesome!

5.2.9

Modified Templates

There were a few modified template files, but very minor changes that shouldn’t affect functionality. The only one that you’d benefit from updating if overridden is events-search.php, which would only help if you’re using MultiSite with global events enabled.

 Changelog

  • updated BuddyPress integration to add links to the new BP/WP toolbar
  • added spaces to comma seperators of location on locations admin table
  • improved user deletion hook, bookings now get deleted along with user
  • replaced depreciated placeholders in default widget values
  • added booking form anchor to action url
  • updated POT file and Swedish
  • added Japanese, kudos to Kenta Sakamoto
  • fixed minimum ticket space value not allowing 0 spaces even if ticket not required
  • added em_event_save_events_slug filter
  • added $EM_Event to all do_action parameters on templates/placeholders/bookingform.php
  • changed #_MAP to #_LOCATIONMAP on installation defaults
  • wrapped bookings dashboard sections into divs with class names
  • fixed formatting links/texts in settings page tips
  • added em_options_booking_form_options action and save button on settings page > bookings > booking form options
  • fixed use of global $wp_query when passed within parse_query action – thx Scott @ Pods framework plugin
  • added wp_dropdown_pages instead of manual page select generation
  • fixed usage of outdated user_firstname/user_lastname property for EM_Person::get_name()
  • improved ticket minimum calculation (takes into account if ticket is only ticket in event, therefore required)
  • fixed EM_Tickets and EM_Tickets_Bookings not storing ticket/ticket_bookings array key by ticket id
  • locations list format header and footer now install ul by default, if blank no wrapped ul is used (which previously contained an ‘a’ outside an li)
  • small fix to em_content_categories_args, now applied to EM_Categories::get() and EM_Categories::output() in templates/categories-list.php
  • shortened gcal link some more to prevent some (rare) “404 url too long” errors
  • added login redirection to same page in login link of my bookings page

Pro 2.2.4

It’s important that when upgrading Pro you also upgrade EM to 5.2.8

  • fixed attendee forms committing first attendee in each ticket
  • fixed attendee #NUM# not being converted if not in an html element
  • fixed tips not being added to dynamic attendee fields
  • fixed radio and checkboxes not being read properly for attendees
  • updated Swedish
  • updated bookings currency tip link
  • added $field info to emp_forms_output_field filter
  • changed user creation/deletion in first-registration failed authorize.net bookings to use internal account creation timer
  • fixed event reminders not reading booking placeholders
  • fixed/improved first-time user deletion on bad authorize.net card data
  • changed paypal cron hook em_cron_hook to em_paypal_cron
  • fixed pending individual ticket counts with PayPal bookings in progress/reserved
  • added condition to not validate #_BOOKINGBUTTON bookings
  • added complete activation/deactivation of attendee ticket functions
  • changed is_main_blog functions to is_main_site
  • updated pot file, Swedish
  • added check for paid bookings with no gateway choice (anti-spam/hack)
  • added Japanese
  • removed site language option (repeated option, typo)
  • added all countries for paypal destination site language
  • prevented/fixed various php warnings
  • removed parse_query hook for permalink gateway handling (i.e. catching paypal IPNs), gateways now use a direct wp-admin/admin-ajax.php… url
  • fixed validation of manual bookings and editing of bookings forcing address fields, changed priority of EM_Booking_Form booking interception
  • moved ticket/booking pending space calculations to base gateway class, now accounts for all gateways
  • fixed person data not being saved to EM_Person instance on first booking
  • fixed attendee form loading depending on default tickets (based on introduction of EM_Ticket::is_required() in EM 5.2.9)
  • fixed EM_Person information not being saved to instance on first booking, causing authorize.net to not retrieve first/last name correctly
  • removed custom html from form when editing a booking
  • improved default attendee form to include attendee #NUM#
  • attendee fields is now beta and ready to go

5.3 and Pro 2.2.5 Released

$
0
0

5.3

Template File Changes

There is one small but important line to add if you are using our Attendee forms and you’ve overridden templates/forms/bookingform/ticket-single.php. See the diff for details on where to add this line  on your template if so.

Changelog

  • corrected date_format/dbem_date_format typo on templates/templates/my-bookings.php
  • fixed calendar links with extra search args if using non-permalinks
  • fixed some non-translated strings
  • updated pot file
  • added em_booking_add_registration_result filter
  • fixed add_user_to_blog on MS bookings not providing a default role
  • fixed navbar issue for blogs with events page assigned to homepage
  • updated Dutch translation, thanks to Arnout Eykelhoff
  • partially-updated Russian translation, thanks to Evgeniy Efimenko
  • fixed #_EVENTNOTES being converted before other placeholders, which potentially caused problems if using shortcodes with formats
  • updated Chinese thanks to Leo Losoviz
  • added #_ATTENDEESPENDINGLIST
  • improved JS compatibility with booking form (spinner and jumping up to errors/confirmation feedback)
  • fixed reserved pending spaces not being approvable if event is full
  • fixed categories and other plugin postmeta not being duplicated with event
  • fixed admin emails not going out if setting of admin emails contains spaces
  • fixed blog search filter not allowing comma seperated values e.g. 1,2,3
  • improvements to listings, edit pages and admin linking of locations on MS Global setups, especially if locations are restricted only to main blog
  • adjustment to title rewriting, fixing issues such as calendar day pages not having custom titles
  • event end time js not failing validation if event dates span
  • fixed locations not publishing on anonymous submission even if publish_locations is correctly enabled for assigned anon user
  • added second em_booking_form_ticket_spaces action to templates/forms/bookingform/ticket-single.php fixes attendee field not showing for single/last ticket/space bookings
  • reverted to previous use of global $wp_query in parse_query filters with additional fix to prevent clash with Pods framework

Pro 2.2.5

Aside from some translation adjustments and a full translation of Chinese, we’ve also made a minor fix to the reservation of pending spaces with gateways preventing manual approval of these reserved bookings if the booking is full. Some other functionality has been improved (particularly in some specific event booking settings combined with our new Attendee Forms feature) but these corrections were made to the main/free plugin.

5.3 is required for this update (although 5.3 can still run older versions of Pro). Please make sure you update both plugins if you upgrade Pro as well!

Changelog

  • fixed some non-translated strings
  • updated the POT file
  • added Chinese translation, thanks to Leo Losoviz
  • fixed pending/reserved spaces not being approvable, requires EM 5.3 to work

5.3.1 Released

$
0
0

This release fixes some minor issues, but notably also potentially fixes some plugin conflicts particularly with MailPress and other mailing plugins, due to their incorrect usage of the_content OUTSIDE the loop (see the WP docs, first line).

Changeset

  • Updated russian translation, thanks to Alexander Tsinkalov
  • improved how EM hooks into the_content and similar template tag hooks to improve compatibility with other plugins incorrectly using this outside the loop
  • fixed rsvp cut-off time not being considered
  • fixed missing $ in admin_capability variable of EM_Object::can_manage()
  • added recurrences search attribute
  • corrected some typos in category event form class, recurrence description
  • prevented spaces in comma-delimited email lists failing email validations
  • fixed bp event profile page urls breaking when event slugs contain slashes
  • updated [events] and [location] to default to use globals if no ids passed on, so it can be used in location/event descriptions
  • added resubmitted event confirmation messages
  • Updated Spanish translation – thanks to Ponç Joan Llaneras

New look, new logo, bring on 2013!

$
0
0

It’s been months in the making, but we’re finally here. Welcome to our new Events Manager and Events Manager Pro websites!

A brand new look

We’ve completely revamped our website, which also includes the unveiling of our new snazzy logos. Moreover, we’ve moved all Pro related downloads and support forums to eventsmanagerpro.com making this site an informational site which includes plugin info as well as docs, tutorials and more on the way.

Improvements to inner workings of our site

Another important move, which may go unnoticed (and rightly so!) is that we’ve switched membership plugins to the awesome s2Member Pro plugin, which is infinitely more flexible and reliable than the old one we originally went with, which prevented us from hitting the ground running first time round as we spent the first two months troubleshooting our support forums and other plugin-related issues.

New Dev License

We’ve also introduced a Developers/Multiple Sites License. The Pro Dev license  provides the same functionality and support as the single Pro license does, but allows usage on 5 seperate websites.

Special Offer! To celebrate this new license, and to thank our loyal customers, we’re making a special offer until the end of 2012 for any users who signed up for Pro until now. Get UNLIMITED sites for the same price as a normal Dev license. Just log into our new Pro site with your usual credentials and you’ll see a link to renew/upgrade from your account page.

Big Thanks

We’d like to thank a few people and companies for making this move possible and our lives infinitely easier.

Ben Dunkle and Field2 Designs – Ben and his team have once again helped us with graphical stuff, which includes the design of our new logos, and also adding his magic touch to our site designs. If you’re looking to add a professional and personalized touch to your site, check them out, you won’t regret it!

s2Member – We should have gone with this plugin in the first place, and we learned our lesson. This is an awesome and feature-packed membership plugin which has made this transition so much simpler than it could have been.

ElegantThemes – Our first theme was from ElegantThemes, it served us very well and got us up and running very quickly, if you are considering getting any themes check them out, especially with their jaw-dropping prices!

WooThemes – Aside from also making wonderful themes, we are still using a slightly modified version of FaultPress, which is a rock-solid and very useful app theme which helped us quickly set up a new and functional support area when our original BP/bbPress setup failed (not due to BP or bbPress, due to the membership plugin we originally went with). We’d recommend it to anyone needing this sort of thing.

Moving On….

This marks an exciting turning point for Events Manager, because it’s now time to shift most of our focus to doing what we enjoy doing the most and is also why we started this in the first place: making an awesome event plugin and adding exciting new features!

You can also expect more incremental changes to this site focused around providing you more helpful tips, tricks and documentation to build your event websites with Events Manager.

Bring on 2013, it’s going to be an interesting year!

5.3.2 Released

$
0
0

This release fixes one issue, which occurs if you are using MultiSite and our global tables mode with the newly released WordPress version 3.5.

I you are using the above setup, upgrade to 5.3.2 now.

Big thanks goes out to Fee who spotted the problem and persistently tested this to figure out the cause (and solution!).

New WPML Compatability Plugin

$
0
0

For a long time now one of the most frequent questions we get is “Does this work with WPML” or for those that try the two together say “This doesn’t work well with WPML“.

That told us two things:

  1. WPML is a very popular plugin! Certainly one of the best multilingual plugins out there. They’ve taken on a very complex task and have done a great job about it.
  2. There is a big demand for multilingual events. It is certainly interesting to see how widely WordPress is being used around the world, and humbling to see how many people want Events Manager working in more than one language on their site.

So, as a result of this, a promise was made to make EM and WPML work together and bring the best of both worlds. I wrote a small snippet earlier this year to close some of the gaps, but soon enough it became apparent that there was way (way) more that needed to be done to make Events Manager a truly multi-lingual-capable plugin. Well, I’m very happy to say that we’ve taken our first step (I guess second, but in comparison it’s a huge step!) towards making EM and WPML truly play nice together.

Enter the Events Manager WPML Compatability plugin! This plugin adds some major improvements to the original snippet, here’s some of the most notable changes:

Custom texts, formats and emails can be translated straight out of the EM settings page

Events Manager 5.3.2.2 is also needed for this to work (Currently available as a development version at time of writing), but once updated you’ll now have the option to translate ANY text options in your settings page which will then be used instead of the default text when viewing your event/location/etc. pages in other languages.

Events, Locations and other pages overridden by EM can be translated

Events Manager overrides certain pages with our custom formats to allow more control over how your events are displayed. The issue previously with WPML and EM is that this page wouldn’t be overwritten if viewing translated versions.

Now, if you translate say the Events page, if you use the language switcher to change languages, you’ll automatically see that page with events in that language. All you need to do now is translate the assigned pages and this add-on will do the rest.

Event and Booking information shared across translations

Previously, translations were treated as separate posts/events, meaning that events would have completely independent bookings, times, locations and more. This didn’t really make sense, because translations should concern themselves with information about the event, not so much the when/where and bookings.

Now, when editing translations, you won’t see all that extra information so you can concentrate on translating. Dates, bookings and locations can be modified in the main language of the event.

We’re still not done!

This is a pretty big task, there’s still a few known issues (see the plugin page for details) and so we’re going to be making more improvements over time in incremental stages. There’s still more to be done, notably including:

Recurring Events

I had previously said in various threads that recurring events won’t work as is, and that we’d need to rewrite the recurring events logic. This actually is not true anymore, thanks to the work put into this plugin, we’ve figured out a way to make recurrences translatable.

Whilst we’ll still be rewriting the recurrences feature (actually, adding a second recurrence feature with different advantages), the current recurrence template model will soon support translations as well.

In the meantime though, we’ve had to disable recurrences with WPML to avoid duplicate events and mass confusion.

Custom Booking Form Fields (Pro)

As is, these can’t be translated, however, we are also planning a rewrite of the Form Editor, and multilingual capability will be one of the many improvements.

Onto 2013!

I’d also take this opportunity to wish you all happy holidays! It’s been a hectic month, with our new website revamp and this add-on it has also been a productive one.

Due to the holidays, the rest of this month will be rather subdued, so we invite you all to try out the plugin and let us know of issues you experience or of if there’s something we’ve missed. We’ll be picking this up in early January again and continue with making more improvements.

Viewing all 394 articles
Browse latest View live