Файл: blogs/load.php
Строк: 119
<?php
require'../shaxty.php'; // waphp.ru - закрытый клуб вап мастеров!
check_login();
$inf = mysql_fetch_array(mysql_query("select * from `blogs` WHERE tip = 'msg' and `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']."/blogs/".$inf['id']."rnАвтор блога: ".user($inf['user_id'])."";
$download_file .= $stroka;
$rand = rand(1000, 9999);
$filename = $imjasajta . '_blog_'.$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 />";
$txt_tmp = html_entity_decode(trim($inf['msg']), ENT_QUOTES, 'UTF-8');
$download_file = "$download_file $txt_tmp";
++$i;
$download_file = $download_file . '<HR NOSHADE COLOR="Blue" SIZE="1">Блог: <b>http://'.$_SERVER['HTTP_HOST'].'/blogs/'.$inf['id'].'</b><br />Автор блога: <b>'.user($inf['user_id']).'</b></body></html>';
$rand = rand(1000, 9999);
$filename = $imjasajta . '_blog_'.$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;
}
}
?>