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

Changeset 11013


Ignore:
Timestamp:
Mar 12, 2009, 9:46:32 PM (10 years ago)
Author:
ShogoKawahara
Message:

fixed Profile page doesn't shuffle friend and community list

Location:
OpenPNE3/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/actions/actions.class.php

    r10260 r11013  
    3333  }
    3434
     35 /**
     36  * Executes profile action
     37  *
     38  * @params sfRequest $request A request object
     39  */
     40  public function executeProfile($request)
     41  {
     42    $this->friendsSize = 5;
     43    $this->communitiesSize = 5;
     44
     45    return parent::executeProfile($request);
     46  }
     47 
    3548 /**
    3649  * Executes configUID action
  • OpenPNE3/trunk/apps/mobile_frontend/modules/member/templates/profileSuccess.php

    r11012 r11013  
    5050<?php
    5151$list = array();
    52 foreach ($member->getFriends(5) as $friendMember)
     52foreach ($friends as $friendMember)
    5353{
    5454  $list[] = link_to(sprintf('%s(%d)', $friendMember->getName(), $friendMember->countFriends()), 'member/profile?id='.$friendMember->getId());
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/actions/actions.class.php

    r10917 r11013  
    115115
    116116    $result = parent::executeProfile($request);
    117 
    118     $this->communities = CommunityPeer::retrievesByMemberId($id, 9);
    119 
    120117    return $result;
    121118  }
  • OpenPNE3/trunk/apps/pc_frontend/modules/member/templates/profileSuccess.php

    r11001 r11013  
    2626$options = array(
    2727  'title' => __('Friends List'),
    28   'list' => $member->getFriends(9),
     28  'list' => $friends,
    2929  'link_to' => 'member/profile?id=',
    3030  'moreInfo' => array(link_to(sprintf('%s(%d)', __('Show all'), $member->countFriends()), 'friend/list?id='.$member->getId())),
  • OpenPNE3/trunk/lib/action/sfOpenPNEMemberAction.class.php

    r10927 r11013  
    116116    $this->forward404Unless($this->member, 'Undefined member.');
    117117
    118     $this->communities = CommunityPeer::retrievesByMemberId($id);
     118    $c = new Criteria();
     119    $c->addAscendingOrderByColumn(Propel::getDB()->random(time()));
     120
     121    if (!$this->friendsSize)
     122    {
     123      $this->friendsSize = 9;
     124    }
     125    $this->friends = $this->member->getFriends($this->friendsSize, $c);
     126
     127    if (!$this->communitiesSize)
     128    {
     129      $this->communitiesSize = 9;
     130    }
     131    $this->communities = $this->member->getJoinCommunities($this->communitiesSize, $c);
    119132    $this->crownIds = CommunityMemberPeer::getCommunityIdsOfAdminByMemberId($id);
    120133
  • OpenPNE3/trunk/lib/model/Member.php

    r11001 r11013  
    8585  }
    8686
     87  public function getJoinCommunities($limit = null, Criteria $c = null)
     88  {
     89    if (!$c)
     90    {
     91      $c = new Criteria();
     92    }
     93    return CommunityPeer::retrievesByMemberId($this->getId(), $limit, $c);
     94  }
     95
    8796  public function getFriendPreTo(Criteria $c = null)
    8897  {
Note: See TracChangeset for help on using the changeset viewer.