Файл: modules/profile/index.php
Строк: 723
<?php
include '../../system/core.php';
if(!$user['id']){
header('Location: /index.php'); exit;
}
switch($_GET['m']){
#Главная
default:
$_title = 'Личный кабинет';
include '../../system/header.php';
/////////////////////////////////////////////////
$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>';
echo '</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['status'] >= 1){echo '<div class="msg"><a href="/admin">Админка сайта</a></div>'; }
echo '<a href="/np"><div class="tegi"><font color="white"><b>Газета</b></font></a></div>';
$np = mysql_query("SELECT * FROM `newspaper` order by `id` desc limit 5");
while($np2 = mysql_fetch_assoc($np)){
echo '<div class="post2"><img src="/modules/profile/images/newspaper.png" alt="*"/> <a href="/np_view'.$np2['id'].'">'.$np2['name'].'</a> <font color="grey">('.times($np2['time']).')</font></div>';
}
echo '<div class="tegi"><font color="white">Информация</font></div>';
echo '<div class="menu">';
echo '<a href="/us'.$user['id'].'"><div class="men"><img src="/modules/profile/images/kab.png">В анкету</div></a>';
$c = mysql_result(mysql_query('select count(`id`) from `privat` where `ho` = "'.$user['id'].'" and `read` = "0"'),0);
echo '<a href="/privat"><div class="men"><img src="/modules/profile/images/po4ta.png"/> Почта';
if($c != 0) echo ' (+'.$c.')';
echo '</div></a>';
$c = mysql_result(mysql_query('select count(`id`) from `op` where `who` = "'.$user['id'].'" and `read` = "0"'),0);
echo '<div class="menu">';
echo '<a href="/op"><div class="men"><img src="/modules/profile/images/opo.png"/>Оповещения';
if($c != 0) echo ' (+'.$c.')';
echo '</div></a>';
echo '<a href="news/"><div class="men"><img src="/images/news.png"/> Новости</div></a>';
echo '<a href="/forum?m=new"><div class="men"><img src="/modules/profile/images/nt.png"/> Наблюдаемые темы</div></a>';
echo '<a href="/cab?m=log"><div class="men"><img src="http://www.iconsearch.ru/uploads/icons/humano2/24x24/gnome-system-monitor.png"/> Логи авторизаций</div></a>';
echo '</div><div class="tegi"><font color="white">Настройки</div>
<a href="?m=anketa"><div class="men"><img src="/modules/profile/images/ld.png"> Личные данные</div></a>
<a href="/cab?m=css"><div class="men"><img src="/modules/profile/images/mp.png"/> Дизайны</div></a>
<a href="?m=ava"><div class="men"><img src="/modules/profile/images/photo.png"> Аватар</div></a>
<a href="?m=password"> <div class="men"><img src="/modules/profile/images/kab.png"> Смена пароля</div></a>
<a href="?m=settings"><div class="men"><img src="/modules/profile/images/settings.png"> Дополнительные настройки</div></a>
<div class="tegi"><font color="white">Прочее</div>
<a href="/porte"> <div class="men"><img src="http://www.iconsearch.ru/uploads/icons/iconza/24x24/briefcase.png"/> Портфолио</div></a>
<a href="/cab?m=statmy"> <div class="men"><img src="/images/statmy.png"/> Статистика моя</div></a>
<a href="/cab?m=statob"> <div class="men"><img src="/images/statob.png"/> Общая статистика</div></a>
<a href="/smiles.php"> <div class="men"><img src="/modules/forum/images/emoc.png"/> Смайлы</div></a>
<a href="/bbcode.php"><div class="men"><img src="/modules/forum/images/cod.png"/> ББ коды</div></a>
</div></div>';
break;
case 'ava':
$_title = 'Аватар';
include '../../system/header.php';
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
if(isset($_POST['submit'])){
if(!@file_exists($_FILES['filename']['tmp_name'])) $err[] = 'Вы не выбрали файл!';
if($_FILES['filename']['size'] != 0 and $_FILES['filename']['size'] > 1024000) $err[] = 'Слишком большой файл...';
$filetype = array ( 'jpg', 'gif', 'png', 'jpeg', 'bmp' );
$upfiletype = substr($_FILES['filename']['name'], strrpos( $_FILES['filename']['name'], "." )+1);
if(!in_array($upfiletype,$filetype)) $err[] = 'Вы пытаетесь загрузить недопустимый формат файла...';
if(!$err){
if(!empty($user['ava'])){
unlink('ava/'.$user['ava'].'');
}
$fn = date('dmY').'_fn'.rand(1234,5678).'_'.$_FILES['filename']['name'];
move_uploaded_file($_FILES['filename']['tmp_name'], "ava/".$fn."");
mysql_query("UPDATE `user` SET `ava`='".$fn."' WHERE `id`='".$user['id']."' limit 1");
header('Location: /cab?m=ava'); exit;
}else{
echo '<div class="err"><b>';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</b></div>';
}
}
echo '<div class="post2"><img src="/modules/profile/';
if(empty($user['ava'])) echo 'images/noava.png'; else echo 'ava/'.$user['ava'];
echo '" style="max-width:150px;"/><br>';
if(isset($_GET['del']) && !empty($user['ava'])){
unlink('ava/'.$user['ava'].'');
mysql_query("UPDATE `user` SET `ava`='' WHERE `id`='".$user['id']."' limit 1");
header('Location: /cab?m=ava'); exit;
}
if(!empty($user['ava'])) echo '<img src="/modules/profile/images/stop_2.png"/> <a href="/cab?m=ava&del">Удалить</a>';
echo '</div><div class="post2">
<form action="" method="post" enctype="multipart/form-data">
Файл:<br><input type="file" name="filename"/><br>
<input type="submit" value="Загрузить" name="submit"/>
</form></div>';
break;
///////////////////////////////////////////////////////////////////////////////////////////////////
case 'statmy';
$_title = 'Личная статистика';
include '../../system/header.php';
echo '</div><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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
echo '<div class="post1"><center><b>Форум</b></center>Количество постов: <b>'.mysql_result(mysql_query('select count(`id`) from `forum_m` where `author` = "'.$user['id'].'"'),0).'</b>';
echo '<br>Количество постов за день: <b>'.mysql_result(mysql_query('select count(`id`) from `forum_m` where `author` = "'.$user['id'].'" and `time` > "'.(time()-((60*60)*24)).'"'),0).'</b>';
echo '<br>Количество новых тем: <b>'.mysql_result(mysql_query('select count(`id`) from `forum_t` where `author` = "'.$user['id'].'"'),0).'</b>';
echo '<br>Количество новых тем за день: <b>'.mysql_result(mysql_query('select count(`id`) from `forum_t` where `author` = "'.$user['id'].'" and `time` > "'.(time()-((60*60)*24)).'"'),0).'</b></div>';
echo '<div class="post2"><center><b>Загруз-центр</b></center>Количество файлов: <b>'.mysql_result(mysql_query('select count(`id`) from `zc_f` where `author` = "'.$user['id'].'"'),0).'</b>';
echo '<br>Количество файлов за день: <b>'.mysql_result(mysql_query('select count(`id`) from `zc_f` where `author` = "'.$user['id'].'" and `time` > "'.(time()-((60*60)*24)).'"'),0).'</b></div>';
echo '<div class="post1"><center><b>Полезные кода</b></center>Количество кодов: <b>'.mysql_result(mysql_query('select count(`id`) from `pc_code` where `author` = "'.$user['id'].'"'),0).'</b>';
echo '<br>Количество кодов за день: <b>'.mysql_result(mysql_query('select count(`id`) from `pc_code` where `author` = "'.$user['id'].'" and `time` > "'.(time()-((60*60)*24)).'"'),0).'</b></div>';
break;
//////
case 'statob';
$_title = 'Общая статистика';
include '../../system/header.php';
echo '<div class="tefi"><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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
echo '<div class="post1">Количество постов на форуме: ('.mysql_result(mysql_query('select count(`id`) from `forum_m`'),0).')</div>';
echo '<div class="post2">Количество новых постовна форуме: ('.mysql_result(mysql_query('select count(`id`) from `forum_m` where `time` > "'.(time()-((60*60)*24)).'"'),0).')</div>';
echo '<div class="post1">Количество тем на форуме: ('.mysql_result(mysql_query('select count(`id`) from `forum_t`'),0).')</div>';
echo '<div class="post2">Количество новых тем на форуме: ('.mysql_result(mysql_query('select count(`id`) from `forum_t` where `time` > "'.(time()-((60*60)*24)).'"'),0).')</div>';
echo '<div class="post1">Количество файлов в зц: ('.mysql_result(mysql_query('select count(`id`) from `zc_f` where `status` = "0"'),0).$files_new.')</div>';
echo '<div class="post2">Количество сатьей в газете сайта: ('.mysql_result(mysql_query('select count(`id`) from `newspaper`'),0).')</div>';
echo '<div class="post1">Количество кодов в кусках полезных кодов: ('.mysql_result(mysql_query('select count(`id`) from `pc_code` where `status` = "0"'),0).$codes_new.')</div>';
echo '<div class="post2">Количество зарегестрированых пользователей: ('.mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user`"), 0).')</div>';
echo '<div class="post1">Количество человек в списке мошенников: ('.mysql_result(mysql_query('select count(`id`) from `newspaper1`'),0).')</div>';
echo '<div class="post2">Сейчас онлайн на сайте: ('.mysql_result(mysql_query("SELECT COUNT(`id`) FROM `user` WHERE `online`>'".(time()-3600)."'"), 0).')</div>';
break;
////////////////////////////////////////////////////////////////////////////////////////////////////
case 'anketa':
$_title = 'Личные данные';
include '../../system/header.php';
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$name = TextGuard($_POST['name']);
$country = TextGuard($_POST['country']);
$city = TextGuard($_POST['city']);
$day = TextGuard($_POST['day']);
if(!empty($day)) if(!is_numeric($day) or $day > 31 or $day <= 0) $err[] = 'Ошибка ввода дня даты рождения...';
$m = TextGuard($_POST['m']);
if(!empty($m)) if(!is_numeric($m) or $m > 12 or $m <= 0) $err[] = 'Ошибка ввода месяца даты рождения...';
$birthday = TextGuard($_POST['birthday']);
if(!empty($birthday)) if(!is_numeric($birthday) or $birthday > 2020 or $birthday <= 0) $err[] = 'Ошибка ввода года даты рождения...';
$about = TextGuard($_POST['about']);
$icq = TextGuard($_POST['icq']);
if(!$err){
mysql_query("UPDATE `user` SET `name`='".$name."',`country`='".$country."',`city`='".$city."',`about`='".$about."',`icq`='".$icq."',`birthday`='".$birthday."',`day`='".$day."',`m`='".$m."' WHERE `id`='".$user['id']."' limit 1");
echo '<div class="msg"><img src="/modules/profile/images/clean.png"/> <b>Профиль успешно сохранен!</b></div>';
}else{
echo '<div class="err"><b>';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</b></div>';
}
}
echo '
<div class="post1">
<form action="" method="post">
Имя:<br><input name="name" value="'.$user['name'].'"/><br>
Дата рождения:<br>';
$birthday = explode('.',$user['birthday']);
$day = explode('.',$user['day']);
$m = explode('.',$user['m']);
echo '
<input name="day" size="2" value="'.$day[0].'"/>.<input name="m" size="2" value="'.$m[0].'"/>.<input name="birthday" size="4" value="'.$birthday[0].'"/><br>
Страна:<br><input name="country" value="'.$user['country'].'"/><br>
Город:<br><input name="city" value="'.$user['city'].'"/><br>
О себе:<br><textarea name="about" style="width:98%;" rows="3">'.$user['about'].'</textarea><br>
ICQ:<br><input name="icq" value="'.$user['icq'].'"/><br>
<input type="submit" value="Сохранить" name="submit"/>
</form></div>
';
break;
case 'password':
$_title = 'Смена пароля';
include '../../system/header.php';
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$old = TextGuard($_POST['old']);
if(empty($old) or $old != $user['password']) $err[] = 'Неверный старый пароль...';
$slovo = TextGuard($_POST['slovo']);
if(empty($slovo) or $slovo != $user['secret_word']) $err[] = 'Неверное секретное слово...';
$new = TextGuard($_POST['new']);
if(!$err){
mysql_query("UPDATE `user` SET `password`='".$new."' WHERE `id`='".$user['id']."' limit 1");
setcookie('upassword', $new, time()+86400*365, '/');
echo '<div class="pet"><img src="/modules/profile/images/clean.png"/><b> Новый пароль успешно установлен!</b></div>';
}else{
echo '<div class="err"><b>';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</b></div>';
}
}
echo '
<div class="post1">
<form action="" method="post">
Старый пароль:<br><input name="old" type="password"/><br>
Секретное слово:<br><input name="slovo" type="password"/><br>
Новый пароль:<br><input name="new" type="password"/></div><div class="lst">
<input type="submit" value="Сменить" name="submit"/>
</form></div>
';
///дизайны и логи проверены на баги
break;
case 'log':
$_title = 'Логи авторизаций';
include '../../system/header.php';
echo '</div><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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
$cop = 10;
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `logs` where `who` = '".$user['login']."'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p'])){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
$log = mysql_query("SELECT * FROM `logs` where `who` = '".$user['login']."' ORDER BY `time` DESC LIMIT $start,$cop");
while($log2 = mysql_fetch_array($log))
{
echo '<div class="post1">IP: '.$log2['ip'].' ; Софт: '.$log2['ua'].'</br>';
if($log2['vh'] == 1){ echo '<font color="green"><b>Лог удачен!</b></font>';
}else{
echo '<font color="red"><b>Лог провален!</b></font>';}
echo '</br>Время записи лога: '.times($log2['time']).'</div>';
}
echo '<div class="levo">Стр. ';
if($p-2>0) echo '<a href="/cab?m=log&p=1"><<</a> ';
if($p-1>0) echo '<a href="/cab?m=log&p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/cab?m=log&p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/cab?m=log&p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/cab?m=log&p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/cab?m=log&p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/cab?m=log&p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="/cab?m=log&p='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/cab?m=log&p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/cab?m=log&p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
break;
case 'css':
$_title = 'Дизайны';
include '../../system/header.php';
switch($_GET['mod']){
default:
///проверено
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
echo '<div class="post1"><img src="/modules/profile/images/cs2_standard.png"/> <a href="/cab?m=css&mod=new">Создать дизайн</a></div>
<div class="post2"><img src="/modules/profile/images/cs2_standard.png"/> <a href="/cab?m=css&mod=my">Мои стили</a> ('.mysql_result(mysql_query('select count(`id`) from `css` where `who` = "'.$user['id'].'"'),0).')</div>
<div class="post1"><img src="/modules/profile/images/cs2_standard.png"/> <a href="/cab?m=css&mod=list">Доступные стили</a> ('.mysql_result(mysql_query('select count(`id`) from `css` where `mode` = "1"'),0).')</div>
';
///конец
break;
case 'list':
///проверено
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
$cop = 10;
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `css` where `mode` = '1'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p']) && $ca != 0){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
if(isset($_GET['go'])){
$id = TextGuard($_GET['id']);
$css = mysql_fetch_array(mysql_query('select * from `css` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $css == 0 or $css['mode'] != "1"){
header('Location: /cab?m=css&mod=list'); exit;
}
mysql_query("UPDATE `user` SET `css`='".$id."' WHERE `id` = '".$user['id']."' limit 1");
header('Location: /cab?m=css&mod=list'); exit;
}
$css = mysql_query("SELECT * FROM `css` where `mode` = '1' ORDER BY `id` DESC LIMIT $start,$cop");
while($css2 = mysql_fetch_assoc($css)){
echo '<div class="post1"><big><b>'.$css2['names'].'</b></big> [<a href="/cab?m=css&mod=list&go&id='.$css2['id'].'"><b>Выбрать</b></a>]
</br>Создатель дизайна: '.ustatus($css2['who']).' <a href="/us'.$css2['who'].'">'.uname($css2['who']).'</a> '.uaccess($css2['who']).'</div>';
}
echo '<div class="levo">Стр. ';
if($p-2>0) echo '<a href="/cab?m=css&mod=list&p=1"><<</a> ';
if($p-1>0) echo '<a href="/cab?m=css&mod=list&p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/cab?m=css&mod=list&p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/cab?m=css&mod=list&p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/cab?m=css&mod=list&p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/cab?m=css&mod=list&p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/cab?m=css&mod=list&p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="vp='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/cab?m=css&mod=list&p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/cab?m=css&mod=list&p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
///конец
break;
case 'new':
///проверено
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$names = TextGuard($_POST['names']);
if(empty($names)) $err[] = 'Название дизайна осталось пустым...';
$str = trim(htmlspecialchars($_POST['str']));
if(empty($str)) $err[] = 'Струкура осталось пустой...';
if(!$err){
$name = ''.date('dmY').'_'.rand(11111,99999).'_css'.$name.'';
mysql_query("INSERT INTO `css`(
`file`,
`who`,
`names`,
`mode`
)VALUES(
'".$name."',
'".$user['id']."',
'".$names."',
'0'
)");
$text = ''.$str.'';
$fp = fopen('../../css/'.$name.'.css', 'w');
flock($fp,LOCK_EX);
fputs($fp, $text);
fflush($fp);
flock($fp,LOCK_UN);
fclose($fp);
echo '<div class="msg"><img src="/modules/profile/images/clean.png"/><b> Дизайн успешно создан!</b></div>';
$mode = mysql_query("SELECT * FROM `user` WHERE `status` > '1'");
while($mode2 = mysql_fetch_assoc($mode)){
mysql_query("INSERT INTO `op`(
`who`,
`ho`,
`text`,
`time`,
`read`
)VALUES(
'".$mode2['id']."',
'".$user['id']."',
'создал новый дизайн',
'".time()."',
'0'
)");
}
}else{
echo '<div class="err"><b>';
foreach($err as $err_info){
echo $err_info.'<br>';
}
echo '</b></div>';
}
}
echo '
<div class="post1">
<form action="" method="post">
Название:<br><input name="names"/><br>
Структура:<br><textarea name="str" style="width:98%;" rows="10"/>
body{
}
</textarea><br>
<input type="submit" value="Создать" name="submit"/>
</form></div>
';
///конец
break;
case 'my':
///проверено
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
$cop = 10;
$ca = mysql_result(mysql_query("SELECT COUNT(*) FROM `css` where `who` = '".$user['id']."'"),0);
$cp = ceil($ca/$cop);
if(isset($_GET['p']) && is_numeric($_GET['p']) && $ca != 0){
$p = $_GET['p'];
if($_GET['p']>$cp) $p = $cp;
if($_GET['p']<1)$p = 1;
}else{
$p = 1;
}
$start = $p*$cop-$cop;
if(isset($_GET['go'])){
$id = TextGuard($_GET['id']);
$css = mysql_fetch_array(mysql_query('select * from `css` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $css == 0 or $css['who'] != $user['id']){
header('Location: /cab?m=css&mod=my'); exit;
}
mysql_query("UPDATE `user` SET `css`='".$id."' WHERE `id` = '".$user['id']."' limit 1");
echo '<div class="pet"><b>Стиль успешно установлен!</b></div>';
}
if(isset($_GET['del'])){
$id = TextGuard($_GET['id']);
$css = mysql_fetch_array(mysql_query('select * from `css` where `id` = '.$id.''));
if(empty($id) or !is_numeric($id) or $css == 0 or $css['who'] != $user['id']){
header('Location: /cab?m=css&mod=my'); exit;
}
unlink('../../css/'.$css['file'].'.css');
mysql_query("DELETE FROM `css` WHERE `id`='".$id."'");
echo '<div class="msg"><b>Стиль успешно удален!</b></div>';
}
$css = mysql_query("SELECT * FROM `css` where `who` = '".$user['id']."' ORDER BY `id` DESC LIMIT $start,$cop");
while($css2 = mysql_fetch_assoc($css)){
echo '<div class="post1">Название: <a href="/cab?m=css&mod=my&go&id='.$css2['id'].'">'.$css2['names'].'</a> [<a href="/cab?m=css&mod=my&del&id='.$css2['id'].'">уд</a>]</div>';
}
echo '<div class="levo">Стр. ';
if($p-2>0) echo '<a href="/cab?m=css&mod=my&p=1"><<</a> ';
if($p-1>0) echo '<a href="/cab?m=css&mod=my&p='.($p-1).'"><</a> ';
if($p-3>0) echo '<a href="/cab?m=css&mod=my&p='.($p-3).'">'.($p-3).'</a> | ';
if($p-2>0) echo '<a href="/cab?m=css&mod=my&p='.($p-2).'">'.($p-2).'</a> | ';
if($p-1>0) echo '<a href="/cab?m=css&mod=my&p='.($p-1).'">'.($p-1).'</a> | ';
echo '<b>'.$p.'</b>';
if($p+1<=$cp) echo ' | <a href="/cab?m=css&mod=my&p='.($p+1).'">'.($p+1).'</a>';
if($p+2<=$cp) echo ' | <a href="/cab?m=css&mod=my&p='.($p+2).'">'.($p+2).'</a>';
if($p+3<=$cp) echo ' | <a href="vp='.($p+3).'">'.($p+3).'</a>';
if($p+1<=$cp) echo ' <a href="/cab?m=css&mod=my&p='.($p+1).'">></a>';
if($p+2<=$cp) echo ' <a href="/cab?m=css&mod=my&p='.ceil($ca/$cop).'">>></a>';
echo '</div>';
///проверено
break;
}
break;
case 'faq':
$_title = 'FAQ';
include '../../system/header.php';
switch($_GET['i']){
default:
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
echo '<div class="post1"><a href="/cab?m=faq&i=on">Время онлайн (анкета)</a></div>
<div class="post2"><a href="/cab?m=faq&i=levels">Уровни (анкета)</a></div>
<div class="post1"><a href="/cab?m=faq&i=id">ID (анкета)</a></div>
<div class="post2"><a href="/cab?m=faq&i=ignor">Игнор</a></div>
<div class="post1"><a href="/cab?m=faq&i=status">Статус</a></div>
<div class="post2"><a href="/cab?m=faq&i=medals">Награды</a></div>
<div class="post1"><a href="/cab?m=faq&i=pord">Подписчики</a></div>
<div class="post2"><a href="/cab?m=faq&i=reit">Рейтинг</a></div>
<div class="post1"><a href="/cab?m=faq&i=rulls">Общие правила</a></div>
';
break;
}
break;
case 'settings':
$_title = 'Настройки';
include '../../system/header.php';
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>';
echo '</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>';
}
//////////////////////////////////////////////////////
echo '</div></div>';
include '../../system/nvg.php';
if(isset($_POST['submit'])){
$on_page = TextGuard($_POST['on_page']);
if(empty($on_page) or !is_numeric($on_page) or $on_page < 0 or $on_page > 100)
{ header('Location: /cab?m=settings'); exit; }
mysql_query("UPDATE `user` SET `on_page`='".$on_page."' WHERE `id`='".$user['id']."' limit 1");
header('Location: /cab?m=settings'); exit;
}
echo '<div class="post1">
<form action="" method="post">Пунктов на странице:<br><input name="on_page" value="'.$user['on_page'].'"/> <input type="submit" value="Сохранить" name="submit"/></form>
</div>';
if(isset($_GET['file'])){
if($user['file'] == 0) $file = 1; else $file = 0;
mysql_query("UPDATE `user` SET `file`='".$file."' WHERE `id`='".$user['id']."' limit 1");
header('Location: /cab?m=settings'); exit;
}
///if(isset($_GET['op'])){
///if($user['op'] == 0) $op = 1; else $op = 0;
///mysql_query("UPDATE `user` SET `op`='".$op."' WHERE `id`='".$user['id']."' limit 1");
///header('Location: /cab?m=settings'); exit;
///}
echo '<div class="post2"><a href="/cab?m=settings&file">';
if($user['file'] == 0) echo 'Включить'; else echo 'Выключить';
echo '</a> добавление файлов</div>';
///<div class="mist"><a href="/cab?m=settings&op">';
///if($user['op'] == 0) echo 'Включить'; else echo 'Выключить';
///echo '</a> обычные оповещения</div>';
break;
}
include '../../system/footer.php';
?>