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

Changeset 7862


Ignore:
Timestamp:
Jul 29, 2008, 5:44:55 PM (12 years ago)
Author:
ebihara
Message:

#2865:参加コミュニティの一覧を表示できるようにした

Location:
OpenPNE3/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/actions/actions.class.php

    r7861 r7862  
    9292
    9393 /**
     94  * Executes joinlist action
     95  *
     96  * @param sfRequest $request A request object
     97  */
     98  public function executeJoinlist($request)
     99  {
     100    $this->pager = CommunityPeer::getJoinCommunityListPager($request->getParameter('member_id', $this->getUser()->getMemberId()), $request->getParameter('page', 1));
     101
     102    return sfView::SUCCESS;
     103  }
     104
     105 /**
    94106  * Executes join action
    95107  *
  • OpenPNE3/trunk/apps/pc_frontend/modules/friend/templates/homeSuccess.php

    r7856 r7862  
    66<li><?php echo link_to('フレンドになる', 'friend/link?id=' . $member->getId()) ?></li>
    77<?php endif; ?>
     8<li><?php echo link_to(sprintf('参加コミュニティ一覧(%d)', $member->countCommunityMembers()), 'community/joinlist?member_id=' . $member->getId()) ?></li>
    89</ul>
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/templates/homeSuccess.php

    r7860 r7862  
    44<li><?php echo link_to('コミュニティ追加', 'community/edit') ?></li>
    55<li><?php echo link_to('コミュニティ一覧', 'community/list') ?></li>
     6<li><?php echo link_to(sprintf('参加コミュニティ一覧(%d)', $sf_user->getMember()->countCommunityMembers()), 'community/joinlist') ?></li>
    67</ul>
  • OpenPNE3/trunk/lib/model/CommunityPeer.php

    r7857 r7862  
    1010class CommunityPeer extends BaseCommunityPeer
    1111{
     12  public static function getJoinCommunityListPager($memberId, $page = 1, $size = 20)
     13  {
     14    $c = new Criteria();
     15    $c->add(CommunityMemberPeer::MEMBER_ID, $memberId);
     16    $c->addJoin(self::ID, CommunityMemberPeer::COMMUNITY_ID);
     17
     18    $pager = new sfPropelPager('Community', $size);
     19    $pager->setCriteria($c);
     20    $pager->setPage($page);
     21    $pager->init();
     22
     23    return $pager;
     24  }
    1225}
  • OpenPNE3/trunk/plugins/sfOpenPNESecurityUserPlugin/lib/user/sfOpenPNESecurityUser.class.php

    r7854 r7862  
    4949  {
    5050    return $this->getAttribute('member_id', null, 'sfOpenPNESecurityUser');
     51  }
     52
     53  public function getMember()
     54  {
     55    return MemberPeer::retrieveByPk($this->getMemberId());
    5156  }
    5257
Note: See TracChangeset for help on using the changeset viewer.