<?php
/**
 * @package iCMS
 * @copyright 2007-2010, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <idreamsoft@qq.com>
 */
!defined('iPATH') && exit('What are you doing?');
include iPATH.'include/catalog.class.php';
	$catalog= new catalog();
	$cid	= (int)$_GET['cid'];
	$status	= $_GET['type']=='draft'?0:1;
	$sql	= " where `status` ='$status' AND `postype`='0' AND `userid`='$member->uId'";
	$orderby= $_GET['orderby']?$_GET['orderby']:"id DESC";
	$maxperpage =(int)$_GET['perpage']>0?$_GET['perpage']:10;
	$total=$iCMS->db->getValue("SELECT count(*) FROM `#iCMS@__article` {$sql} order by {$orderby}");
	page($total,$maxperpage,"篇文章");
	$rs=$iCMS->db->getArray("SELECT * FROM `#iCMS@__article` {$sql} order by {$orderby} LIMIT {$firstcount} , {$maxperpage}");
	$_count=count($rs);
	include iCMS_usercp_tpl("home");
?>