Просмотр файла friends/index.php

Размер файла: 1.55Kb
<?php 

require '../inc/func.php';
bk_head('Friends List');
require '../inc/head.php'; 


if (!$user)
{
header('location: /index.php') ;
}

echo '<div class="list1"><div class="tt">&nbsp;'.$lng_friends['tt'].'</b> </div>';

$req = mysql_result(mysql_query("SELECT COUNT(*) FROM `friend_reqs` WHERE `fid` = '$userid'"), 0);
if($req > 0)
{
	echo '<div class="notic"><a href="requests.php">'.$lng_friends['rq'].'</a></div>';
}

##################################
$total = mysql_result(mysql_query("SELECT COUNT(*) FROM friends WHERE uid ='$userid' "), 0);
$display = 5;
$count_pages = ceil($total/$display);
$page = (isset($_GET['page']) and is_numeric($_GET['page']) and $_GET['page']>1 and $_GET['page']<=$count_pages) ? $_GET['page'] : 1;
$start = $page*$display-$display;
############################

$req_friends = mysql_query("SELECT * FROM friends WHERE uid ='$userid' ORDER BY time DESC LIMIT $start,$display ");

if (mysql_num_rows($req_friends) > 0)
{
    while ($row = mysql_fetch_assoc($req_friends))
	{
	    $uid = $row['fid'];
echo '<div class="list1">';
echo '<span>';
echo avatar($uid,35,50);
echo '</span>';
echo ''.user($uid).'</div>';	
	}

    if($total > 5 && $page < $count_pages)
{
echo '<div class="shadow">';
navi($page,$count_pages,'index.php?page=');
echo '</div><br />';
}

}
else 
{
	err (''.$lng_friends['emty'].'');
}
echo '<hr><div class="shadow"><a href="/users/my.php"><b>My Menu</b></a> | <a href="/u/'.$userid.'"><b>Profile</b></a> | <a href="/exit.php"><b>LogOut</b></a></div></div>';


bk_foot();
?>