Changeset 14863 for events

Show
Ignore:
Timestamp:
06/29/08 22:53:37 (5 years ago)
Author:
kumatch
Message:

- Added the countArchives() method.
- Adjusted the friend mini icon.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • events/phpframework/piece_framework/trunk/libs/Phwittr/User.php

    r14840 r14863  
    141141 
    142142    // }}} 
     143    // {{{ countArchives 
     144 
     145    /** 
     146     * これまでの発言数を数える 
     147     *  
     148     * @return integer 
     149     */ 
     150    public function countArchives() 
     151    { 
     152        $criteria->userId = $this->id; 
     153        $mapper = Piece_ORM::getMapper('Statuses'); 
     154        return count($mapper->findAllByUserId($criteria)); 
     155    } 
     156 
     157    // }}} 
    143158    // {{{ listFriendsImage 
    144159 
     
    154169        $mapper->addOrder('users.id'); 
    155170 
    156         return $mapper->findAllByIdForListFriends($this); 
     171        $friendsList = $mapper->findAllByIdForListFriends($this); 
     172        foreach ($friendsList as &$friend) { 
     173            $pathinfo = pathinfo($friend->image); 
     174            $friend->image = basename($pathinfo['basename'], 
     175                                      ".{$pathinfo['extension']}") . 
     176                '_mini.' . $pathinfo['extension']; 
     177        } 
     178 
     179        return $friendsList; 
    157180    } 
    158181