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

Changeset 11014


Ignore:
Timestamp:
Mar 13, 2009, 11:03:45 AM (10 years ago)
Author:
ShogoKawahara
Message:

fixed sfOpenPNECommunityAction doesn't shuffle member list

Location:
OpenPNE3/trunk
Files:
4 edited

Legend:

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

    r11012 r11014  
    1818class communityActions extends sfOpenPNECommunityAction
    1919{
     20  /**
     21   * Executes home action
     22   *
     23   * @param sfWebRequest $request a request object
     24   */
     25  public function executeHome(sfWebRequest $request)
     26  {
     27    $this->membersSize = 5;
     28
     29    return parent::executeHome($request);
     30  }
     31
    2032  /**
    2133   * Executes joinlist action
  • OpenPNE3/trunk/apps/mobile_frontend/modules/community/templates/homeSuccess.php

    r11012 r11014  
    88
    99<tr><td align="center" width="50%" valign="top">
     10<?php echo image_tag_sf_image($community->getImageFileName(), array('size' => '120x120', 'format' => 'jpg')) ?>
    1011</td>
    1112
     
    1314<font color="#999966">ID:</font><br>
    1415<?php echo $community->getId() ?><br>
     16<font color="#999966"><?php echo __('Date Created') ?>:</font><br>
     17<?php echo op_format_date($community->getCreatedAt(), 'D') ?><br>
     18<font color="#999966"><?php echo __('Administrator') ?>:</font><br>
     19<?php echo link_to($community_admin->getName(), 'member/profile?id='.$community_admin->getId()) ?><br>
    1520</td>
    1621</tr>
     
    4247<?php
    4348$list = array();
    44 $c = new Criteria();
    45 $c->addAscendingOrderByColumn(Propel::getDB()->random(time()));
    46 foreach ($community->getMembers(5, $c) as $member) {
     49foreach ($members as $member) {
    4750  $list[] = link_to($member->getName(), 'member/profile?id='.$member->getId());
    4851}
    4952$option = array(
    50   'title' => __('Community member'),
     53  'title' => __('Community Members'),
    5154  'border' => true,
    5255  'moreInfo' => array(
  • OpenPNE3/trunk/apps/pc_frontend/modules/community/templates/homeSuccess.php

    r10920 r11014  
    1010$options = array(
    1111  'title' => __('Community Members'),
    12   'list' => $community->getMembers(9),
     12  'list' => $members,
    1313  'crownIds' => array($community_admin->getId()),
    1414  'link_to' => 'member/profile?id=',
  • OpenPNE3/trunk/lib/action/sfOpenPNECommunityAction.class.php

    r11012 r11014  
    3838    $this->community_admin = CommunityMemberPeer::getCommunityAdmin($this->id);
    3939    $this->community_admin = MemberPeer::retrieveByPk($this->community_admin->getMemberId());
     40
     41    if (!$this->membersSize)
     42    {
     43      $this->membersSize = 9;
     44    }
     45    $c = new Criteria();
     46    $c->addAscendingOrderByColumn(Propel::getDB()->random(time()));
     47    $this->members = $this->community->getMembers($this->membersSize, $c);
    4048  }
    4149
Note: See TracChangeset for help on using the changeset viewer.