[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/demos/blog/protected/Pages/Posts/ -> MyPost.php (source)

   1  <?php
   2  /**
   3   * MyPost class file
   4   *
   5   * @author Qiang Xue <qiang.xue@gmail.com>
   6   * @link http://www.pradosoft.com/
   7   * @copyright Copyright &copy; 2006 PradoSoft
   8   * @license http://www.pradosoft.com/license/
   9   * @version $Id: MyPost.php 1397 2006-09-07 07:55:53Z wei $
  10   */
  11  
  12  /**
  13   * MyPost class
  14   *
  15   * @author Qiang Xue <qiang.xue@gmail.com>
  16   * @link http://www.pradosoft.com/
  17   * @copyright Copyright &copy; 2006 PradoSoft
  18   * @license http://www.pradosoft.com/license/
  19   */
  20  class MyPost extends BlogPage
  21  {
  22  	protected function bindData()
  23      {
  24          $author=$this->User->ID;
  25          $offset=$this->PostGrid->CurrentPageIndex*$this->PostGrid->PageSize;
  26          $limit=$this->PostGrid->PageSize;
  27          $this->PostGrid->DataSource=$this->DataAccess->queryPosts("author_id=$author",'','ORDER BY a.status DESC, create_time DESC',"LIMIT $offset,$limit");
  28          $this->PostGrid->VirtualItemCount=$this->DataAccess->queryPostCount("author_id=$author",'');
  29          $this->PostGrid->dataBind();
  30      }
  31  
  32  	public function onLoad($param)
  33      {
  34          parent::onLoad($param);
  35          if(!$this->IsPostBack)
  36              $this->bindData();
  37      }
  38  
  39  	public function changePage($sender,$param)
  40      {
  41          $this->PostGrid->CurrentPageIndex=$param->NewPageIndex;
  42          $this->bindData();
  43      }
  44  
  45  	public function pagerCreated($sender,$param)
  46      {
  47          $param->Pager->Controls->insertAt(0,'Page: ');
  48      }
  49  }
  50  
  51  ?>


Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7