header("Content-type: text/plain"); if (!empty($vbulletin->GPC['table']) and $vbulletin->GPC['table'] != 'all tables') { header("Content-disposition: attachment; filename=\"" . preg_replace('#[\\r\\n]#', '', $vbulletin->GPC['table']) . ".sql\""); echo fetch_table_dump_sql($vbulletin->GPC['table']); } else { header("Content-disposition: attachment; filename=\"vbulletin.sql\""); $result = $db->query_write("SHOW tables"); while ($currow = $db->fetch_row($result)) { echo fetch_table_dump_sql($currow[0]) . "\n\n\n"; } } echo "\r\n\r\n\r\n### {$upgradecore_phrases['vb_db_dump_completed']} ###"; exit; } if ($_REQUEST['do'] == 'choose') { print_upgrade_header(); echo '</div>'; print_form_header('', ''); print_table_header($upgradecode_phrases['vb_database_backup_system']); print_description_row($upgradecore_phrases['dump_database_desc']); print_table_footer(); $sqltable = array('all tables' => $upgradecore_phrases['dump_all_tables']); $tables = $db->query_write("SHOW TABLES"); while ($table = $db->fetch_array($tables, DBARRAY_NUM)) { $sqltable["{$table['0']}"] = $table[0]; } print_form_header('upgrade_300b3', 'sqltable'); print_table_header($upgradecore_phrases['dump_data_to_sql']); construct_hidden_code('step', 'backup'); print_label_row($upgradecore_phrases['choose_table_to_dump'], '<select name="table" class="bginput">' . construct_select_options($sqltable) . '</select>'); print_submit_row($upgradecore_phrases['dump_tables'], 0);
@set_time_limit(0); } // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## // check for valid php version verify_vb3_enviroment(); exec_nocache_headers(); $vbulletin->input->clean_array_gpc('r', array('step' => TYPE_STR, 'startat' => TYPE_UINT, 'perpage' => TYPE_UINT)); $vbulletin->GPC['step'] = empty($vbulletin->GPC['step']) ? 'welcome' : intval($vbulletin->GPC['step']); $query = array(); $explain = array(); $hiddenfields = array(); // assuming we've got through the authentication process, show the upgradeHeader. if (empty($_REQUEST['do'])) { print_upgrade_header(fetch_step_title($vbulletin->GPC['step'])); } // *************************************************************************************************************************** // ######################################################################### // ############# GENERIC UPGRADE / INSTALL FUNCTIONS PROTOTYPES ############ // ######################################################################### // ######################################################################### // checks the environment for vB3 conditions // call this BEFORE calling init.php or any other files function verify_vb3_enviroment() { global $installcore_phrases, $vbulletin; $errorthrown = false; // php version check if (!function_exists('version_compare') or version_compare(PHP_VERSION, '4.3.2', '<=')) { $errorthrown = true;