Use iCal to sync events of two different WordPress systems?

WordPress Event Management, Calendars & Registration Forums iCal Extension Use iCal to sync events of two different WordPress systems?

This topic contains 6 replies, has 2 voices, and was last updated by  Robert Drost 6 years, 2 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #30769

    Hi,

    I really love the Event Organiser-Plugin and the iCal-extension. Thanks for your work and greetings from Germany 🙂

    I do have two different WordPress systems (the website of a tourist region and the website of one city inside this region). Both websites display nearby events and by now I have to copy and paste events that someone created in one system to the second system and back. The problem is, that every system has its own database. With Event Organiser Plugin and iCal-extension I managed to display all events (of both systems) in both WordPress backends. But if someone changes f.e. the date of an event of the first system into the backend of the second system it gets overwritten after the iCal-extension syncs and loads the old date.

    Is it possible to sync both WP-systems correctly? The customers should be able to change the content of events and the last change should get synced into both WP-systems.

    Thank you!
    Rob

    Robert Drost
    #30820

    Hi Rob,

    Unfortunately not, the iCal sync is only a one-way sync, not a two-sync which means any changes made to the event on the ‘owning’ site (the site where the event was originally created) will over-ride those made to the event on the client side.

    To clarify, both sites can subscribe to each other’s iCal feed so that events appear on both sites – but only one site will really ‘own’ the event.

    Stephen Harris
    #30828

    Hi Stephen,

    thank you for your response 🙂 So the solution could be to display all events in both systems, but just allowing the ‘owning’ site to edit their events. Is it possible to just show the events of the other site without permission to edit?

    Rob

    Robert Drost
    #30846

    Hi Robert,

    This code snippet will achieve that. Any imported event because uneditable:

    add_filter( 'map_meta_cap', function($primaryCaps, $cap, $userId, $args){
    
        if( 'edit_event' !== $cap ) {
            return $primaryCaps;
        }
    
        if(get_post_meta($args[0], '_eventorganiser_feed', true)){
            $primaryCaps[] = 'do_not_allow';
        }
    
        return $primaryCaps;
    
    
    }, 999, 4 );
    
    Stephen Harris
    #30860

    Hi Stephen

    Thank you very much 🙂 this helped a lot!

    Rob

    Robert Drost
    #31388

    Hi Stephen,

    Unfortunately it still does not work perfectly.
    The problem now is that after importing from one site to the other one and back all events are uneditable on both sites.
    This is because site1 imports not only all new events from site2, but it also imports the uneditable events that site2 imported from site1 before. In this ‘import-circle’ every new event gets uneditable after one import.
    The solution could be to check the event-owner while importing events from the other site.
    A second solution could be to manipulate the ical-feed, so that it only exports ‘owned’-events or only exports editable events.
    Is this possible?

    Thank you again
    Rob

    Robert Drost
    #31693

    Hi Stephen,

    its me again. I still got the problem mentioned above.
    The easiest way to solve it would probably be to import only editable events (or to only export editable events)
    Sounds easy, but I can’t get it to work, because I’m not that familiar with manipulating plugins.
    Thanks a lot

    Greetings from Germany,
    Rob

    Robert Drost
Viewing 7 posts - 1 through 7 (of 7 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.