$db->free_result($pms); $txt = $vbulletin->options['bbtitle'] . ';' . $vbulletin->options['bburl'] . "\r\n"; $txt .= construct_phrase($vbphrase['private_message_dump_for_user_x_y'], $vbulletin->userinfo['username'], vbdate($vbulletin->options['dateformat'] . ' ' . $vbulletin->options['timeformat'], TIMENOW)) . " -->\r\n\r\n"; foreach ($pmfolders as $folder => $messages) { $foldername =& $foldernames["{$folder}"]; $txt .= "################################################################################\r\n"; $txt .= "{$vbphrase['folder']} :\t{$foldername}\r\n"; $txt .= "################################################################################\r\n\r\n"; foreach ($messages as $pm) { // turn all single \n into \r\n $pm['message'] = preg_replace("/(\r\n|\r|\n)/s", "\r\n", $pm['message']); $pm['message'] = fetch_censored_text($pm['message']); ($hook = vBulletinHook::fetch_hook('private_downloadpm_bit')) ? eval($hook) : false; $txt .= "================================================================================\r\n"; $txt .= "{$vbphrase['dump_from']} :\t{$pm['fromuser']}\r\n"; $txt .= "{$vbphrase['dump_to']} :\t" . fetch_touser_string($pm) . "\r\n"; $txt .= "{$vbphrase['date']} :\t" . vbdate('Y-m-d H:i', $pm['datestamp'], false, false) . "\r\n"; $txt .= "{$vbphrase['title']} :\t" . unhtmlspecialchars($pm['title']) . "\r\n"; $txt .= "--------------------------------------------------------------------------------\r\n"; $txt .= "{$pm['message']}\r\n\r\n"; } } // download the file file_download($txt, str_replace(array('\\', '/'), '-', "{$vbphrase['dump_privatemessages']}-" . $vbulletin->userinfo['username'] . "-" . vbdate($vbulletin->options['dateformat'], TIMENOW) . '.txt'), 'text/plain'); break; // ***************************** // unknown download format // ***************************** // unknown download format default: eval(standard_error(fetch_error('invalidid', $vbphrase['file_type'], $vbulletin->options['contactuslink'])));
$foldername =& $foldernames["$folder"]; $txt .= "################################################################################\r\n"; $txt .= "$vbphrase[folder] :\t$foldername\r\n"; $txt .= "################################################################################\r\n\r\n"; foreach ($messages AS $pm) { // turn all single \n into \r\n $pm['message'] = preg_replace("/(\r\n|\r|\n)/s", "\r\n", $pm['message']); $pm['message'] = fetch_censored_text($pm['message']); ($hook = vBulletinHook::fetch_hook('private_downloadpm_bit')) ? eval($hook) : false; $txt .= "================================================================================\r\n"; $txt .= "$vbphrase[dump_from] :\t$pm[fromuser]\r\n"; $txt .= "$vbphrase[dump_to] :\t" . fetch_touser_string($pm) . "\r\n"; $txt .= "$vbphrase[date] :\t" . vbdate('Y-m-d H:i', $pm['datestamp'], false, false) . "\r\n"; $txt .= "$vbphrase[title] :\t" . unhtmlspecialchars($pm['title']) . "\r\n"; $txt .= "--------------------------------------------------------------------------------\r\n"; $txt .= "$pm[message]\r\n\r\n"; } } // download the file file_download($txt, str_replace(array('\\', '/'), '-', "$vbphrase[dump_privatemessages]-" . $vbulletin->userinfo['username'] . "-" . vbdate($vbulletin->options['dateformat'], TIMENOW) . '.txt'), 'text/plain'); break; // ***************************** // unknown download format default: eval(standard_error(fetch_error('invalidid', $vbphrase['file_type'], $vbulletin->options['contactuslink'])));