WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Global events and bookings in multisite environment? (12 posts)

  1. GerZah
    Member
    Posted 2 months ago #

    Hi,

    I'm evaluating the possibility of creating a multi-language WordPress site by using a multisite subdomain based environment (with the help of Multilingual Press – Free edition for now).
    I am using empty root blog mysite.com which is supposed to show more or less just a language selector, plus two child blogs – in this case en.mysite.com and de.mysite.com for English and German; other languages will follow.

    BuddyPress 2.0.1 is working smoothly (after figuring out the global avatar issue): They show up over both language branches, can interact with each other, all good.

    I got Events Manager 5.5.3 installed. I removed the event related pages from the root blog, but they are present in the child blogs and working well. "Enable global tables mode" is enabled. Still – I can't figure out how to create global events.

    For the time being, I'm creating events using the WP Admin user. If I create them in the root blog, they are available only in the root blog – which doesn't work too well, as I don't have the respective pages there. However, they don't show up in the child blogs.

    Likewise, if I create events in one the child blogs, they don't show up in the other one. I can, however, add a "[events_list blog=x]" smartcode to the events page to at least list the other blog's events.

    But when a user books into an event, his "My Bookings" page shows only the bookings from the child blog he is just visiting. To my knowledge, there's no "[bookings blog=x]" smartcode that I could add as a workaround.

    So – what am I doing wrong? Is there something that I'm missing to create true global events that will be visible on all child blogs, while hopefully the "My Bookings" page will also show all of them for every user?

    Thanks a lot in advance – any help is highly appreciated!

    https://wordpress.org/plugins/events-manager/

  2. GerZah
    Member
    Posted 2 months ago #

    I'd like to add:

    I can confirm that the events from both child blogs are stored in the wp_em_events table, the respective wp_x_em_events (with x being the id of the child blogs, as defined in wp_blogs) are empty. Same is true for the global wp_em_bookings table, while the wp_x_em_bookings tables are empty.

    The only thing that I can see is: The events in wp_em_events show the blog ID (from wp_blogs) in the blog_id field, which obviously assigns each of the events to one particular blog, i.e. language site.

  3. GerZah
    Member
    Posted 2 months ago #

    Oh-kay. I think I understand know where I am wrong.

    It is possible to display child site events on the main site event list (which needs to be present there). — What's needed is the other way around, i.e. showing root site events (or otherwise all events from all sites) on the child site event lists.

    And indeed:
    http://mysite.com/members/xyz/events/attending/
    shows all attended events of user "xyz", while
    http://en.mysite.com/members/xyz/events/attending/
    and
    http://de.mysite.com/members/xyz/events/attending/
    show only the attended events from the respective child site.

    However …

    http://mysite.com/events/my-bookings/
    is empty, while
    http://en.mysite.com/events/my-bookings/
    and (localized URL)
    http://de.mysite.com/veranstaltungen/meine-buchungen/
    show the respective local bookings.

    *headscratch* This is all very inconsistent and counterintuitive.

  4. caimin_nwl
    NetWebLogic Support
    Posted 2 months ago #

    Hi,

    I'm not sure I follow 100% what you want to do but if you're sharing events from the main site to the sub-sites Events Manager needs to be operational on the main site.

    This walk-through should help:
    http://wp-events-plugin.com/documentation/multisite/

  5. GerZah
    Member
    Posted 2 months ago #

    @caimin_nwl Thanks for the pointer. I've certainly read and tried to implement what's said on that documentation page: http://wp-events-plugin.com/documentation/multisite/

    ------------

    So let me try to put this in other words: I have Events Manager operational on the main site. As a matter of fact, Events Manager is network activated. I have event pages on the main site that are fully functional.

    What I can do right now is: I can see events created in the sub-sites in the main site's event list. To my understanding, that is what the configuration setting "Display global events on main blog?" achieves.

    ------------

    However: This is pretty much the opposite of what I would like to achieve. As you put it yourself: It's about "sharing events from the main site to the sub-sites".

    What I would like to do is: I would like to create a truly "global event" – on either one of the sub-sites, or perhaps on the main site. But I still would like to see all events on all sites.

    Is there a way to do that?

  6. caimin_nwl
    NetWebLogic Support
    Posted 2 months ago #

    Yes, the trick is to use the blog ID in the event shortcode. Something like this:

    [events_list blog=1]

  7. GerZah
    Member
    Posted 2 months ago #

    Thanks. If you look at my OP, you will see that I already do that. But this is more or less just a workaround.

    The problem is not so much in the event list, but in the list of bookings. The "My Bookings" pages in the sub-sites will list only those events that are booked within that particular site. To see bookings from another site, the user will have to visit the respective other sub-site. — I've described that in more detail in my 3rd post.

  8. angelo
    NetWebLogic Support
    Posted 2 months ago #

    sorry for the confusion but the main issue here is that my-bookings page should only list events books on that particular site wherein right now it also displays other subsites events books ?

  9. GerZah
    Member
    Posted 2 months ago #

    @angelo: No – the other way around! :)

    The "My Bookings" shows only bookings from that particular site. I would like it to list bookings from all sites.

    Is this the other way around for you? Why could that be?

  10. caimin_nwl
    NetWebLogic Support
    Posted 2 months ago #

    Angelo's version is the default way My Bookings works in multisite, to make it work in the way you've described you'd need to create a custom verion of the My Bookings templates that draws bookings from all blogs.

  11. GerZah
    Member
    Posted 2 months ago #

    Oh-kay. I think I found it.

    (a) There is indeed a [my_bookings] shortcode, as defined in em-shortcode.php. The problem is: It doesn't seem to be able to accept parameters, like [my_bookings blog=x].

    (b) After a bit of digging, it all boils down to em-person.php and function get_bookings(…)in line 31ff. The crucial comment can be found in line 36:

    //not the main blog, force single blog search

    Well. That leads to line 37:

    $blog_condition = "AND e.blog_id=".get_current_blog_id();

    So yeah: In contrast to the events list [events_list blog=x], it's not that easy to actually list my bookings from other sites than the current blog / site. ... Truth is: When I comment out line 37, so it does not filter upon get_current_blog_id(), I get exactly what I want: The "My Bookings" page in the sub sites show all bookings from the whole network of sites. Clicking a booking takes the user to the respective subsite.

    Well -- darn, now I've got a core patch. I don't like that at all. :-(

  12. angelo
    NetWebLogic Support
    Posted 2 months ago #

    if you can code maybe you can try to hook into em_person_get_bookings filter instead and then do your own filtering and on this way it will be upgrade proof.

    As for where to paste custom code: http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/

Reply

You must log in to post.

About this Plugin

About this Topic