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

Changeset 10251


Ignore:
Timestamp:
Jan 20, 2009, 5:01:57 PM (11 years ago)
Author:
nagasawa
Message:

#3285:changed The number restrictions of the blog, and length restrictions of a title

Location:
OpenPNE3/plugins/opBlogPlugin/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opBlogPlugin/trunk/apps/pc_frontend/modules/blog/actions/actions.class.php

    r10241 r10251  
    2626  public function executeFriend($request)
    2727  {
    28     $this->blogList = BlogPeer::getBlogListByFriend($this->getUser()->getMemberId(), 20);
     28    $this->blogList = BlogPeer::getBlogListOfFriend($this->getUser()->getMemberId());
    2929    if (!count($this->blogList))
    3030    {
     
    4141  {
    4242    $this->member = $this->getUser()->getMember();
    43     $this->blogList = array();
    44     BlogPeer::getBlogListByMemberId($this->getUser()->getMemberId(), $this->blogList, 20);
     43    $this->blogList = BlogPeer::getBlogListOfMember($this->getUser()->getMemberId());
    4544    if (!count($this->blogList))
    4645    {
     
    6160      return sfView::ERROR;
    6261    }
    63     $this->blogList = array();
    64     BlogPeer::getBlogListByMemberId($this->id, $this->blogList, 20);
     62    $this->blogList = BlogPeer::getBlogListOfMember($this->id);
    6563    if (!count($this->blogList))
    6664    {
  • OpenPNE3/plugins/opBlogPlugin/trunk/apps/pc_frontend/modules/blog/actions/components.class.php

    r10241 r10251  
    1111  public function executeBlogHomeFriend()
    1212  {
    13     $this->blogList = BlogPeer::getBlogListByFriend($this->getUser()->getMemberId());
     13    $this->blogList = BlogPeer::getBlogListOfFriend($this->getUser()->getMemberId(), 10, true);
    1414  }
    1515
     
    1717  {
    1818    $this->member = $this->getUser()->getMember();
    19     $this->blogList = array();
    20     BlogPeer::getBlogListByMemberId($this->getUser()->getMemberId(), $this->blogList);
     19    $this->blogList = BlogPeer::getBlogListOfMember($this->getUser()->getMemberId(), 10, true);
    2120  }
    2221
    2322  public function executeBlogProfile($request)
    2423  {
    25     $this->blogList = array();
    26     BlogPeer::getBlogListByMemberId($this->id, $this->blogList);
     24    $this->member = MemberPeer::retrieveByPk($this->id);
     25    $this->blogList = BlogPeer::getBlogListOfMember($this->id, 10, true);
    2726  }
    2827}
  • OpenPNE3/plugins/opBlogPlugin/trunk/config/widget.yml

    r10229 r10251  
    11blogHomeFriend:
    22  component: [blog, blogHomeFriend]
    3   config:
    4     size:
    5       Name:        "size"
    6       ValueType:   "int"
    7       Default:     10
    83blogHomeUser:
    94  component: [blog, blogHomeUser]
    10   config:
    11     size:
    12       Name:        "size"
    13       ValueType:   "int"
    14       Default:     10
  • OpenPNE3/plugins/opBlogPlugin/trunk/lib/model/BlogPeer.php

    r10248 r10251  
    125125  }
    126126
    127   public static function sortBlogList(&$list, $size = 10)
     127  public static function sortBlogList(&$list, $size = 20)
    128128  {
    129129    foreach ($list as $aKey => $a)
     
    146146  }
    147147
    148   public static function getBlogListByFriend($member_id)
     148  public static function limitBlogTitle(&$list)
     149  {
     150    foreach($list as &$res)
     151    {
     152      $res['title'] = mb_strcut($res['title'], 0, 30);
     153    }
     154  }
     155
     156  public static function getBlogListOfFriend($member_id, $size=20, $limitTitle = false)
    149157  {
    150158    $c = new Criteria();
     
    158166      self::getBlogListByMemberId($id, $list);
    159167    }
    160     return self::sortBlogList($list);
     168    $list = self::sortBlogList($list, $size);
     169    if ($limitTitle)
     170    {
     171      self::limitBlogTitle($list);
     172    }
     173   
     174    return $list;
     175  }
     176  public static function getBlogListOfMember($member_id, $size=20, $limitTitle = false)
     177  {
     178    $list = array();
     179    self::getBlogListByMemberId($member_id, $list);
     180    $list = self::sortBlogList($list, $size);
     181    if ($limitTitle)
     182    {
     183      self::limitBlogTitle($list);
     184    }
     185   
     186    return $list;
    161187  }
    162188}
Note: See TracChangeset for help on using the changeset viewer.