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

Changeset 10074


Ignore:
Timestamp:
Jan 10, 2009, 9:52:01 PM (11 years ago)
Author:
ogawa
Message:

#3415:added prev/next diary links to the diary_show page

Location:
OpenPNE3/plugins/opDiaryPlugin/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/mobile_frontend/modules/diary/templates/showSuccess.php

    r10071 r10074  
    1414
    1515(<?php echo $diary->getPublicFlagLabel() ?>)<br>
     16
     17<?php if ($diary->getPrevious() || $diary->getNext()): ?>
     18<hr>
     19<center>
     20<?php if ($diary->getPrevious()): ?> <?php echo link_to(__('Previous Diary'), 'diary_show', $diary->getPrevious()) ?><?php endif; ?>
     21<?php if ($diary->getNext()): ?> <?php echo link_to(__('Next Diary'), 'diary_show', $diary->getNext()) ?><?php endif; ?>
     22</center>
     23<?php endif; ?>
    1624
    1725<?php include_component('diaryComment', 'list', array('diary' => $diary)) ?>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/showSuccess.php

    r9934 r10074  
    88<div class="partsHeading"><h3><?php echo __('Diary of %1%', array('%1%' => $member->getName())) ?></h3>
    99<p class="public">(<?php echo $diary->getPublicFlagLabel() ?>)</p></div>
     10
     11<?php if ($diary->getPrevious() || $diary->getNext()): ?>
     12<div class="block prevNextLinkLine">
     13<?php if ($diary->getPrevious()): ?>
     14<p class="prev"><?php echo link_to(__('Previous Diary'), 'diary_show', $diary->getPrevious()) ?></p>
     15<?php endif; ?>
     16<?php if ($diary->getNext()): ?>
     17<p class="next"><?php echo link_to(__('Next Diary'), 'diary_show', $diary->getNext()) ?></p>
     18<?php endif; ?>
     19</div>
     20<?php endif; ?>
     21
    1022<dl>
    1123<dt><?php echo nl2br(op_diary_format_date($diary->getCreatedAt(), 'XDateTimeJaBr')) ?></dt>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/i18n/messages.ja.xml

    r10073 r10074  
    163163        <target>自分の日記</target>
    164164      </trans-unit>
     165      <trans-unit id="41">
     166        <source>Previous Diary</source>
     167        <target>前の日記</target>
     168      </trans-unit>
     169      <trans-unit id="42">
     170        <source>Next Diary</source>
     171        <target>次の日記</target>
     172      </trans-unit>
    165173    </body>
    166174  </file>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/model/Diary.php

    r10011 r10074  
    1111class Diary extends BaseDiary
    1212{
     13  protected $previous, $next;
     14
    1315  public function getTitleAndCount($space = true)
    1416  {
     
    3335    return $criteria;
    3436  }
     37
     38  public function getPrevious()
     39  {
     40    if (is_null($this->previous))
     41    {
     42      $criteria = new Criteria();
     43      $criteria->add(DiaryPeer::MEMBER_ID, $this->getMemberId());
     44      $criteria->add(DiaryPeer::ID, $this->getId(), Criteria::LESS_THAN);
     45      $criteria->addDescendingOrderByColumn(DiaryPeer::ID);
     46
     47      $this->previous = DiaryPeer::doSelectOne($criteria);
     48    }
     49
     50    return $this->previous;
     51  }
     52
     53  public function getNext()
     54  {
     55    if (is_null($this->next))
     56    {
     57      $criteria = new Criteria();
     58      $criteria->add(DiaryPeer::MEMBER_ID, $this->getMemberId());
     59      $criteria->add(DiaryPeer::ID, $this->getId(), Criteria::GREATER_THAN);
     60      $criteria->addAscendingOrderByColumn(DiaryPeer::ID);
     61
     62      $this->next = DiaryPeer::doSelectOne($criteria);
     63    }
     64
     65    return $this->next;
     66  }
    3567}
  • OpenPNE3/plugins/opDiaryPlugin/trunk/web/css/diary.css

    r10069 r10074  
    66.diaryDetailBox .partsHeading,
    77.diaryDetailBox dl,
     8.prevNextLinkLine,
    89.commentList dl,
    910.recentList dl,
    1011.formTable .partsHeading,
    11 .formTable div.checkList ul,
     12.formTable div.checkList ul
    1213{
    1314  zoom: 1;
     
    1617.diaryDetailBox .partsHeading:after,
    1718.diaryDetailBox dl:after,
     19.prevNextLinkLine:after,
    1820.commentList dl:after,
    1921.recentList dl:after,
    2022.formTable .partsHeading:after,
    21 .formTable div.checkList ul:after,
     23.formTable div.checkList ul:after
    2224{
    2325  content: ".";
     
    193195
    194196/*==============================================================================
     197 * 19. prevNextLinkLine
     198 *----------------------------------------------------------------------------*/
     199.prevNextLinkLine p.prev
     200{
     201  float: left;
     202  width: 50%;
     203  text-align: left;
     204}
     205.prevNextLinkLine p.next
     206{
     207  float: right;
     208  width: 50%;
     209  text-align: right;
     210}
     211.block.prevNextLinkLine
     212{
     213  padding: 4px 10px;
     214}
     215
     216/*==============================================================================
    195217 * 22. commentList
    196218 *----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.