';
if ($mass1['sex'])
echo '
';
else
echo '
';
echo '
' . $mass1['name'] . '';
$ontime = $mass1['lastdate'];
$ontime2 = $ontime + 300;
if ($realtime > $ontime2) {
echo '
[Off]';
}
else {
echo '
[ON]';
}
if ($mass['text'])
echo '
' . checkout($mass['text'], 1, 1);
echo '
';
++$i;
}
}
else {
echo '';
}
echo '
';
break;
default :
if ($id && $id != $user_id) {
$req = mysql_query("SELECT * FROM `users` WHERE `id` = '$id' LIMIT 1");
if (mysql_num_rows($req)) {
$res = mysql_fetch_assoc($req);
$textl = 'Друзья: ' . $res['name'];
}
else {
require_once ('../incfiles/head.php');
echo display_error('Такого пользователя не существует');
require_once ("../incfiles/end.php");
exit;
}
$user = $id;
}
else {
$id = false;
$user = $user_id;
$textl = 'Мои друзья';
}
require_once ("../incfiles/head.php");
if ($mod == 'm') {
echo '
';
$i = 1;
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user`='" . $user . "' and `preg`='1' AND `sex`='m'"), 0);
$query = mysql_query("select * from `friends` where `user`='" . $user . "' and `preg`='1' AND `sex`='m' ORDER BY `id` DESC LIMIT " . $start . "," . $kmess);
if ($count) {
while ($mass = mysql_fetch_array($query)) {
$uz = mysql_query("select * from `users` where `id`='" . $mass['to'] . "';");
$mass1 = mysql_fetch_array($uz);
echo ($i % 2) ? '
' : '
';
if ($mass1['sex']) {
echo '
';
}
else {
echo '
';
}
echo '
' . $mass1['name'] . '';
$ontime = $mass1['lastdate'];
$ontime2 = $ontime + 300;
if ($realtime > $ontime2) {
echo '
[Off]';
}
else {
echo '
[ON]';
}
if (! $id) {
echo ' [
л.с]';
echo '
[X]';
}
echo '
';
++$i;
}
echo '
Всего друзей: ' . $count . '
';
if ($count > $kmess) {
echo '
' . pagenav('friends.php?mod=m&', $start, $count, $kmess) . '
';
echo '
';
}
}
else {
echo '';
}
}
else if ($mod == 'zh') {
echo '
';
$i = 1;
$count = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user`='" . $user . "' and `preg`='1' AND `sex`='zh'"), 0);
$query = mysql_query("select * from `friends` where `user`='" . $user . "' and `preg`='1' AND `sex`='zh' ORDER BY `id` DESC LIMIT " . $start . "," . $kmess);
if ($count) {
while ($mass = mysql_fetch_array($query)) {
$uz = mysql_query("select * from `users` where `id`='" . $mass['to'] . "';");
$mass1 = mysql_fetch_array($uz);
echo ($i % 2) ? '
' : '
';
if ($mass1['sex']) {
echo '
';
}
else {
echo '
';
}
echo '
' . $mass1['name'] . '';
$ontime = $mass1['lastdate'];
$ontime2 = $ontime + 300;
if ($realtime > $ontime2) {
echo '
[Off]';
}
else {
echo '
[ON]';
}
if (! $id) {
echo ' [
л.с]';
echo '
[X]';
}
echo '
';
++$i;
}
echo '
Всего подруг: ' . $count . '
';
if ($count > $kmess) {
echo '
' . pagenav('friends.php?mod=zh&', $start, $count, $kmess) . '
';
echo '
';
}
}
else {
echo '';
}
}
else {
$f = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user`='" . $user . "' AND `preg`='0';"), 0);
$fm = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user`='" . $user . "' AND `preg`='1' AND `sex`='m';"), 0);
$fw = mysql_result(mysql_query("SELECT COUNT(*) FROM `friends` WHERE `user`='" . $user . "' AND `preg`='1' AND `sex`='zh';"), 0);
echo '
' . ($id ? 'Друзья ' . $res['name'] . '' : 'Мои друзья') . '
';
echo '';
echo '';
if ($id)
echo '
';
else
echo '
';
}
break;
}
}
echo "
В кабинет
";
require_once ("../incfiles/end.php");
?>