How to manual use data from datatbase

WordPress Event Management, Calendars & Registration Forums General Question How to manual use data from datatbase

This topic contains 4 replies, has 2 voices, and was last updated by  Andrea Poggetta 9 years, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20213

    Hi Stephen, I need to know if it’s possible to enter manually (or with a function) inside the event database. I need to manipulate single occurrences. I’m am using the pro version of the plugin and i need to check and save only single occurrences of an entire event.
    Example = if I have an entire week event, how can I modify only Monday’s data?

    Andrea

    Andrea Poggetta
    #20241

    Hi Andrea,

    What data are you trying to modify? An occurrence only has a start date/time and and end date/time. Venue, description, categories etc are all tied to the event rather than occurrences.

    You can, though, break out occurrences from their parent event – but they then become an independent event in its own right.

    Stephen Harris
    #20243

    I’ll post a screenshot, maybe I can explain better. http://prntscr.com/9d1afg

    So… I have an event that starts at 1st of dec ’15 and finish on jan 31 ’15. In this event there are occurrences every monday from 9 pm to 10 pm, but the last week of the event, the occurrence, starts at 7pm and ends at 9pm. How can I modify only this occurrence without creating a new event only for a day? At least, can you please tell me the function that goes inside the DB and pulls out every single occurrence? I really need to manipulate that data. I use your plugin to manage schools lessons and course.

    If you have some hint please tell me. Best Regards

    • This reply was modified 9 years, 3 months ago by  Andrea Poggetta. Reason: The image doesn't work
    Andrea Poggetta
    #20245

    You can use eventorganiser_move_occurrence() – its technically private, but I’m not expecting it to be removed (and if it were, it wouldn’t be until 4.0.0).

    The only documentation for it is in the source code, which I’ve copied here:

    /**
     * Updates a specific occurrence, and preserves the occurrence ID. 
     * 
     * Currently two occurrences cannot occupy the same date.
     * 
     * @ignore
     * @access private
     * @since 2.12.0
     * 
     * @param int $event_id      ID of the event whose occurrence we're moving
     * @param int $occurrence_id ID of the occurrence we're moving
     * @param DateTime $start    New start DateTime of the occurrence
     * @param DateTime $end      New end DateTime of the occurrence
     * @return bool|WP_Error True on success. WP_Error on failure.
     */
    

    Alternatively you can enable drag ‘n’ drop of events in the admin calendar: http://wp-event-organiser.com/blog/announcements/custom-times-occurrences/

    Stephen Harris
    #20246

    Thank you Stephen!

    Andrea Poggetta
Viewing 5 posts - 1 through 5 (of 5 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.