<?php 
date_default_timezone_set('Asia/Shanghai');
header('Content-Type: text/html; charset=utf-8');
$page=ceil($_GET['page']);
$type=$_GET['type'];
$author_id=$_GET['author_id'];
if($page==''){$page=1;}
$min=($page-1)*20;
$max=20;
if($type=='' and $author_id==''){ 
	$TRecord = mysql_query("SELECT * FROM ".$BIAOTOU."content");
    /*获取总记录数*/
    $RecordCount = mysql_num_rows($TRecord);
    $pagelast=ceil($RecordCount/20); 
	$rows=$mysql->query("select * from `".$BIAOTOU."content` order by id desc limit {$min},{$max}");
	$n=mysql_query("select * from `".$BIAOTOU."content` order by id desc limit {$min},{$max}");
	$n = mysql_num_rows($n);
	$row=$rows[0];
	}elseif($type){  
	$TRecord = mysql_query("SELECT * FROM ".$BIAOTOU."content where `type`='$type'");
   /*获取总记录数*/
    $RecordCount = mysql_num_rows($TRecord);
    $pagelast=ceil($RecordCount/20); 
	$rows=$mysql->query("select * from `".$BIAOTOU."content` where `type`='$type' order by id desc limit {$min},{$max}");
	$n=mysql_query("select * from `".$BIAOTOU."content` where `type`='$type' order by id desc limit {$min},{$max}");
	$n = mysql_num_rows($n);
	$row=$rows[0];
	$row_type=$mysql->query("select * from `".$BIAOTOU."type` where id='$type' limit 1");
	$webtitle=$row_type[0]['type'].'-'.$webtitle;
	}elseif($author_id){
	$rows=$mysql->query("select * from `".$BIAOTOU."content` where `author_id`='$author_id' order by `time` desc limit {$min},{$max}");
	$n=mysql_query("select * from `".$BIAOTOU."content` where `author_id`='$author_id' order by `time` desc limit {$min},{$max}");
	$n = mysql_num_rows($n);
	$row=$rows[0];
	$webtitle=$rows[0]['author'].'-'.$webtitle;
	}
	
?>