WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Ticker or counter for #_PENDINGSPACES (5 posts)

  1. ech08ravo
    Member
    Posted 1 year ago #

    Hi and apologies in advance for my newbieness both to WP and EM.

    I'm moving an HTML site to WordPress and have installed the free version of EM to make sure it will work OK for the solution. So far, great, and I know what I'm asking is in the range of 'nice to have' rather than 'necessary'.

    The site I'm working on http://www.thecoachingroom.com.au uses PNG images to display the spaces available in each course and I'd like to find a way to use a similar counter for EM. Even if I have to write a cumbersome ' if pendingspaces = 1, use 1.gif, else if pendingspaces = 2 use 2.gif.'

    I just have no idea where to start, or whether it would be possible at all. All feedback appreciated :)

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 1 year ago #

    it's possible, you need to override placeholder #_PENDINGSPACES - here is a similar thread http://wordpress.org/support/topic/plugin-events-manager-booking-notification-email-does-not-show-the-datetime-the-customer-has-booked?replies=4

    e.g.

    function my_em_bookeddate_placeholders($replace, $EM_Event, $result){
     switch( $result ){
      case '#_PENDINGSPACES':
       $space = $EM_Event->get_bookings()->get_pending_spaces();
       if ($space == 1){
        $replace = "<img src='..../1.png' />";
       }
       break;
     }
     return $replace;
    }
    add_filter('em_event_output_placeholder','my_em_bookeddate_placeholders',1,3);
  3. ech08ravo
    Member
    Posted 1 year ago #

    Hi agelonwl and thanks very much for your reply. I'm a newbie at PHP too, so I'm sorry about the level of the questions :|

    I am guessing that I'd add this to the theme functions.php file and that it doesn't matter too much where I add it.

    I'm guessing that the placeholder I'd put in my page/post is 'my_em_bookeddate_placeholders'?

    I'm not sure, though, whether I'd put the subsequent

    $replace = "<img src='..../2.png' />"; etc, eg

    $replace = "<img src='..../1.png' />";
    
    }
    
    break;
    
    elseif ($space ==2){
    
    $replace = "<img src='..../2.png' />";
    
    }
    
    break

    or after the

    return $replace;
    }

    and I am ashamed to say that I'm not sure what the last line of code does and why it includes 1,3.

    Thanks again for your time.

  4. agelonwl
    Member
    Posted 1 year ago #

    and I am ashamed to say that I'm not sure what the last line of code does and why it includes 1,3.

    you will see it's docs here - http://codex.wordpress.org/Function_Reference/add_filter

    1. you need to paste/add the snippet in your theme functions.php
    2. you need to use placeholder #_PENDINGSPACES in your settings > formatting or inside a shortcode e.g. [events_list]#_PENDINGSPACES[/events_list]

    http://wp-events-plugin.com/documentation/

  5. ech08ravo
    Member
    Posted 1 year ago #

    thanks very much for your help with this - a more experienced php person gave me a hand and it is just what I need.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic