verify_upload_folder($vbulletin->GPC['attachpath']); $oldpath = $vbulletin->options['attachpath']; // update $vboptions $db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\t\t\t\tSET value = '" . $db->escape_string($vbulletin->GPC['attachpath']) . "'\n\t\t\t\t\tWHERE varname = 'attachpath'\n\t\t\t\t"); build_options(); // show message print_stop_message('your_vb_settings_have_been_updated_to_store_attachments_in_x', $vbulletin->GPC['attachpath'], $oldpath); } break; // ############################################################################# // move attachments from database to filesystem // ############################################################################# // move attachments from database to filesystem case 'DB_to_FS': // check path is valid verify_upload_folder($vbulletin->GPC['attachpath']); // update $vboptions $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting\n\t\t\t\tSET value = '" . $db->escape_string($vbulletin->GPC['attachpath']) . "'\n\t\t\t\tWHERE varname = 'attachpath'\n\t\t\t"); build_options(); break; } // ############################################################################# print_form_header('attachment', 'domoveattachment'); print_table_header($vbphrase['edit_storage_type']); construct_hidden_code('dowhat', $vbulletin->GPC['dowhat']); if ($vbulletin->GPC['dowhat'] == 'DB_to_FS') { print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_attachments_from_database_to_filesystem']); } else { print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_attachments_from_filesystem_to_database']); } print_input_row($vbphrase['number_of_attachments_to_process_per_cycle'], 'perpage', 300, 1, 5);
$commands = array(); $have_change = false; if ($vbulletin->GPC['album_picpath'] != $vbulletin->options['album_picpath']) { $vbulletin->GPC['album_picpath'] = preg_replace('#[/\\\\]+$#', '', $vbulletin->GPC['album_picpath']); verify_upload_folder($vbulletin->GPC['album_picpath']); $old = htmlspecialchars_uni($vbulletin->options['album_picpath']); $new = htmlspecialchars_uni($vbulletin->GPC['album_picpath']); $paths[] = "<em>{$vbphrase['full_pictures']}</em>: {$old} >> {$new}"; $commands[] = "mv {$old}/* {$new}/"; $have_change = true; $db->query_write("\n\t\t\tUPDATE " . TABLE_PREFIX . "setting SET\n\t\t\t\tvalue = '" . $db->escape_string($vbulletin->GPC['album_picpath']) . "'\n\t\t\tWHERE varname = 'album_picpath'\n\t\t"); } if ($vbulletin->options['album_dataloc'] == 'fs_directthumb') { if ($vbulletin->GPC['album_thumbpath'] != $vbulletin->options['album_thumbpath']) { $vbulletin->GPC['album_thumbpath'] = preg_replace('#[/\\\\]+$#', '', $vbulletin->GPC['album_thumbpath']); verify_upload_folder($vbulletin->GPC['album_thumbpath']); $old = htmlspecialchars_uni($vbulletin->options['album_thumbpath']); $new = htmlspecialchars_uni($vbulletin->GPC['album_thumbpath']); $paths[] = "<em>{$vbphrase['thumbnails']}</em>: {$old} >> {$new}"; $commands[] = "mv {$old}/* {$new}/"; $have_change = true; $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET\n\t\t\t\t\tvalue = '" . $db->escape_string($vbulletin->GPC['album_thumbpath']) . "'\n\t\t\t\tWHERE varname = 'album_thumbpath'\n\t\t\t"); } if ($vbulletin->GPC['album_thumburl'] != $vbulletin->options['album_thumburl']) { $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET\n\t\t\t\t\tvalue = '" . $db->escape_string($vbulletin->GPC['album_thumburl']) . "'\n\t\t\t\tWHERE varname = 'album_thumburl'\n\t\t\t"); $have_change = true; } } if (!$have_change) { print_stop_message('no_file_paths_changed'); }
// update $vboptions $db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET value =\n\t\t\t\t\tCASE varname\n\t\t\t\t\t\tWHEN '{$path}' THEN '" . $db->escape_string($imagepath) . "'\n\t\t\t\t\t\tWHEN '{$url}' THEN '" . $db->escape_string($imageurl) . "'\n\t\t\t\t\tELSE value END\n\t\t\t\t\tWHERE varname IN('{$path}', '{$url}')\n\t\t\t\t"); build_options(); // show message print_stop_message('your_vb_settings_have_been_updated_to_store_images_in_x', $imagepath, $oldpath); } break; // ############################################################################# // move userpics from database to filesystem // ############################################################################# // move userpics from database to filesystem case 'DB_to_FS': // check path is valid verify_upload_folder($vbulletin->GPC['avatarpath']); verify_upload_folder($vbulletin->GPC['profilepicpath']); verify_upload_folder($vbulletin->GPC['sigpicpath']); // update $vboptions $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET value =\n\t\t\t\tCASE varname\n\t\t\t\t\tWHEN 'avatarpath' THEN '" . $db->escape_string($vbulletin->GPC['avatarpath']) . "'\n\t\t\t\t\tWHEN 'avatarurl' THEN '" . $db->escape_string($vbulletin->GPC['avatarurl']) . "'\n\t\t\t\t\tWHEN 'profilepicpath' THEN '" . $db->escape_string($vbulletin->GPC['profilepicpath']) . "'\n\t\t\t\t\tWHEN 'profilepicurl' THEN '" . $db->escape_string($vbulletin->GPC['profilepicurl']) . "'\n\t\t\t\t\tWHEN 'sigpicpath' THEN '" . $db->escape_string($vbulletin->GPC['sigpicpath']) . "'\n\t\t\t\t\tWHEN 'sigpicurl' THEN '" . $db->escape_string($vbulletin->GPC['sigpicurl']) . "'\n\t\t\t\tELSE value END\n\t\t\t\tWHERE varname IN('avatarpath', 'avatarurl', 'profilepicurl', 'profilepicpath', 'sigpicurl', 'sigpicpath')\n\t\t\t"); build_options(); break; } // ############################################################################# print_form_header('avatar', 'domoveavatar'); print_table_header(construct_phrase($vbphrase['edit_storage_type'], "<span class=\"normal\">" . $vbphrase['user_pictures'] . "</span>")); construct_hidden_code('dowhat', $vbulletin->GPC['dowhat']); if ($vbulletin->GPC['dowhat'] == 'DB_to_FS') { print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_images_from_database_to_filesystem']); } else { print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_images_from_filesystem_to_database']); } print_input_row($vbphrase['number_of_users_to_process_per_cycle'], 'perpage', 300, 1, 5);
verify_upload_folder($imagepath); $oldpath = $vbulletin->options['groupiconpath']; // update $vboptions $db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET value = \n\t\t\t\t\tCASE varname\n\t\t\t\t\t\tWHEN 'groupiconpath' THEN '" . $db->escape_string($imagepath) . "'\n\t\t\t\t\t\tWHEN 'groupiconurl' THEN '" . $db->escape_string($imageurl) . "'\n\t\t\t\t\tELSE value END\n\t\t\t\t\tWHERE varname IN('groupiconpath', 'groupiconurl')\n\t\t\t\t"); build_options(); // show message print_stop_message('your_vb_settings_have_been_updated_to_store_group_icons_in_x', $imagepath, $oldpath); } break; // ############################################################################# // move userpics from database to filesystem // ############################################################################# // move userpics from database to filesystem case 'DB_to_FS': // check path is valid verify_upload_folder($vbulletin->GPC['groupiconpath']); // update $vboptions $db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "setting SET value =\n\t\t\t\tCASE varname\n\t\t\t\t\tWHEN 'groupiconpath' THEN '" . $db->escape_string($vbulletin->GPC['groupiconpath']) . "'\n\t\t\t\t\tWHEN 'groupiconurl' THEN '" . $db->escape_string($vbulletin->GPC['groupiconurl']) . "'\n\t\t\t\tELSE value END\n\t\t\t\tWHERE varname IN('groupiconpath', 'groupiconurl')\n\t\t\t"); build_options(); break; } // ############################################################################# print_form_header('socialgroup_icon', 'domoveicon'); print_table_header(construct_phrase($vbphrase['edit_storage_type'], "<span class=\"normal\">" . $vbphrase['social_group_icons'] . "</span>")); construct_hidden_code('dowhat', $vbulletin->GPC['dowhat']); if ($vbulletin->GPC['dowhat'] == 'DB_to_FS') { print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_group_icons_from_database_to_filesystem']); } else { print_description_row($vbphrase['we_are_ready_to_attempt_to_move_your_group_icons_from_filesystem_to_database']); } print_input_row($vbphrase['number_of_groups_to_process_per_cycle'], 'perpage', 300, 1, 5);