Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • Thread Starter Friedrich72

    (@friedrich72)

    ok, thank you! awaiting their response.

    Thread Starter Friedrich72

    (@friedrich72)

    Thanks, Angelo. But those don’t seem to have an effect. I have the ‘current events as past events’ set to ‘no’. And i tried putting the long_events arg in as shown here.
    Here’s my events-list-grouped.php code :

    if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>";
    
    if( empty($args['category']) ){
      $args['category'] = '124';
      $_REQUEST['category'] = '124';
    }
     $args['long_events'] = 1;
    echo '<div class="smallbox-right-border">'.kumu_emscalendar().'</div><div style="clear:both;"></div>';
    echo EM_Events::output_grouped($args); //note we're grabbing the content, not em_get_events_list_grouped function
    
    if( get_option('dbem_css_evlist') ) echo "</div>";

    Do i have the $arg for long_events correct?

    My long events do show up in my Calendar, but not the group list.

    Thread Starter Friedrich72

    (@friedrich72)

    Angelo, can you tell me how you would modify this file? Would I duplicate the class in my functions.php? Can you give me an example of how to modify, say, the header text?

    Thread Starter Friedrich72

    (@friedrich72)

    Yes, I’ll be running this small bit which calls my 3rd style as a variable. In this case I’m using the name of the style “End Date=2015-06-15” as the maxDate in my popup calendar. I already have it working in em-event-posts-admin.php in the admin_notices() function , but i dont want to keep it there.

    $my_em_styles = (is_array(get_option('my_em_styles'))) ? get_option('my_em_styles'):array();
    	    $kumumaxdateex = explode ('=',$my_em_styles[3]);
    	    $kumumaxdate = $kumumaxdateex[1];
    	    $pubmaxselectabledate = sprintf(__( 'Max Publicly Selectable Date : '.$kumumaxdate));
    ?><div class="updated"><p><?php echo $warning ?></p></div><div class="updated"><p><?php echo $pubmaxselectabledate; ?></p></div><?php
    	}

    The reason I want to display it in the Recurring Events page is just a reminder to whoever is loading the events to change it if they need to. The popup with the maxDate range is part of a custom satellite application that uses Events Manager to display our hours of operation. – just in case you were wondering why we are doing it that way.

    Thread Starter Friedrich72

    (@friedrich72)

    Hi Angelo. I was able to figure this out.
    Thanks for the reply. It took a while to get back to you because trying ‘$_REQUEST’ didnt work. And i wasn’t sure how to get a result from ‘print_r($_POST).’ Where would you add that? I tried adding it to the meta box for styles but it just returned ‘Array().’ Tried adding it to the save function but it would have to go into an ‘alert’ pop up or something wouldnt it?

    My solution was simple, just took a while to realize it.
    I had to put an ‘else if’ after the initial ‘if’ statement in order for the save to determine what to do if ‘$_POST[‘event_styles’]’ was indeed empty. this code goes just before the ‘return $result’
    else if( empty($_POST['event_styles']) ){$wpdb->query("DELETE FROM ".EM_META_TABLE." WHERE object_id={$EM_Event->id} AND meta_key='event-style'");}

    Thanks again for your help.

    Thread Starter Friedrich72

    (@friedrich72)

    Got it. just eliminated && empty($_REQUEST['category']) to make it work for search.

    Thread Starter Friedrich72

    (@friedrich72)

    One more question.
    It is not filtering out categories when I do a date range search.
    Is there somewhere else I can put the additional $args?
    This is what I used:

    if( empty($args['category']) && empty($_REQUEST['category']) ){
      $args['category'] = '-21,-41';
      $_REQUEST['category'] = '-21,-41';
    }

    Thread Starter Friedrich72

    (@friedrich72)

    Hi, angelo. I figured out my problem. Was using events-list.php but I needed to use events-list-grouped.php.
    Works like a charm.
    You and Marcus are awesome for answering questions. Thank you!

    Thread Starter Friedrich72

    (@friedrich72)

    Ok, I did a test with event-single.php like this:

    <?php
    /*
    global $EM_Event;
    /* @var $EM_Event EM_Event */
    echo 'Test '.$EM_Event->output_single();
    ?>

    And here is my code for events-list.php in the same directory:

    $args = apply_filters('em_content_events_args', $args);
    
    if( get_option('dbem_css_evlist') ) echo "<div class='css-events-list'>";
    
    echo 'TEST '.EM_Events::Output( $args );
    
    if( get_option('dbem_css_evlist') ) echo "</div>";

    I have my single event page formatting on and I can see the word ‘Test’ along with all of the other single page event data.
    I dont see the word ‘test’ in my main events page.

    I have tried turning on and off my formatting in Event List/Archives.

    Also tried not setting a page as my main event page and just using short codes. (Oddly – and I know this is a tangent – but the date range values are not being passed when I use the [event_search_form] shortcode by itself. Results are coming up in my archives but the date is not applied)

    All I ultimately want to do is display my event list from settings excluding certain categories.
    What can I try? – thanks for the help!

    Thread Starter Friedrich72

    (@friedrich72)

    Thanks, angelo. Your reply is much appreciated.
    I found something that works.
    I first tried
    $mydates = EM_Events::get(array('orderby'=>'event_end_date', 'order' => 'DESC', 'limit' => 1));
    And was able to echo the last end date by putting it into a foreach like this
    foreach ( $mydates as $mydate ) {echo $mydate;}
    But it displayed the result as yy-mm-dd.
    In order to put the date into the jquery that the datepicker would read, i needed mm/dd/yy .
    So I tried this and it seems to work. Do you think doing it this way, with an explode, is a good way to do it? Do you know a way to do it from the EM_Events::get array above?

    global $wpdb;
    	$mydates = $wpdb->get_col("SELECT MAX(event_end_date) FROM wp_em_events LIMIT 1");
    
    foreach ( $mydates as $mydate ) {
    	$mydatex = explode("-", $mydate);
        $mydayex = $mydatex[1];
        $myyearex = $mydatex[0];
        $mymonthex = $mydatex[2];
        $myenddate = $mydayex.'/'.$mymonthex.'/'.$myyearex.'/';
    
    }

    Then, in the jquery I defined ‘$myenddate’ as the variable ‘end’

    <script>
    function em_setup_datepicker(wrap){
    	wrap = jQuery(wrap);
    	//default picker vals
    	if(wrap.find('.em-date-range-search')){
    	var end = new Date("<?php echo $myenddate; ?>");
    	var datepicker_vals = { altFormat: "yy-mm-dd", changeMonth: true, changeYear: true, firstDay : EM.firstDay, yearRange:'-100:+10', minDate: '-1mm', maxDate: end };}
    	else{...

    This is all within my theme in Plugins > events-manager > templates > search > scope.php

    Thread Starter Friedrich72

    (@friedrich72)

    Yes, thank you for the response. I mean the datepicker for the event search fields on the front end, not the admin.
    So on my Events page I have the advanced search form available for visitors to select a date range of events.
    I’m trying to grey-out the dates before and after available event dates.
    I suppose for the minDate I’d like it to not allow dates further than 1 month in the past. I dont necessarily need to ‘pick up the first start_date’ as I mentioned above.
    But for the maxDate I’d like to automatically detect the end_date furthest in the future that is available within my events and use that date as my maxDate (max selectable date) for the datepicker.

    you can do a shortcode . look here http://wp-events-plugin.com/documentation/shortcodes/ .
    I use [events_list category=”1,2,3,4″ scope=”today”] in my events page.

    Thread Starter Friedrich72

    (@friedrich72)

    What is the php for showing the name of a category which has no current events within the events list?

    I know you are inundated with questions, so I apologize for the bump.
    This is the last thing I need in order to go live with EM. Your reply is much appreciated!

    Thread Starter Friedrich72

    (@friedrich72)

    Thank you, agelonwl.
    I need this result to be searchable within the events list. As far as I know short codes are not, correct?
    I’m thinking I’d need to modify the $format in some way. That’s why I asked about php.

    Maybe something like altering em_event.php if (empty (... ?

    Thread Starter Friedrich72

    (@friedrich72)

    Really appreciate your advice, Marcus. Thanks. I’ll try it out.

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