Exemple #1
0
function em_install()
{
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    $old_version = get_option('dbem_version');
    //Won't upgrade <4.300 anymore
    if ($old_version != '' && $old_version < 4.1) {
        function em_update_required_notification()
        {
            global $EM_Booking;
            ?>
<div class="error"><p><strong>Events Manager upgrade not complete, please upgrade to the version 4.300 or higher first from <a href="http://wordpress.org/extend/plugins/events-manager/download/">here</a> before upgrading to this version.</strong></p></div><?php 
        }
        add_action('admin_notices', 'em_update_required_notification');
        return;
    }
    if (EM_VERSION > $old_version || $old_version == '') {
        if (get_option('dbem_upgrade_throttle') <= time() || !get_option('dbem_upgrade_throttle')) {
            // Creates the events table if necessary
            em_create_events_table();
            em_create_events_meta_table();
            em_create_locations_table();
            em_create_bookings_table();
            em_create_tickets_table();
            em_create_tickets_bookings_table();
            em_set_capabilities();
            em_add_options();
            //New install, or Migrate?
            if ($old_version < 5 && !empty($old_version)) {
                update_option('dbem_upgrade_throttle', time() + 300);
                set_time_limit(300);
                em_migrate_v4();
                update_site_option('dbem_ms_update_nag', 1);
            } elseif (empty($old_version)) {
                em_create_events_page();
                update_option('dbem_hello_to_user', 1);
            }
            //Upate Version
            update_option('dbem_version', EM_VERSION);
            delete_option('dbem_upgrade_throttle');
            delete_option('dbem_upgrade_throttle_time');
            //last but not least, flush the toilet
            global $wp_rewrite;
            $wp_rewrite->flush_rules();
            update_option('dbem_flush_needed', 1);
        } else {
            function em_upgrading_in_progress_notification()
            {
                global $EM_Booking;
                ?>
<div class="error"><p>Events Manager upgrade still in progress. Please be patient, this message should disappear once the upgrade is complete.</p></div><?php 
            }
            add_action('admin_notices', 'em_upgrading_in_progress_notification');
            add_action('network_admin_notices', 'em_upgrading_in_progress_notification');
            return;
        }
    }
}
Exemple #2
0
function em_install()
{
    global $wp_rewrite;
    $wp_rewrite->flush_rules();
    $old_version = get_option('dbem_version');
    //Won't upgrade 2 anymore, let 3 do that and we worry about 3.
    if ($old_version != '' && $old_version < 3.096) {
        function em_update_required_notification()
        {
            global $EM_Booking;
            ?>
<div class="error"><p><strong>Events Manager upgrade not complete, please upgrade to the version 3.0.96 or higher first from <a href="http://wordpress.org/extend/plugins/events-manager/download/">here</a> first before upgrading to this version. <a href="http://wp-events-plugin.com/news/upgrade-issues-screencast-walkthrough/">We made a screencast</a> to help you out.</strong></p></div><?php 
        }
        add_action('admin_notices', 'em_update_required_notification');
        return;
    }
    if (EM_VERSION > $old_version || $old_version == '') {
        // Creates the events table if necessary
        em_create_events_table();
        em_create_events_meta_table();
        em_create_locations_table();
        em_create_bookings_table();
        em_create_categories_table();
        em_create_tickets_table();
        em_create_tickets_bookings_table();
        em_set_capabilities();
        em_add_options();
        //New install, or Migrate?
        if ($old_version < 4 && !empty($old_version)) {
            em_migrate_v3();
        } elseif (empty($old_version)) {
            update_option('dbem_hello_to_user', 1);
        }
        //Upate Version
        update_option('dbem_version', EM_VERSION);
        // wp-content must be chmodded 777. Maybe just wp-content.
        if (!file_exists(EM_IMAGE_UPLOAD_DIR)) {
            mkdir(EM_IMAGE_UPLOAD_DIR, 0777);
            //do we need to 777 it? it'll be owner apache anyway, like normal uploads
            if (EM_IMAGE_DS == '/') {
                mkdir(EM_IMAGE_UPLOAD_DIR . "events/", 0777);
                //do we need to 777 it? it'll be owner apache anyway, like normal uploads
                mkdir(EM_IMAGE_UPLOAD_DIR . "locations/", 0777);
                //do we need to 777 it? it'll be owner apache anyway, like normal uploads
                mkdir(EM_IMAGE_UPLOAD_DIR . "categories/", 0777);
                //do we need to 777 it? it'll be owner apache anyway, like normal uploads
            }
        }
        em_create_events_page();
    }
}
Exemple #3
0
function em_install()
{
    $old_version = get_option('dbem_version');
    //Won't upgrade 2 anymore, let 3 do that and we worry about 3.
    if ($old_version != '' && $old_version < 3.096) {
        die('Cannot proceed with installation, please upgrade to the version 3.0.96 or higher from <a href="http://wordpress.org/extend/plugins/events-manager/download/">here</a> first before upgrading to this version.');
    }
    if (EM_VERSION > $old_version || $old_version == '') {
        // Creates the events table if necessary
        em_create_events_table();
        em_create_events_meta_table();
        em_create_locations_table();
        em_create_bookings_table();
        em_create_categories_table();
        em_create_tickets_table();
        em_create_tickets_bookings_table();
        em_set_capabilities();
        em_add_options();
        //Migrate?
        if ($old_version < 4 && $old_version != '') {
            em_migrate_v3();
        } else {
            if ($old_version < 4.002 && $old_version > 4) {
                add_option('dbem_notice_rc_reimport', 1);
            }
        }
        //Upate Version
        update_option('dbem_version', EM_VERSION);
        // wp-content must be chmodded 777. Maybe just wp-content.
        if (!file_exists(EM_IMAGE_UPLOAD_DIR)) {
            mkdir(EM_IMAGE_UPLOAD_DIR, 0777);
            //do we need to 777 it? it'll be owner apache anyway, like normal uploads
            if (EM_IMAGE_DS == '/') {
                mkdir(EM_IMAGE_UPLOAD_DIR . "events/", 0777);
                //do we need to 777 it? it'll be owner apache anyway, like normal uploads
                mkdir(EM_IMAGE_UPLOAD_DIR . "locations/", 0777);
                //do we need to 777 it? it'll be owner apache anyway, like normal uploads
                mkdir(EM_IMAGE_UPLOAD_DIR . "categories/", 0777);
                //do we need to 777 it? it'll be owner apache anyway, like normal uploads
            }
        }
        em_create_events_page();
    }
}