Mad Dog

Forum Replies Created

Viewing 15 posts - 31 through 45 (of 130 total)
  • Author
    Posts
  • in reply to: Duplicate Venues and Organizers #1063906
    Mad Dog
    Participant

    CANCEL THIS REQUEST!

    I finally found it. It’s in the-events-calendar\src\Tribe\Main.php. I commented out this section for venues and the similar section for organizers.

    if ( $venues ) {
    	//echo $my_venues ? '<optgroup label="' . esc_attr( apply_filters( 'tribe_events_saved_venues_dropdown_optgroup', sprintf( esc_html__( 'Available %s', 'the-events-calendar' ), $this->plural_venue_label ) ) ) . '">' : '';
    	//foreach ( $venues as $venue ) {
    	//$venue_title = wp_kses( get_the_title( $venue->ID ), array() );
    	//echo '<option data-address="' . esc_attr( $this->fullAddressString( $venue->ID ) ) . '" value="' . esc_attr( $venue->ID ) . '"';
    	//selected( ( $current == $venue->ID ) );
    	//echo '>' . $venue_title . '</option>';
    	//}
    	//echo $my_venues ? '</optgroup>' : '';
    	}
    echo '</select>';

    I know this is a terrible way to do this by hacking a core file, and it will likely be overwritten with an update, but for now it works and the client is happy that Community Users won’t see everyone else’s Venues and Organizers which seems to be the way this *should* work by default.

    If you see anything odd or know of any reason I shouldn’t be doing this, please let me know.

    Thanks!
    Mad Dog

    in reply to: Duplicate Venues and Organizers #1063885
    Mad Dog
    Participant

    Hi George–

    I got these taken care of pretty easily and hope they get the bug fixed soon.

    In the meantime, I’d still like to not let Community Users see other peoples’ venues or organizers. I keep checking the Suggest a Feature about this but so far it’s not being done. That said, I’d like to try a temporary fix by adding a class to the “Other Venues” options in the dropdown to hide them. What file(s) actually control the building of the Venue and Organizer dropdowns? I’ve searched and see the function but can’t for the life of me find where those functions are so I can try modifying them. I know it’s working on core files but I’d like to give it a shot.

    Can you point me to the right file(s)?

    THANKS
    MD

    in reply to: Only Display a User's Organizers and Venues (Redux) #1062778
    Mad Dog
    Participant

    I’m not seeing any code in that file that will form an Organization or Venue dropdown menu. I’m looking for where that dropdown is actually created hoping I can assign a class to the options that aren’t owned by the logged in user.

    Am I missing that somewhere in the file?

    THANKS

    in reply to: View Past Events gorked #1060236
    Mad Dog
    Participant

    *Ding!*Ding!*Ding!*Ding!

    I do believe I’ve got it….

    I changed one line to include the two TEC functions like this:

    if ($post_type == 'tribe_events' && (tribe_is_list_view() || tribe_is_photo() ) ) {

    and now it all seems to work as it should. List and Photos only show events which haven’t begun yet, Past Events show up in Admin and in the Community Events edit page (when Past Events is clicked)….seems good! I’m going to have the client check behind me just to be certain, of course.

    I’m still curious why it worked before the maintenance updates without the conditionals. But regardless, it seems good now.

    THANKS A MILLION FOR STICKING WITH ME ON THIS!

    If anyone is interested, here’s the final Function to only show events that haven’t begun (ignoring the end dates) for List and Photo views:

    // Only Display Events with Starting Date from today on //
    function start_date_strict($query) {
        $post_type = $query->query_vars['post_type']; 
     
     //   if ($post_type == 'tribe_events') {  **ORIGINAL** 
          if ($post_type == 'tribe_events' && (tribe_is_list_view() || tribe_is_photo() ) ) {
     
            $filterDate = current_time('Y-m-d H:i:s');
            if (!empty( $_REQUEST['tribe-bar-date'] ) ) {
                $filterDate = $_REQUEST['tribe-bar-date'];
            }
     
            $query->query_vars['meta_query'][] = 
                     array(         // restrict posts based on meta values
                        'key'     => '_EventStartDate',  // which meta to query
                        'value'   => $filterDate,  // value for comparison
                        'compare' => '>=',          // method of comparison
                        'type'    => 'DATETIME');
        }
    }
    add_filter( 'tribe_events_pre_get_posts', 'start_date_strict', 100, 1 );
    

    Thanks again! I’ll let you know if the client finds anything but after all this work we got it licked. Oh yeah…let me know if you see anything in there that isn’t good code or needs fixing.

    Mad Dog

    in reply to: Only Display a User's Organizers and Venues (Redux) #1059505
    Mad Dog
    Participant

    Hi…still hoping you can point me to the file that actually “builds” the drop-down selector.

    Thanks!

    in reply to: View Past Events gorked #1059476
    Mad Dog
    Participant

    I found the offender easily but need to know what changed with the recent version updates that made it stop working right and help with making it work again.

    I was trying to get it to only display Events (which are Courses for this client) that have a START DATE of today or in the future. End Date isn’t important for this. Once it’s started, it shouldn’t show up. I had a support question about it and we got it working (https://theeventscalendar.com/support/forums/topic/only-display-events-by-upcoming-start-date/).

    Somehow after the latest updates it’s apparently affecting the whole installation, not just List and Photo views, so it won’t show any events with a start date < today. (I’m pretty sure it was one of the maintenance updates, since it worked after 4.0 but stopped after.)

    I don’t know what changed but can you help me fix the function so it only affects List and Photo views and not admin or any other page? Here’s the code:

    // Only Display Events with Starting Date from today on //
    function start_date_strict($query) {
        $post_type = $query->query_vars['post_type']; 
     
        if ($post_type == 'tribe_events') {
     
            $filterDate = current_time('Y-m-d H:i:s');
            if (!empty( $_REQUEST['tribe-bar-date'] ) ) {
                $filterDate = $_REQUEST['tribe-bar-date'];
            }
     
            $query->query_vars['meta_query'][] = 
                     array(         // restrict posts based on meta values
                        'key'     => '_EventStartDate',  // which meta to query
                        'value'   => $filterDate,  // value for comparison
                        'compare' => '>=',          // method of comparison
                        'type'    => 'DATETIME');
        }
    }
    add_filter( 'tribe_events_pre_get_posts', 'start_date_strict', 100, 1 );

    THANKS….so close now!

    • This reply was modified 8 years, 4 months ago by Mad Dog.
    in reply to: View Past Events gorked #1059473
    Mad Dog
    Participant

    I’m not sure if it’s important to you that I do these in order. I’m not even sure how to do #1 without it taking forever. The basics are fine until it gets to the plugins. Without cloning the db it means going through every one to make sure the settings are identical. That will take hours in itself.

    I did the simplest test first: Created a local WP installation, cloned the existing site, then used your cleaner. No joy. I then did a MySQL search for Drafts and deleted them. Repaired and optimized the db. The draft no longer shows up in the admin. But it still won’t display past events. So I disabled all plugins except TEC, Pro and Community Events. It still won’t display Past Events.

    I MIGHT BE ONTO SOMETHING….

    For yucks, I renamed the functions.php and used the original one. It works fine. So it looks like something in the functions which is odd….it’s either a most-recent function I added or an earlier one that with the updates no longer works right. I don’t have time now but will go through it and disable my functions one by one and find the offender. I might need advice on fixing the offender.

    Getting somewhere…I hope!

    THANKS
    MD

    in reply to: View Past Events gorked #1058894
    Mad Dog
    Participant

    Oh boy…what fun!

    in reply to: View Past Events gorked #1058030
    Mad Dog
    Participant

    They are:

    TEC – 4.0.5

    Pro – 4.0.4

    Community Events – 4.0.4

    in reply to: View Past Events gorked #1058027
    Mad Dog
    Participant

    Hi Geoff–

    No joy.

    Actually, the first time I added a past event I did it from the WP Admin and it didn’t show up. This time I did it from the Community Events front end and it doesn’t show up either.

    So yes….all access to past events is gone. I don’t see them in the Admin (which I know I used to), they’re not showing up with “View Past Events” and they’re not showing up as “Previous Events” on the Events list. As far as WP is concerned they don’t exist….weird.

    The idea of the corrupt draft is interesting. What do we do now?

    MD

    in reply to: View Past Events gorked #1056913
    Mad Dog
    Participant

    I deactivated all plugins except the three TEC ones: TEC, Pro, Community Events. It didn’t help the problem. Still can’t see past events.

    MD

    in reply to: View Past Events gorked #1056898
    Mad Dog
    Participant

    Geoff–

    I’ll try the plugin deactivation over the weekend if I can and let you know about that.

    I created a dummy PAST event that started and ended last December. When I go to the My Events page and click View Past Events, it DOESN’T show up.

    Interestingly, and you can tell me if this is how it should function, when I go into the Admin Dashboard and go to Edit Events, then click MINE, it says there should be 19 events but only 3 show up. These are upcoming events (and I suspect the only upcoming events). The past ones don’t show up in the Admin area either. Is that how it should work? It doesn’t seem right to me but maybe that’s how it works. So from this I’d guess there are 16 past events of mine that I’m unable to access in any way…..

    Whadayathink?

    MD

    P.S. In Admin, it shows there is 1 Draft. When I click to view that I get a message saying I have no events. So i suspect that is a “past” draft and it’s not displaying in the admin either!

    P.P.S As a test, I added a new Event to happen next week. It shows up in the Admin and in My Events as it should. I deleted it in My Events and it deleted as it should. So nothing in WP seems to want to display my past events!

    in reply to: View Past Events gorked #1056855
    Mad Dog
    Participant

    Thanks for sticking with this. So far:

    – Setting for Recurring Events is delete after 24 months. Not only has this system only been active a couple of months, but we don’t use recurring events and even hide that section so users can’t use it.

    – I’ll try disabling all plugins but you know it’s a pain and always scares me. I did disable ContactForm7 and Advanced Post Manager but it didn’t help.

    – Keep in mind, this DID work when 4.0 first came out. I guess it could be a plugin update though my hunch was a TEC maintenance update.

    – I flushed Permalinks. No joy.

    – URL slugs have always been (and still are) events. Oddly, we use this for courses and I realized I should change that but since some links are hardcoded I figured I’d leave it. So it’s not that.

    I’ll try disabling all plugins.

    In the meantime, do you have a script that will display all past events that I could use freestanding perhaps just as a test? It would also help reassure me that the old ones are indeed intact while we figure out how to display them.

    THANKS!
    MD

    in reply to: Only Display a User's Organizers and Venues (Redux) #1056761
    Mad Dog
    Participant

    Thanks for the head start. Do you know in which file(s) the Organizer and Venue selects are actually “constructed”?

    THANKS

    in reply to: View Past Events gorked #1056346
    Mad Dog
    Participant

    This reply is private.

    • This reply was modified 8 years, 4 months ago by Mad Dog.
Viewing 15 posts - 31 through 45 (of 130 total)