Файл: PROFIWM.COM/modules/profile/redakt_css.php
Строк: 58
<?php
include '../../system/core.php';
include '../../system/header.php';
$_title = 'Редактор диза';
if(!$user['id']){ header('Location: /index.php'); exit; }
##################################################################################
$id = TextGuard($_GET['id']);
$css = mysql_fetch_array(mysql_query('select * from `css` where `id` = '.$id.''));
echo '<div class="tegi"><b>Дизайны | Мои стили</b></div></div>';
/////////////////////////////////////////////////
$rek = mysql_query("SELECT * FROM `ads` WHERE `mode` = '1'");
echo '<div class="rek"><div class="rekl"><img src="/images/r.png" alt="*"> <a href="/bl?bl=rek">Купить рекламу</a></br>';
while($rek2 = mysql_fetch_array($rek)){ echo '<img src="/images/r.png" alt="*"> <a href="'.$rek2['link'].'">'.$rek2['name'].'</a></br>'; }
echo '</div></div>';
include '../../system/nvg.php';
if($user['id']) {
echo ' <div class="start">';
echo '<div class="s" style="border-bottom:none;">';
echo '<table style="width:100%" cellspacing="0" cellpadding="0">';
echo '<tbody><tr><td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/cab" title="Кабинет"><img class="ico" align="middle" src="/images/vcard.png" alt="*"></a></center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center>';
echo '<a href="/privat/" title="Почта"><img class="ico" align="middle" src="/images/mail2.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo ' <b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '<td style="vertical-align:top;width:10%;">';
echo '<center><a href="/op/" title="Оповещения"><img class="ico" align="middle" src="/images/warning.png" alt="*"></a>';
if($user['id']){
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
if($c != 0) echo '<b> (+'.$c.')</b>';
}
echo '</center></td>';
echo '</tr></tbody></table>';
echo '</div>';
}
if($user['id'] != $css['who']) {
echo '<div class="pet"><b>Вы не имеете права редачить чужой стиль</b></div>';
header('Refresh: 2; /modules/profile/redakt_css.php?id='.$css['id'].'');
include '../../system/footer.php';
exit;
}
@chmod('../../css/'.$css['file'].'.css',0777);
///////////////////////////////
$a = file_get_contents("../../css/$css[file].css");
if(isset($_REQUEST['ok'])) {
////// Фильтрация и вывод ошибки
$diz = $_POST['diz'];
if(empty($diz)) {
echo '<div class="pet"><b>Введите структуру стиля</b></div>';
header('Refresh: 2; /modules/profile/redakt_css.php?id='.$css['id'].'');
include '../../system/footer.php';
exit;
}
////// Фильтрация и вывод ошибки
$names = $_POST['names'];
if(empty($names)) {
echo '<div class="pet"><b>Введите название стиля</b></div>';
header('Refresh: 2; /modules/profile/redakt_css.php?id='.$css['id'].'');
include '../../system/footer.php';
exit;
}
$fil="../../css/$css[file].css";
$fp=fopen($fil,'w');
fwrite($fp,$diz);
fclose($fp);
mysql_query("UPDATE `css` SET `names` = '".$names."' WHERE `id` = '".$id."'");
echo '<div class="pet"><b>Вы удачно изменили дизайн</b></div>';
header('Refresh: 2; /modules/profile/redakt_css.php?id='.$css['id'].'');
include '../../system/footer.php';
exit;
}
//////*************///////
echo '<div class="post1"><form name="forma" method="POST" action="">
Название стиля: <br/>
<input name="names" type="text" value="'.$css['names'].'" placeholder="Название"/><br/>
Структура стиля: <br/>
<textarea name="diz" style="width: 100%; height: 70%;"> '.$a.'</textarea><br/>
<input type="submit" name="ok" value="Сохранить"> </form></div>';
##################################################################################
include '../../system/footer.php';
?>