Exemple #1
0
function em_install()
{
    $old_version = get_option('dbem_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_people_table();
        em_create_categories_table();
        em_add_options();
        //Migrate?
        if ($old_version < 2.3 && $old_version != '') {
            em_migrate_to_new_tables();
            em_import_verify();
        }
        //Upate Version
        update_option('dbem_version', EM_VERSION);
        // wp-content must be chmodded 777. Maybe just wp-content.
        if (!file_exists(ABSPATH . "/" . EM_IMAGE_UPLOAD_DIR)) {
            @mkdir(ABSPATH . "/" . EM_IMAGE_UPLOAD_DIR, 0777);
        }
        //do we need to 777 it? it'll be owner apache anyway, like normal uploads
        em_create_events_page();
    }
}
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();
    }
}