Файл: world-faces.ru/world-faces.ru/frend.php
Строк: 60
<?php
include_once 'i.php';
only_reg();
$al['id'] = $us['id'];
$id = (isset($_GET['id'])) ? $_GET['id'] : NULL;
if(isset($id)){
$al['id'] = $id;
}
$q = mysql_query("SELECT * FROM `user` WHERE `id` = '".$al['id']."' LIMIT 1");
if(mysql_num_rows($q)==0){
header("Location: index.php");
exit;
}
$al = mysql_fetch_array($q);
$set['title'] = 'Список друзей '.$al['nick'].'';
include_once 'sys/inc/thead.php';
title();
aut();
echo '<div class="rowup">';
$add = (isset($_GET['add'])) ? htmlspecialchars(mysql_real_escape_string(trim($_GET['add']))) : NULL;
if(isset($add)){
msg('Заявка отправлена');
header ("location:frend.php?id=$al[id]");
}
echo'</div>';
if($al['id']==$us['id']){
echo "<div class='prof'>";
echo '<a href="frend_new.php">Предложение дружбы</a></div>';
$f_onl = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` INNER JOIN `user` ON `frends`.`frend`=`user`.`id` WHERE `frends`.`user` = '$al[id]' AND `frends`.`i` = '1' AND `user`.`date_last`>'".(time()-600)."'"), 0);
echo "<div class='prof'>";
echo '<a href="frend.php">Друзья на сайте ('.$f_onl.')</a></div>';
echo "</div>";
}
echo'<div class="onmenu">';
$k_post = mysql_result(mysql_query("SELECT COUNT(*) FROM `frends` WHERE `user` = '".$al['id']."' AND `i` = '1'"),0);
if($k_post==0){
echo 'У обитателя <span style="color:'.$al['ncolor'].'">'.$al['nick'].'</span> нет друзей';
}
$k_page = k_page($k_post,$set['p_str']);
$page = page($k_page);
$start = $set['p_str']*$page-$set['p_str'];
$q = mysql_query("SELECT * FROM `frends` WHERE `user` = '".$al['id']."' AND `i` = '1' ORDER BY time DESC LIMIT $start, $set[p_str]");
while ($f = mysql_fetch_array($q)){
echo'<div class="prof">';
$a = mysql_fetch_array(mysql_query("SELECT * FROM `user` WHERE `id` = '".$f['frend']."' LIMIT 1"));
echo avatar4($a['id']);
echo '<a href="/info.php?id='.$a['id'].'"><span style="color:'.$a['ncolor'].'">'.$a['nick'].'</span></a> ';
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `id` = '$f[frend]' AND `date_last` > '".(time()-3600)."' LIMIT 1"),0)==1){
$on=olorg;
}else{
$on=ofl;
}
echo "<img src='img/$on.gif' alt='off' class='icon'/><br />n";
echo '<a href="/msg'.$a['id'].'"><img src="/img/mail.png" alt="ico"/></a>';
if($al['id']==$user['id']){
echo '<a href="/frend_new.php?del='.$a['id'].'"><img src="/img/delete_user.png" alt="ico"/></a>';
}
echo'<br/>';
$status=mysql_query("SELECT * FROM `status_user` WHERE `id_user` = $a[id] ORDER BY time DESC LIMIT 1");
while ($s = mysql_fetch_array($status)){
echo '<div class="guser_aut">';
echo '<b><a href="/user_status/alls.php?id='.$a['id'].'"><span style="color:'.$a['color'].'">';
echo output_text($s['msg'])."</a></b><small> (".vremja($s['time']).")</small> <a href='/user_status/komm.php?id=$s[id]'>[".mysql_result(mysql_query("SELECT COUNT(*) FROM `status_komm1` WHERE `id_status` = '$s[id]'"),0)."]<img src='/sys/inc/komm.png' alt''></a> <a href='/user_status/index.php?id=$s[id]&vote'>[".mysql_result(mysql_query("SELECT COUNT(*) FROM `status_vote` WHERE `id_status` = '$s[id]'"),0)."]<img src='/user_status/bbl3.png' alt''></a> n";
if (($us['level'])==4){echo'<a href="user_status/index.php?id='.$s['id'].'&delete">[x]</a>';}
echo "</span>n";
}
echo'</div></div>';
}
if($k_page>1){
str("?id=".$al['id']."&",$k_page,$page);
}
echo '</div></div>';
include_once 'sys/inc/tfoot.php';
?>