From 05869f23f798c9393e2bc6d310d56a97a11d1acd Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 29 May 2006 02:05:19 +0000 Subject: Added blog demo (not done yet) --- demos/blog/protected/Pages/Posts/MyPost.php | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 demos/blog/protected/Pages/Posts/MyPost.php (limited to 'demos/blog/protected/Pages/Posts/MyPost.php') diff --git a/demos/blog/protected/Pages/Posts/MyPost.php b/demos/blog/protected/Pages/Posts/MyPost.php new file mode 100644 index 00000000..be03ca63 --- /dev/null +++ b/demos/blog/protected/Pages/Posts/MyPost.php @@ -0,0 +1,34 @@ +User->ID; + $offset=$this->PostGrid->CurrentPageIndex*$this->PostGrid->PageSize; + $limit=$this->PostGrid->PageSize; + $this->PostGrid->DataSource=$this->DataAccess->queryPosts("author_id=$author",'','','ORDER BY a.status ASC, create_time DESC',"LIMIT $offset,$limit"); + $this->PostGrid->VirtualItemCount=$this->DataAccess->queryPostCount("author_id=$author",'',''); + $this->PostGrid->dataBind(); + } + + public function onLoad($param) + { + parent::onLoad($param); + if(!$this->IsPostBack) + $this->bindData(); + } + + public function changePage($sender,$param) + { + $this->PostGrid->CurrentPageIndex=$param->NewPageIndex; + $this->bindData(); + } + + public function pagerCreated($sender,$param) + { + $param->Pager->Controls->insertAt(0,'Page: '); + } +} + +?> \ No newline at end of file -- cgit v1.2.3