Файл: masteram_us/wm_infa/load.php
Строк: 118
<?php
require'../shaxty.php'; // waphp.ru - закрытый клуб вап мастеров!
$inf = mysql_fetch_array(mysql_query("select * from `wm_infa` where `id` = '".$id."'"));
if (isset($_GET['act'])) {
$mod = intval($_GET['act']);
switch ($mod) {
case 1 :
////////////////////////////////////////////////////////////
// Сохраняем тему в текстовом формате //
////////////////////////////////////////////////////////////
$download_file = $inf['name'] . "rnrn";
$inf['msg'] = html_entity_decode(trim($inf['msg']), ENT_QUOTES, 'UTF-8'); $txt_tmp = "".$inf['msg']."";
$txt_tmp = str_replace("<br />", "rn", $txt_tmp);
$txt_tmp = str_replace(""", """, $txt_tmp);
$txt_tmp = notags(str_replace("'", "'", $txt_tmp));
$stroka = $txt_tmp. "rn---------------rnДанная статья была скачана с сайта: http://".$_SERVER['HTTP_HOST']."";
$download_file .= $stroka;
$rand = rand(1000, 9999);
$filename = $imjasajta . '_infa_'.$inf['id'] . '.txt';
header('Content-Type: text/plain; name="'.$filename.'"');
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Content-Transfer-Encoding: plain/text');
header('Content-Length: '.strlen($download_file));
print $download_file;
break;
case 2 :
////////////////////////////////////////////////////////////
// Сохраняем тему в формате HTML //
////////////////////////////////////////////////////////////
$download_file =
"<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>Форум</title>
<style type='text/css'>
body {
font-size : 12px;
font-family : Verdana, Arial, Helvetica, sans-serif;
margin : auto;
background-color : #f8f8f8;
color : #000;
padding : 1px;
}
.b {background-color: #FFFFFF; }
.c2 {
background-image : url(shaxty/foot.png);
color : #000;
padding : 1px;
background-color : #e5e5e5;
border : 1px solid #adadad;
background-repeat : repeat-x;
}
.head {
background-image : url(shaxty/head.png);
color : #000000;
text-align : center;
font-weight : bold;
padding : 2px;
background-color : #e5e5e5;
padding : 3px;
border-top : 3px solid #adadad;
}
.citata {
background-color : #ffdabf;
padding : 1px;
border-top : 3px solid #ffa560;
}
dl {
margin-top : 1ex;
margin-bottom : 0;
margin-left : 0;
}
</style></head>
<body><div class="head">$inf[name]</div><br />";
$inf['msg'] = html_entity_decode(trim($inf['msg']), ENT_QUOTES, 'UTF-8');
$txt_tmp = php_code($inf['msg']);
$txt_tmp = str_replace("rn", "<br/>", $txt_tmp);
$download_file = "$download_file $txt_tmp";
++$i;
$download_file = $download_file . '<p>Данная статья была скачана с сайта: <b>http://'.$_SERVER['HTTP_HOST'].'</b></p></body></html>';
$rand = rand(1000, 9999);
$filename = $imjasajta . '_infa_'.$inf['id'] . '.html';
header('Content-Type: text/html; name="'.$filename.'"');
header('Content-Disposition: attachment;filename="'.$filename.'"');
header('Content-Transfer-Encoding: text/html');
header('Content-Length: '.strlen($download_file));
print $download_file;
break;
}
}
?>