function handle_repair_panel() { global $action, $page, $M_options; wp_reset_vars(array('action', 'page')); ?> <div class='wrap nosubsub'> <div class="icon32" id="icon-tools"><br></div> <h2><?php _e('Repair Membership', 'membership'); ?> </h2> <?php if (isset($_GET['msg'])) { echo '<div id="message" class="updated fade"><p>' . $messages[(int) $_GET['msg']] . '</p></div>'; $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']); } ?> <p><?php _e('If you are having problems with your membership site, or have recently upgraded and are seeing strange behaviour then try the membership check below to see if there are any issues with your table structure. Click on the repair button if you want to repair any issues found (back up your database first).', 'membership'); ?> </p> <p> <?php echo "<a href='" . wp_nonce_url("?page=" . $page . "&tab=advanced&verify=yes", 'verify-membership') . "' class='button'>" . __('Verify Membership Tables', 'membership') . "</a> "; ?> <?php echo "<a href='" . wp_nonce_url("?page=" . $page . "&tab=advanced&repair=yes", 'repair-membership') . "' class='button'>" . __('Repair Membership Tables', 'membership') . "</a>"; ?> </p> <?php if (isset($_GET['verify'])) { check_admin_referer('verify-membership'); include_once membership_dir('membershipincludes/classes/upgrade.php'); ?> <p><strong><?php _e('Verifying', 'membership'); ?> </strong></p> <?php M_verify_tables(); } if (isset($_GET['repair'])) { check_admin_referer('repair-membership'); include_once membership_dir('membershipincludes/classes/upgrade.php'); ?> <p><strong><?php _e('Verifying and Repairing', 'membership'); ?> </strong></p> <?php M_repair_tables(); } ?> </div> <!-- wrap --> <?php }
function M_Upgrade($from = false) { switch ($from) { default: case 0: M_Createtables(); case 1: case 2: M_Alterfor2(); case 3: M_Alterfor3(); case 4: case 5: M_Alterfor4(); case 6: M_Alterfor5(); case 7: M_Alterfor6(); case 8: case 9: M_Alterfor10(); case 10: M_Alterfor11(); case 11: M_Alterfor12(); case 12: case 13: M_Alterfor14(); case 14: M_Alterfor15(); case 15: case 16: case 17: M_Alterfor16(); case 18: case 19: case 20: case 21: M_Alterfor18(); case 22: M_Alterfor22(); M_repair_tables(false); break; } }