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

Changeset 10068


Ignore:
Timestamp:
Jan 10, 2009, 5:34:56 PM (11 years ago)
Author:
ogawa
Message:

#3347:added home information when unread diary comments exist

Location:
OpenPNE3/plugins/opDiaryPlugin/trunk
Files:
6 added
6 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/member/config/view.yml

    r9645 r10068  
    11homeSuccess:
    22  customize:
     3    noticeUnreadDiaryComment:
     4      template: [diary, noticeUnreadDiaryComment]
     5      is_component: true
     6      parts:    [information]
     7      target:   [bottom]
    38    friendDiaryList:
    49      template: [diary, friendDiaryList]
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/member/config/view.yml

    r9855 r10068  
     1homeSuccess:
     2  customize:
     3    noticeUnreadDiaryComment:
     4      template: [diary, noticeUnreadDiaryComment]
     5      is_component: true
     6      parts   : [information]
     7      target  : [bottom]
    18profileSuccess:
    29  customize:
  • OpenPNE3/plugins/opDiaryPlugin/trunk/config/schema.yml

    r9852 r10068  
    1616    id: ~
    1717    diary_id: { type: integer, required: true, foreignTable: diary, foreignReference: id, onDelete: cascade }
    18     member_id: { type: integer, required: true, foreignTable: member, foreignReference: id, onDelete: cascade }
     18    member_id: { type: integer, required: true, foreignTable: member, foreignReference: id }
    1919    number: { type: integer, required: true }
    2020    body: { type: longvarchar, required: true }
     
    2424    diary_comment_id: { type: integer, required: true, foreignTable: diary_comment, foreignReference: id, onDelete: cascade }
    2525    file_id: { type: integer, required: true, foreignTable: file, foreignReference: id, onDelete: cascade }
     26  diary_comment_unread:
     27    id: ~
     28    diary_id: { type: integer, required: true, foreignTable: diary, foreignReference: id, onDelete: cascade, index: unique }
     29    member_id: { type: integer, required: true, foreignTable: member, foreignReference: id, onDelete: cascade }
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/action/opDiaryPluginDiaryActions.class.php

    r10066 r10068  
    4141  {
    4242    $this->forward404Unless($this->isViewable());
     43
     44    if ($this->isAuthor())
     45    {
     46      DiaryCommentUnreadPeer::unregister($this->diary);
     47    }
    4348
    4449    $this->form = new DiaryCommentForm();
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/action/opDiaryPluginDiaryComponents.class.php

    r10011 r10068  
    3333    $this->diaryList = DiaryPeer::getMemberDiaryList($this->memberId, 5, $this->getUser()->getMemberId());
    3434  }
     35
     36  public function executeNoticeUnreadDiaryComment(sfWebRequest $request)
     37  {
     38    $memberId = $this->getUser()->getMemberId();
     39    if ($this->count = DiaryCommentUnreadPeer::countUnreadDiary($memberId))
     40    {
     41      $this->diary = DiaryCommentUnreadPeer::getOneDiaryByMemberId($memberId);
     42    }
     43  }
    3544}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/model/DiaryComment.php

    r10011 r10068  
    1919
    2020    parent::save($con);
     21
     22    if ($this->getMemberId() !== $this->getDiary()->getMemberId())
     23    {
     24      DiaryCommentUnreadPeer::register($this->getDiary());
     25    }
    2126  }
    2227}
Note: See TracChangeset for help on using the changeset viewer.