Title: kirschdaniel's Replies | WordPress.org

---

# kirschdaniel

  [  ](https://wordpress.org/support/users/kirschdaniel/)

 *   [Profile](https://wordpress.org/support/users/kirschdaniel/)
 *   [Topics Started](https://wordpress.org/support/users/kirschdaniel/topics/)
 *   [Replies Created](https://wordpress.org/support/users/kirschdaniel/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/kirschdaniel/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/kirschdaniel/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/kirschdaniel/engagements/)
 *   [Favorites](https://wordpress.org/support/users/kirschdaniel/favorites/)

 Search replies:

## Forum Replies Created

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/users/kirschdaniel/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/kirschdaniel/replies/page/2/?output_format=md)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Custom confirmation email for event](https://wordpress.org/support/topic/custom-confirmation-email-for-event/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/custom-confirmation-email-for-event/#post-11355694)
 * Cool. A good reason to upgrade. Thanks for your answer.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Cannot register to event. Error “EM is not defined”](https://wordpress.org/support/topic/cannot-register-to-event-error-em-is-not-defined/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years ago](https://wordpress.org/support/topic/cannot-register-to-event-error-em-is-not-defined/#post-10377669)
 * [@angelo_nwl](https://wordpress.org/support/users/angelo_nwl/)
    Thanks for your
   support. After following your advice, I found out that my theme used the following
   script in the functions.php:
 * wp_deregister_script(“jquery-migrate”);
 * *OUTCH*
    Removing this line solved the problem!
 * Sorry for the false alert.
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Cannot register to event. Error “EM is not defined”](https://wordpress.org/support/topic/cannot-register-to-event-error-em-is-not-defined/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years ago](https://wordpress.org/support/topic/cannot-register-to-event-error-em-is-not-defined/#post-10344121)
 * Sure
    [http://wirksam.jetzt/events/freies-aufstellen-schnuppertag/](http://wirksam.jetzt/events/freies-aufstellen-schnuppertag/)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[VS Event List] Using a custom snippet for widget and event list](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/#post-10129075)
 * Guido,
    I like your straight point of view and am totally fine with your answer.
 * Finally your plugin and this discussion helped me a lot to understand the practical
   nature of WP plugins.
 * Have a good day
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[VS Event List] Using a custom snippet for widget and event list](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/#post-10127336)
 * Good morning Guido,
    I’m very happy to see you interested in your users suggestions
   and I have a huge respect for your effort. If the implementation is far more 
   work than expected, it would probably be much easier to maybe add some additional
   HTML and classes and just style the thing using CSS. So in other words: Keep 
   it simple.
 * I’m totally new to WP-Plugin programming so my ideas might be harder to implement
   than I think.
 * After taking a deeper look at the widget and your code, here is how I would try
   to implement it:
 * – A snippet consists of two parts. The html code and a name. It can be defined
   on the plugins setting page.
    – It can be included using a shortcode. Additional
   attributes might be given in the shortcode – comparable to your current implementation.
 * `[vsel-snippet name="mysnippet" posts_per_page="5"]`
 * Some Pseudocode to illustrate the idea:
 *     ```
       snippet = getSnippet($snippet['name']);
       if (snippet)
         loop
           properties = getSingleEventProperties() // include 'vsel-meta.php';
           output = replaceSnippetVariablesWithEventProperties(properties ) // include 'vsel-snippet.php';
         endloop
       endif
       ```
   
 * Some suggestions
    In vsel-widget-meta.php instead of using an individual variable
   for each data, I would use a hash. This would make it much easier to simply replace
   strings from the snippet.
 * So instead of
 *     ```
       $widget_start_date = get_post_meta( get_the_ID(), 'event-start-date', true );
       $widget_end_date = get_post_meta( get_the_ID(), 'event-date', true );
       $widget_time = get_post_meta( get_the_ID(), 'event-time', true ); 
       ```
   
 * You might use this:
 *     ```
       $props = ['event-start-date', 'event-date', 'event-time'];
       $id = get_the_ID();
       $vselProps = [];
       foreach ($props as $prop => $val) {
         $vselProps[] = get_post_meta( $id, $val, true );
       }
       ```
   
 * Add additional properties
 * `$vselProps['event-title-with-link'] = '<a href="'. get_permalink() .'" rel="
   bookmark" title="'. get_the_title() .'">'. get_the_title() .'</a>';`
 * And in your snippet script you might then search for the {…} patterns and replace
   them.
 * Here is a small proof of concept I just wrote:
 *     ```
       <?php
   
       $snippet = '<div class="event">
         <h4 class="event-title">Start: {start-date}</h4>
         <div class="event-content">
           <p class="event-date">End: {end-date}</p>
           <p class="event-time">Time: {time}</p>
           <p class="event-location">At: {location}</p>
         </div>
       </div>';
   
       $props = ['event-start-date' => 'Today', 'event-end-date' => 'Tomorrow', 'event-time' => '12:00-14:00', 'event-location' => "home"];
       $vselProps = [];
       foreach ($props as $prop => $val) {
         // remove the "event-" part just to keep it simple in the snippet
         $propWithoutEventPrefix = preg_replace("/^event-/", "", $prop);
         $vselProps[$propWithoutEventPrefix] = $val;
       }
   
       // replace all occurences in the snippet
       echo preg_replace_callback(
         "/{(.+)?}/",
         function ($foundPattern) {
           global $vselProps;
           return $vselProps[$foundPattern[1]];
         },
         $snippet
       );
   
       ?>
       ```
   
 * Cheers
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[VS Event List] Using a custom snippet for widget and event list](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/#post-10125503)
 * Me again,
    would be cool to be able to provide at least two snippets. One to 
   be used for the widget in a sidebar and one on the list of events. And to make
   it complete, the third snippet could be the single event page.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[VS Event List] Using a custom snippet for widget and event list](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/#post-10125471)
 * Guido,
    I’m happy to read that you like the idea.
 * I would define the snippet directly on the VSEL settings page. (Or an additional
   vessel snippet page.) IMHO this would make it easier for you to deal with it 
   and I only have a little shortcode in my text.
 * In the first step, one single snippet is enough, but being able to add more snippets
   might be a cool feature. Each snippet might then be used using a shortcode and
   an id.
 * `[vsel id="23"]`
 * The shortcode might be displayed directly beside the snippet. Or – more readable–
   I can give my snippet a name and use this instead:
 * `[vsel snippet="myevents"]` or `[vsel name="myevents"]`
 * Good luck with your other plugin. What is it about?
 * Cheers
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[VS Event List] Using a custom snippet for widget and event list](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/using-a-custom-snippet-for-widget-and-event-list/#post-10122696)
 * Hi Guido,
    thanks for your answer and interest! Yes, exactly. I (plugin user)
   write the snippet. Your plugin parses it and replaces every occurence of {VARIABLE_NAME}
   with the defined variable value. At least, that’s one typicall approach used 
   by other WP plugins. VSEL offers the list of variables that can be used in the
   snippet. They might or might not start with “vsel”.
 * The variables could be:
 *     ```
       startDate
       endDate
       startAndEndDate
       time
       location
       link
       image
       imageWithLink
       title
       titleWithLink
       categories
       categoriesWithLink
       description
       summary
       moreInfoText
       linkMoreInfo
       moreInfoTextWithLink
       openMoreInfoInNewWindow
       ```
   
 * To be able to control the displayed events, the allready implemented attributes
   might be to use as a HTML data attribute. eg:
 *     ```
       <div data-vsel="posts_per_page:5;event_cat:'first-category, second-category'">
         <div class="event">
           ...
         </div>
       </div>
       ```
   
 * Or using single attributes:
 *     ```
       <div data-vsel-posts_per_page="5" data-vsel-event_cat="first-category, second-category">
         <div class="event">
           ...
         </div>
       </div>
       ```
   
 * You may even add some logic like:
 *     ```
       <p data-vsel-if="no_events==true">Sorry, no events this time</p>
       <div data-vsel-if="no_events==false">
        Here are the upcomming events
       </div>
       ```
   
 * Or maybe easier: provide it as a variable I may then controll via CSS
 *     ```
       <div class="{vselEventsClass}">
         <p class="no">Sorry, no events this time</p>
         <p class="yes">Here are the upcomming events...</p>
       </div>
       ```
   
 * Where `vselEventsClass` is either “events”, when at least one event is given 
   or “no-events” when no event is available.
 * In my CSS I could then use selectors like this:
 *     ```
       .no-events > .yes, .events > .no {
         display: none;
       }
       ```
   
 * Of course, the vsel settings like “don’t show the date” are not relevant when
   using a HTML snippet as this is then responsible for the informationen it wants
   to provide.
 * Cheers
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Get E-Mail for booking](https://wordpress.org/support/topic/get-e-mail-for-booking/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/get-e-mail-for-booking/#post-8989734)
 * I havn’t tried adding a second person to check your suggestion.
 * So far I’ve used the following in my functions.php
 *     ```
       // Send mails when a booking happened
       add_action('em_booking_add', function($EM_Event) {
         global $EM_Booking;
         $msg = "New booking\n" .
           "'" . $EM_Event->event_name . "' at " . 
           $EM_Event->event_start_date .
           "\n\nDETAILS:\n" .
           $_REQUEST['user_name'] . "\n".
           $_REQUEST['user_email'] . "\n".
           $_REQUEST['dbem_phone'] . "\n\n".
           "User comment:\n'" .
           $EM_Booking->booking_comment . "'\n";
   
         $msg = wordwrap($msg, 70);
   
         // Send mail
         mail('xxx@domain.com', 'New booking', $msg);
       });
       ```
   
 * Not elegant but working. Instead of using the $_REQUEST object to retrieve the
   information, I’ve also tried to use the $EM_BOOKING object, but at the time the“
   em_booking_add” action gets fired, the $EM_BOOKING object doesn’t contain all
   data.
 * Cheers and thanks for the support
    Daniel
    -  This reply was modified 9 years, 2 months ago by [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/).
      Reason: Format the code
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Event Espresso - Event Registration & Ticketing Sales] Error "First name" needed](https://wordpress.org/support/topic/error-first-name-needed/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/error-first-name-needed/#post-8968513)
 * Thanks for the request. Because I had to many issues, I switched to another plugin.
   So I currently don’t need any help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Get E-Mail for booking](https://wordpress.org/support/topic/get-e-mail-for-booking/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/get-e-mail-for-booking/#post-8920836)
 * Finally I’m both the admin and the author and responsible person for the event.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Change ticket order](https://wordpress.org/support/topic/change-ticket-order/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/change-ticket-order/#post-8807274)
 * That’s a good hint. Now I can at least define an ordner using numbers in front
   of the ticket name.
    Would be cool to be able to define my own order in a next
   version or to be able to select “Order by Ticket-ID” which should result in the
   order they are defined.
 * Thanks!
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Set different start/end time for multiple day events](https://wordpress.org/support/topic/set-different-startend-time-for-multiple-day-events/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/set-different-startend-time-for-multiple-day-events/#post-8792211)
 * Just for the records, this is what I’ve done now:
 * 1. I’ve added a custom attribute #_ATT{multipleTimes}{YES|NO}
    This gives me 
   a select box with YES and NO options on the event page.
 * 2. I’ve changed my template for the “single event format” to contain the new 
   attribute as a class:
 *     ```
       <div class="event multiple-times-#_ATT{multipleTimes}">
         #_EVENTNOTES
         ... other stuff ...
         {has_bookings}
           #_BOOKINGFORM
         {/has_bookings}
       </div>
       ```
   
 * So when I select YES for the multipleTimes attribute, I get a class multiple-
   times-YES for my event container.
 * 3. I added the CSS definition:
 *     ```
       .multiple-times-YES .event-row-date {
         display: none;
       }
       ```
   
 * to simply hide the row with the fixed date.
 * 4. I added the individual times for each day at the end of the event’s description.
    -  This reply was modified 9 years, 4 months ago by [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/).
      Reason: Fixed css typo
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] Set different start/end time for multiple day events](https://wordpress.org/support/topic/set-different-startend-time-for-multiple-day-events/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/set-different-startend-time-for-multiple-day-events/#post-8789633)
 * This sounds good. And show it only when available using the technique described
   in the tutorial:
    [http://wp-events-plugin.com/tutorials/creating-conditional-placeholders-for-events/](http://wp-events-plugin.com/tutorials/creating-conditional-placeholders-for-events/)
 * Would that do the job or am I on the wrong track?
 * Thanks
    Daniel
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Events Manager - Calendar, Bookings, Tickets, and more!] “ERROR: message not sent” when confirming booking](https://wordpress.org/support/topic/error-message-not-sent-when-confirming-booking/)
 *  Thread Starter [kirschdaniel](https://wordpress.org/support/users/kirschdaniel/)
 * (@kirschdaniel)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/error-message-not-sent-when-confirming-booking/#post-8717937)
 * Tried PHP Mail now which seems to work fine. Thanks for your help!

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/users/kirschdaniel/replies/page/2/?output_format=md)
[→](https://wordpress.org/support/users/kirschdaniel/replies/page/2/?output_format=md)