ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 10133


Ignore:
Timestamp:
Jan 14, 2009, 7:39:48 PM (11 years ago)
Author:
nagasawa
Message:

fixed the newest information page error

Location:
OpenPNE3/plugins/opFavoritePlugin/trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opFavoritePlugin/trunk/lib/action/opFavoritePluginFavoriteActions.class.php

    r10127 r10133  
    4444  {
    4545    $this->pager = FavoritePeer::retrievePager($this->getUser()->getMemberId(), $request->getParameter('page'));
    46     $this->members = FavoritePeer::retrieveMembers($this->pager->getResults());
    4746    if (!$this->pager->getNbResults())
    4847    {
    4948      return sfView::ERROR;
    5049    }
     50    $this->members = FavoritePeer::retrieveMembers($this->pager->getResults());
    5151  }
    5252
     
    5858  public function executeDiarybloglist($request)
    5959  {
    60     $this->diaryPager = FavoritePeer::retrieveDiaryPager($this->getUser()->getMemberId(), $request->getParameter('id'));
     60    $page = $request->hasParameter('page') ? $request->getParameter('page') : 1;
     61    $this->diaryPager = FavoritePeer::retrieveDiaryPager($this->getUser()->getMemberId(), $page);
    6162    if (!$this->diaryPager->getNbResults())
    6263    {
  • OpenPNE3/plugins/opFavoritePlugin/trunk/lib/model/FavoritePeer.php

    r10127 r10133  
    2121    $pager->setPage($page);
    2222    $pager->init();
    23  
    2423    return $pager;
    2524  }
     
    109108  public static function retrieveDiaryPager($member_id, $page = 1, $size = 10)
    110109  {
    111     $favorites = self::retrieveFavorites($member_id, $size);
     110    $favorites = self::retrieveFavorites($member_id);
    112111    $c = new Criteria();
    113112    foreach ($favorites as $favorite)
    114113    {
    115       $c->add(DiaryPeer::MEMBER_ID, $favorite->getTargetMemberId());
     114      $c->addOr(DiaryPeer::MEMBER_ID, $favorite->getTargetMemberId());
    116115    }
    117116    $c->addDescendingOrderbyColumn(DiaryPeer::ID);
     
    121120    $pager->setPage($page);
    122121    $pager->init();
    123 
    124122    return $pager;
    125123  }
Note: See TracChangeset for help on using the changeset viewer.