function form_maker_activate()
{
    $version = get_option("wd_form_maker_version");
    $new_version = '1.7.20';
    if (!$version) {
        add_option("wd_form_maker_version", $new_version, '', 'no');
        global $wpdb;
        if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
            require_once WD_FM_DIR . "/form_maker_update.php";
            form_maker_update_until_mvc();
            form_maker_update_contact();
            form_maker_update('');
        } else {
            require_once WD_FM_DIR . "/form_maker_insert.php";
            from_maker_insert();
        }
    } elseif (version_compare($version, $new_version, '<')) {
        require_once WD_FM_DIR . "/form_maker_update.php";
        form_maker_update($version);
        update_option("wd_form_maker_version", $new_version);
    }
    require_once WD_FM_DIR . "/form_maker_insert.php";
    install_demo_forms();
}
Пример #2
0
function form_maker_activate()
{
    $version = get_option("wd_form_maker_version");
    $new_version = '1.7.55';
    if (!$version) {
        add_option("wd_form_maker_version", $new_version, '', 'no');
        global $wpdb;
        if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
            require_once WD_FM_DIR . "/form_maker_update.php";
            form_maker_update_until_mvc();
            form_maker_update_contact();
            form_maker_update('');
        } else {
            require_once WD_FM_DIR . "/form_maker_insert.php";
            from_maker_insert();
            $email_verification_post = array('post_title' => 'Email Verification', 'post_content' => '[email_verification]', 'post_status' => 'publish', 'post_author' => 1);
            $mail_verification_post_id = wp_insert_post($email_verification_post);
            $wpdb->update($wpdb->prefix . "formmaker", array('mail_verification_post_id' => $mail_verification_post_id), array('id' => 1), array('%d'), array('%d'));
        }
    } elseif (version_compare($version, $new_version, '<')) {
        require_once WD_FM_DIR . "/form_maker_update.php";
        form_maker_update($version);
        update_option("wd_form_maker_version", $new_version);
    }
    require_once WD_FM_DIR . "/form_maker_insert.php";
    install_demo_forms();
}
Пример #3
0
function form_maker_activate()
{
    $version = get_option("wd_form_maker_version");
    $new_version = '1.8.6';
    global $wpdb;
    if (!$version) {
        add_option("wd_form_maker_version", $new_version, '', 'no');
        if ($wpdb->get_var("SHOW TABLES LIKE '" . $wpdb->prefix . "formmaker'") == $wpdb->prefix . "formmaker") {
            require_once WD_FM_DIR . "/form_maker_update.php";
            form_maker_update_until_mvc();
            form_maker_update_contact();
            form_maker_update('');
        } else {
            require_once WD_FM_DIR . "/form_maker_insert.php";
            from_maker_insert();
            $email_verification_post = array('post_title' => 'Email Verification', 'post_content' => '[email_verification]', 'post_status' => 'publish', 'post_author' => 1, 'post_type' => 'fmemailverification');
            $mail_verification_post_id = wp_insert_post($email_verification_post);
            $wpdb->update($wpdb->prefix . "formmaker", array('mail_verification_post_id' => $mail_verification_post_id), array('id' => 1), array('%d'), array('%d'));
        }
    } elseif (version_compare($version, $new_version, '<')) {
        require_once WD_FM_DIR . "/form_maker_update.php";
        $mail_verification_post_ids = $wpdb->get_results($wpdb->prepare('SELECT mail_verification_post_id FROM ' . $wpdb->prefix . 'formmaker WHERE mail_verification_post_id!="%d"', 0));
        if ($mail_verification_post_ids) {
            foreach ($mail_verification_post_ids as $mail_verification_post_id) {
                $update_email_ver_post_type = array('ID' => (int) $mail_verification_post_id->mail_verification_post_id, 'post_type' => 'fmemailverification');
                wp_update_post($update_email_ver_post_type);
            }
        }
        form_maker_update($version);
        update_option("wd_form_maker_version", $new_version);
    }
    require_once WD_FM_DIR . "/form_maker_insert.php";
    install_demo_forms();
}