Файл: vsime.com/anketa/index.php
Строк: 712
<?php
$title = 'Анкета';
include('../system/includes/system.php');
if (isset($_GET['id']))
{
$ank = profile(intval($_GET['id']));
if (!@$ank['id'])
{
$title .= ' - Ошибка!';
ex_head();
$error[] = 'Пользователь не найден.';
show_errors();
ex_foot();
}
} else {
if_user('is_reg');
$ank = $user;
}
$title .= " $ank[nick]";
$array_love = array();
if ($ank['anketa']['friendly_and_talking']==1)$array_love[] = 'Дружба и общение';
if ($ank['anketa']['flirt']==1)$array_love[] = 'Флирт, СМС-переписка';
if ($ank['anketa']['love']==1)$array_love[] = 'Любовь, отношения';
if ($ank['anketa']['love_family']==1)$array_love[] = 'Брак, создание семьи';
if ($ank['anketa']['virt_sex']==1)$array_love[] = 'Виртуальный секс';
if ($ank['anketa']['real_sex']==1)$array_love[] = 'Секс в реале';
if ($ank['anketa']['sponsor']==1)$array_love[] = 'Ищу спонсора';
if ($ank['anketa']['i_sponsor']==1)$array_love[] = 'Стану спонсором';
if (count($array_love)>0)$ank['anketa']['love'] = implode(', ', $array_love);
else $ank['anketa']['love'] = NULL;
$array_body = array('0' => '', 'default' => 'Обычное', 'thin' => 'Худощавое', 'sports' => 'Спортивное', 'brawny' => 'Мускулистое', 'dense' => 'Плотное', 'full' => 'Полное');
$array_work = array('0' => '', 'school' => 'Учусь в школе', 'koledzh' => 'Учусь в колледже/лицее', 'vyz' => 'Учусь в ВУЗе', 'war' => 'Учусь в военном училище', 'armiya' => 'Служу в армии', 'working' => 'Работаю', 'no_working' => 'Не работаю', 'zona' => 'Сижу на зоне');
$array_smoking = array('0' => '', 'no_smoking' => 'Не курю', 'smoking' => 'Курю', 'some_times' => 'Иногда', 'drop' => 'Бросаю');
$array_pol_type = array('0' => '', 'getero' => 'Гетеро', 'gl' => 'Гей/лесби', 'bi' => 'Би');
$array_family = array('0' => '', 'no' => 'Нет', 'yes' => 'Да', 'now_no' => 'Уже нет');
$ank['time_online'] = last_vremja($ank['time'], 1, 1);
if ($ank['anketa']['city']!=0)
{
$city = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `city` WHERE `id` = '".$ank['anketa']['city']."' LIMIT 1"));
$country = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `country` WHERE `id` = '$city[country]' LIMIT 1"));
$ank['anketa']['city_show'] = "<a href='/search/?act=users&case=city&city=$city[id]'>".hsc($city['name'])."</a> (<a href='/search/?act=users&case=country&country=$country[id]'>".hsc($country['name'])."</a>)";
} else $ank['anketa']['city_show'] = NULL;
if ($ank['anketa']['device']!=0)
{
$device = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `devices_list` WHERE `id` = '".$ank['anketa']['device']."' LIMIT 1"));
$cat = mysqli_fetch_array(mysqli_query($dbi, "SELECT * FROM `devices_cat` WHERE `id` = '$device[id_cat]' LIMIT 1"));
$ank['anketa']['device_show'] = "<a href='/devices/?act=device_info&id_device=$device[id]'>".hsc($cat['name'])." ".hsc($device['name'])."</a>";
} else $ank['anketa']['device_show'] = NULL;
if (isset($_GET['edit']) && isset($user) && ($ank['id'] == $user['id'] || isset($moderate_site)))
{
if (in_array(my_esc($_GET['edit']), array('for_love', 'tipazh', 'other', 'books', 'color_eye', 'color_hair', 'dmy', 'body', 'family', 'films', 'harakter', 'hobbies', 'love', 'music', 'name', 'o_partner', 'o_sebe', 'on_body', 'pol', 'pol_type', 'rost', 'smoking', 'ves', 'work', 'work_type', 'familia')))
{
$title .= ' - Редактировать';
ex_head();
include('inc/edit_'.my_esc($_GET['edit']).'.php');
echo "<div class='foot'>".image_back()." <a href='?id=$ank[id]&edit'>Назад</a></div>n";
ex_foot();
}
$title .= ' - Редактировать';
ex_head();
echo "<div class='grand_h'>n";
echo "<div class='overfl_hid'>n";
echo "<img src=/anketa/i/data_reg.png> Дата регистрации: ".vremja($ank['date_reg'])."<br />n";
echo "<img src=/anketa/i/data_visit.png> Последний визит: ".vremja($ank['date_last'])."<br />n";
echo "<img src=/anketa/i/time_online.png> Время онлайн: $ank[time_online]<br />n";
// вывод рейтинга юзера
echo "<img src=/anketa/i/rating.png> Рейтинг: ".show_akt_rating($ank['id'], 1)."<br />n";
$ank['visits'] = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `ank_visits` WHERE `id_user` = '$ank[id]'"));
$ank['visits_new'] = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `ank_visits` WHERE `id_user` = '$ank[id]' AND `read` = '0'"));
$ank['visits_show'] = "$ank[visits] ".($ank['visits_new']>0 && $ank['id']==$user['id'] && isset($user)?" <span style='color: green;'>(+$ank[visits_new])":NULL);
echo "<img src=/anketa/i/visit_show.png> Просмотров за месяц: $ank[visits_show]<br />n";
if ($ank['id']==$user['id'] && isset($user))mysqli_query($dbi, "UPDATE `ank_visits` SET `read` = '1' WHERE `id_user` = '$ank[id]' AND `read` = '0'");
echo "</div>n";
$count_bans_all = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$ank[id]'"));
$count_bans_showed = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$ank[id]' AND `show` = '1'"));
if ($count_bans_showed > 0 || $count_arr_bans > 0 && $count_bans_all > 0)echo "<div class='list'><a href='/bans/?id=$ank[id]'>Нарушения ($count_bans_showed".($count_arr_bans > 0?"/$count_bans_all":NULL).")</a>n";
echo "</div>n";
echo "<div class='clear'></div>n";
echo "</div>n";
echo '<div class=list>';
show_avatar_page($ank['id'], 'big', 1, 1);
echo '</div>';
echo "<div class='list'>n";
echo "<a href='?id=$ank[id]&edit=name'>Имя:</a> ".hsc($ank['anketa']['name'])." <br />n";
echo "<a href='?id=$ank[id]&edit=pol'>Пол:</a> ".($ank['anketa']['pol']==0?"Женский":"Мужской")."<br />n";
echo "<a href='?id=$ank[id]&edit=dmy'>Возраст:</a> ".$ank['anketa']['age']." (".$ank['anketa']['g_r']."-".$ank['anketa']['m_r']."-".$ank['anketa']['d_r'].")<br />n";
echo "<a href='/selector/?act=location&select_for=anketa&uid=$ank[id]&mdp=$mdp'>Город:</a> ".$ank['anketa']['city_show']."<br />n";
echo "<a href='?id=$ank[id]&edit=hobbies'>Интересы:</a> ".hsc($ank['anketa']['hobbies'])."<br />n";
echo "<a href='?id=$ank[id]&edit=music'>Любимая музыка:</a> ".hsc($ank['anketa']['music'])."<br />n";
echo "<a href='?id=$ank[id]&edit=films'>Любимые фильмы:</a> ".hsc($ank['anketa']['films'])."<br />n";
echo "<a href='?id=$ank[id]&edit=books'>Любимые книги:</a> ".hsc($ank['anketa']['books'])."<br />n";
echo "<a href='/selector/?act=device&select_for=anketa&uid=$ank[id]&mdp=$mdp'>Модель телефона:</a> ".($ank['anketa']['device_show'])."<br />n";
echo "<a href='?id=$ank[id]&edit=o_sebe'>О себе:</a> ".hsc($ank['anketa']['o_sebe'])."<br />n";
echo "</div>n";
echo "<div class='mod_grad'>";
echo "<a href='?id=$ank[id]&edit=for_love'>Для знакомства</a><br />n";
echo "<a href='?id=$ank[id]&edit=tipazh'>Типаж</a><br />n";
echo "<a href='?id=$ank[id]&edit=other'>Дополнительно</a><br />n";
echo "</div>";
echo "<div class='foot'>";
echo imgsd('eye.png')." <a href='/anketa/?id=$ank[id]'>Просмотреть анкету</a><br />n";
echo "</div>";
ex_foot();
}
// запись визита
if (isset($user) && !mysqli_result("SELECT COUNT(*) FROM `ank_visits` WHERE `id_user` = '$ank[id]' AND `id_ank` = '$user[id]'") && $ank['id'] != $user['id'])mysqli_query($dbi, "INSERT INTO `ank_visits` SET `id_user` = '$ank[id]', `id_ank` = '$user[id]', `time` = '$time'");
$links_hist['name'] = "$ank[nick] / Анкета";
$title .= ' - Редактировать';
ex_head();
echo "<div class='grand_h'>n";
echo "<div class='overfl_hid'>n";
echo "<img src=/anketa/i/data_reg.png> Дата регистрации: ".vremja($ank['date_reg'])."<br />n";
echo "<img src=/anketa/i/data_visit.png> Последний визит: ".vremja($ank['date_last'])."<br>n";
$query_is = mysqli_query($dbi, "SELECT * FROM `user_group_is` WHERE `id_user` = '$ank[id]' AND `show` = '1' ORDER BY `id_group` DESC");
while ($post_is = mysqli_fetch_array($query_is))
{
echo "<span class='spagr'>n";
echo "$post_is[name]";
echo "</span><br>n";
}
echo "<img src=/anketa/i/time_online.png> Время онлайн: $ank[time_online]<br />n";
// вывод рейтинга юзера
echo "<img src=/anketa/i/rating.png> Рейтинг: ".show_akt_rating($ank['id'], 1)."<br />n";
$ank['visits'] = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `ank_visits` WHERE `id_user` = '$ank[id]'"));
$ank['visits_new'] = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `ank_visits` WHERE `id_user` = '$ank[id]' AND `read` = '0'"));
$ank['visits_show'] = "$ank[visits] ".($ank['visits_new']>0 && $ank['id']==$user['id'] && isset($user)?" <span style='color: green;'>(+$ank[visits_new])":NULL);
echo "<img src=/anketa/i/visit_show.png> Просмотров за месяц: $ank[visits_show]<br />n";
if ($ank['id']==$user['id'] && isset($user))mysqli_query($dbi, "UPDATE `ank_visits` SET `read` = '1' WHERE `id_user` = '$ank[id]' AND `read` = '0'");
echo "</div>n";
echo "</div>n";
$count_bans_all = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$ank[id]'"));
$count_bans_showed = mysqli_num_rows(mysqli_query($dbi, "SELECT * FROM `users_ban` WHERE `id_comm` = '0' AND `id_user` = '$ank[id]' AND `show` = '1'"));
if ($count_bans_showed > 0 || $count_arr_bans > 0 && $count_bans_all > 0)echo "<div class='list'><a href='/bans/?id=$ank[id]'>Нарушения ($count_bans_showed".($count_arr_bans > 0?"/$count_bans_all":NULL).")</a>n";
echo "<div class='clear'></div>n";
echo "</div>n";
echo '<div class=list>';
show_avatar_page($ank['id'], 'big', 1, 1);
echo '</div>';
Echo '<div class=foot>Основное</div>';
echo "<div class='list'>n";
if ($ank['anketa']['name'])echo "<span class='list_a'>Имя:</span> <span class='list_n'>".hsc($ank['anketa']['name'])."</span><br />n";
echo "<span class='list_a'>Пол:</span> <span class='list_n'>".($ank['anketa']['pol']==0?"Женский":"Мужской")."</span><br />n";
if ($ank['anketa']['age'])echo "<span class='list_a'>Возраст:</span> <span class='list_n'>".$ank['anketa']['age']." (".$ank['anketa']['g_r']."-".$ank['anketa']['m_r']."-".$ank['anketa']['d_r'].")</span><br />n";
if ($ank['anketa']['city_show'])echo "<span class='list_a'>Город:</span> <span class='list_n'>".$ank['anketa']['city_show']."</span><br />n";
if ($ank['anketa']['device_show'])echo "<span class='list_a'>Модель мобильника:</span> <span class='list_n'>".($ank['anketa']['device_show'])."</span><br />n";
if ($ank['anketa']['o_sebe'])echo "<span class='list_a'>О себе:</span> <span class='list_n'>".output_text($ank['anketa']['o_sebe'], $ank['id'])."</span><br />n";
echo "</div>n";
if ($ank['anketa']['hobbies'] || $ank['anketa']['music'] || $ank['anketa']['films'] || $ank['anketa']['books'])
{
echo "<div class=foot>Увлечения и интересы</div>";
echo "<div class='list'>n";
}
if ($ank['anketa']['hobbies'])echo "<span class='list_a'>Интересы:</span> <span class='list_n'>".hsc($ank['anketa']['hobbies'])."</span><br />n";
if ($ank['anketa']['music'])echo "<span class='list_a'>Любимая музыка:</span> <span class='list_n'>".hsc($ank['anketa']['music'])."</span><br />n";
if ($ank['anketa']['films'])echo "<span class='list_a'>Любимые фильмы:</span> <span class='list_n'>".hsc($ank['anketa']['films'])."</span><br />n";
if ($ank['anketa']['books'])echo "<span class='list_a'>Любимые книги:</span> <span class='list_n'>".hsc($ank['anketa']['books'])."</span><br />n";
if ($ank['anketa']['hobbies'] || $ank['anketa']['music'] || $ank['anketa']['films'] || $ank['anketa']['books'])echo "</div>n";
if ($array_pol_type[$ank['anketa']['pol_type']] || $ank['anketa']['love'] || $array_family[$ank['anketa']['family']] || $ank['anketa']['o_partner'])
{
echo "<div class=foot>Знакомства</div>";
echo "<div class='list'>n";
}
if ($array_pol_type[$ank['anketa']['pol_type']])echo "<span class='list_a'>Ориентация:</span> <span class='list_n'>".$array_pol_type[$ank['anketa']['pol_type']]."</span><br />n";
if ($ank['anketa']['love'])echo "<span class='list_a'>Цель знакомства:</span> <span class='list_n'>".$ank['anketa']['love']."</span><br />n";
if ($array_family[$ank['anketa']['family']])echo "<span class='list_a'>Состою в браке:</span> <span class='list_n'>".$array_family[$ank['anketa']['family']]."</span><br />n";
if ($ank['anketa']['o_partner'])echo "<span class='list_a'>О партнере:</span> <span class='list_n'>".hsc($ank['anketa']['o_partner'])."</span><br />n";
if ($array_pol_type[$ank['anketa']['pol_type']] || $ank['anketa']['love'] || $array_family[$ank['anketa']['family']] || $ank['anketa']['o_partner'])echo "</div>n";
if ($ank['anketa']['rost'] || $ank['anketa']['ves'] || $ank['anketa']['color_eye'] || $ank['anketa']['color_hair'] || $array_body[$ank['anketa']['body']] || $ank['anketa']['pirsing']==1 || $ank['anketa']['taty']==1 || $ank['anketa']['harakter'])
{
echo "<div class=foot>Типаж</div>";
echo "<div class='list'>n";
}
if ($ank['anketa']['rost'])echo "<span class='list_a'>Рост:</span> <span class='list_n'>".hsc($ank['anketa']['rost'])."</span><br />n";
if ($ank['anketa']['ves'])echo "<span class='list_a'>Вес:</span> <span class='list_n'>".hsc($ank['anketa']['ves'])."</span><br />n";
if ($ank['anketa']['color_eye'])echo "<span class='list_a'>Цвет глаз:</span> <span class='list_n'>".hsc($ank['anketa']['color_eye'])."</span><br />n";
if ($ank['anketa']['color_hair'])echo "<span class='list_a'>Волосы:</span> <span class='list_n'>".hsc($ank['anketa']['color_hair'])."</span><br />n";
if ($array_body[$ank['anketa']['body']])echo "<span class='list_a'>Телосложение:</span> <span class='list_n'>".$array_body[$ank['anketa']['body']]."</span><br />n";
if ($ank['anketa']['pirsing']==1 || $ank['anketa']['taty']==1)echo "<span class='list_a'>У меня на теле есть:</span> <span class='list_n'>".($ank['anketa']['pirsing']==1?'пирсинг':null).($ank['anketa']['taty']==1?($ank['anketa']['pirsing']==1?', ':NULL).'татуировки':null)."</span><br />n";
if ($ank['anketa']['harakter'])echo "<span class='list_a'>Характер:</span> <span class='list_n'>".hsc($ank['anketa']['harakter'])."</span><br />n";
if ($ank['anketa']['rost'] || $ank['anketa']['ves'] || $ank['anketa']['color_eye'] || $ank['anketa']['color_hair'] || $array_body[$ank['anketa']['body']] || $ank['anketa']['pirsing']==1 || $ank['anketa']['taty']==1 || $ank['anketa']['harakter'])echo "</div>n";
if ($array_work[$ank['anketa']['work']] || $ank['anketa']['profession'] || $array_smoking[$ank['anketa']['smoking']])
{
echo "<div class=foot>Дополнительно</div>";
echo "<div class='list'>n";
}
if ($array_work[$ank['anketa']['work']])echo "<span class='list_a'>Чем я занимаюсь:</span> <span class='list_n'>".$array_work[$ank['anketa']['work']]."</span><br />n";
if ($ank['anketa']['profession'])echo "<span class='list_a'>Профессия:</span> <span class='list_n'>".hsc($ank['anketa']['profession'])."</span><br />n";
if ($array_smoking[$ank['anketa']['smoking']])echo "<span class='list_a'>Курите ли вы:</span> <span class='list_n'>".$array_smoking[$ank['anketa']['smoking']]."</span><br />n";
if ($array_work[$ank['anketa']['work']] || $ank['anketa']['profession'] || $array_smoking[$ank['anketa']['smoking']])echo "</div>n";
if (isset($user))
{
echo "<div class='mod_grad'>";
if (isset($user) && ($ank['id']==$user['id'] || isset($moderate_site)))echo "$config[code_edit]<a href='?id=$ank[id]&edit'>Редактировать</a><br />n";
if (isset($user) && $ank['id']==$user['id'])echo imgsd('avatar.png')." <a href='/fotos/?select=avatar'>Сменить аватар</a><br />n";
if (isset($user) && $ank['id']!=$user['id'])echo imgsd('mail.png')." <a href='/mail/?act=new_message&id=$ank[id]'>Сообщение</a><br />nn";
echo "</div>";
echo "<div class='foot'>";
echo image_back()." <a href='$config[profile_page]?id=$ank[id]'>Страничка $ank[nick]</a><br />nn";
echo "</div>";
}
ex_foot();
?>