<?php session_start();
  	include_once("conn/conn.php");
	include_once("config.php");

if($_SESSION[name]!=""){
$smarty->assign("names","T");
$smarty->assign("name",$_SESSION[name]);
}
include_once("top.php");
$smarty->assign("user_id",$_GET[user_id]);		//获取用户
$smarty->assign("user",$_GET[video_user]);		//获取用户

	$i_sqlstr="select * from tb_video_type ";
	$i_rst = $conn->execute($i_sqlstr);
	$arrays=$i_rst->GetRows();
	$smarty->assign("video_type",$arrays);

	$l_sqlstr="select * from tb_video where tb_video_author='".$_GET[video_user]."' order by tb_video_id ";
//	$l_sqlstr="select * from tb_video where tb_video_auditing=1 order by tb_video_id limit 4";  需要审核
	$l_rst = $conn->execute($l_sqlstr);
$arrays=$l_rst->GetRows();
	$total1=count($arrays);
if(empty($_GET[pages])==true || is_numeric($_GET[pages])==false){
	$page1=1;
}else{
	$page1=intval($_GET[pages]);
}
if($total1==0){

$smarty->assign("discuss_false","F");

}else{ 
	$pagesize1=1;
	if($total1<$pagesize1){
		$pagecount1=1;
	}else{
		if($total1%$pagesize1==0){
			$pagecount1=intval($total1/$pagesize1);
		}else{
			$pagecount1=intval($total1/$pagesize1)+1;
		} 
	}
$smarty->assign("total1",$total1);			//通过assign方法将数组$array中的数据写入到myrow中      
$smarty->assign("pagesize1",$pagesize1);	//通过assign方法将数组$array中的数据写入到myrow中      
$smarty->assign("page1",$page1);			//通过assign方法将数组$array中的数据写入到myrow中      
$smarty->assign("pagecount1",$pagecount1);	//通过assign方法将数组$array中的数据写入到myrow中      

}

	$d_sqlstr="select * from tb_video where tb_video_author='".$_GET[video_user]."' order by tb_video_id desc";
	$d_rst = $conn->SelectLimit($d_sqlstr,$pagesize1,($page1-1)*$pagesize1);
	$arrayes=$d_rst->GetRows();
	$smarty->assign("video",$arrayes);


	$s_sqlstr="select count(tb_video_user) as subscibe_counts from tb_subscibe where tb_subscibe_user='".$_GET[video_user]."'";
	$s_rst=$conn->execute($s_sqlstr);
	$array_s=$s_rst->GetRows();
	$smarty->assign("subscibe_counts",$array_s[0][subscibe_counts]);		//统计用户订阅的数目


	$smarty->display("individualism_video.tpl");
?>