Просмотр файла users/listfriends.php

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

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

$id = isset($_GET['id']) ? num($_GET['id']):'1';

$c_f = mysql_result(mysql_query("select count(*) from friends where uid = $id"),0);
$display = 5;
$count_pages = ceil($c_f/$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;

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

if($c_f > 0){

$q_f = mysql_query("select * from friends where uid = $id order by time desc limit $start,$display");
echo '<div class="list1"><div class="tt">Danh sách bạn của '.user_info($id,'username').'</div></div>';
while ($f = mysql_fetch_assoc($q_f)){
echo '<div class="list1">';
echo user($f['fid']);
echo '</div>';
}
    if($c_f > 5)
{
echo '<div class="shadow">';
pages($page,$count_pages,'listfriends.php?id='.$id.'&page=');
echo '</div><br />';
}
echo '</div>';
}else{
echo '<div class="list1"><div class="tt">&nbsp;Danh sách bạn của '.user_info($id,'username').'</div><div class="notic">Trẻ tự kỉ, chưa có bạn nào <img src="/smiles/yao.png" /></div></div>';

}
bk_foot();

?>