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

Changeset 9934


Ignore:
Timestamp:
Jan 6, 2009, 12:13:41 AM (11 years ago)
Author:
ogawa
Message:

#3209:added a diary comment pager

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

Legend:

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

    r9877 r9934  
    1515(<?php echo $diary->getPublicFlagLabel() ?>)<br>
    1616
    17 <?php $comments = $diary->getDiaryComments() ?>
    18 <?php if (count($comments)): ?>
     17<?php /*
     18<?php if ($pager->getNbResults()): ?>
    1919<hr>
    2020<center>
    2121<?php echo __('Comments') ?><br>
     22<?php echo pager_total($pager); ?><br>
    2223</center>
     24
     25<?php $comments = $pager->getResults(); ?>
    2326<?php foreach ($comments as $comment): ?>
    2427<hr>
     
    3336<?php endforeach; ?>
    3437<?php endforeach; ?>
     38
     39<?php echo pager_navigation($pager, '@diary_show?page=%d&id='.$diary->getId(), false) ?>
    3540<?php endif; ?>
     41*/ ?>
     42
     43<?php include_component('diaryComment', 'list', array('diary' => $diary)) ?>
    3644
    3745<hr>
  • OpenPNE3/plugins/opDiaryPlugin/trunk/apps/pc_frontend/modules/diary/templates/showSuccess.php

    r9877 r9934  
    3939<?php /* }}} */ ?>
    4040
    41 <?php $comments = $diary->getDiaryComments() ?>
    42 <?php if (count($comments)): ?>
    43 <?php /* {{{ commentList */ ?>
    44 <div class="dparts commentList"><div class="parts">
    45 <div class="partsHeading"><h3><?php echo __('Comments') ?></h3></div>
    46 <?php foreach ($comments as $comment): ?>
    47 <dl>
    48 <dt><?php echo nl2br(op_diary_format_date($comment->getCreatedAt(), 'XDateTimeJaBr')) ?></dt>
    49 <dd>
    50 <div class="title">
    51 <p class="heading"><strong><?php echo $comment->getNumber() ?></strong>:
    52 <?php if ($_member = $comment->getMember()): ?> <?php echo link_to($_member->getName(), 'member/profile?id='.$_member->getId()) ?><?php endif; ?>
    53 <?php if ($diary->getMemberId() === $sf_user->getMemberId() || $comment->getMemberId() === $sf_user->getMemberId()): ?>
    54  <?php echo link_to(__('Delete'), 'diary_comment_delete_confirm', $comment) ?>
    55 <?php endif; ?>
    56 </p>
    57 </div>
    58 <div class="body">
    59 <?php $images = $comment->getDiaryCommentImages() ?>
    60 <?php if (count($images)): ?>
    61 <ul class="photo">
    62 <?php foreach ($images as $image): ?>
    63 <li><a href="<?php echo sf_image_path($image->getFile()) ?>" target="_blank"><?php echo image_tag_sf_image($image->getFile(), array('size' => '120x120')) ?></a></li>
    64 <?php endforeach; ?>
    65 </ul>
    66 <?php endif; ?>
    67 <p class="text">
    68 <?php echo auto_link_text(nl2br($comment->getBody()), 'urls', array('target' => '_blank'), true, 57) ?>
    69 </p>
    70 </div>
    71 </dd>
    72 </dl>
    73 <?php endforeach; ?>
    74 </div></div>
    75 <?php /* }}} */ ?>
    76 <?php endif; ?>
     41<?php include_component('diaryComment', 'list', array('diary' => $diary)) ?>
    7742
    7843<?php
  • OpenPNE3/plugins/opDiaryPlugin/trunk/lib/model/Diary.php

    r9878 r9934  
    1717    return $publicFlags[$this->getPublicFlag()];
    1818  }
     19
     20  public function getDiaryCommentsCriteria()
     21  {
     22    $criteria = new Criteria();
     23    $criteria->add(DiaryCommentPeer::DIARY_ID, $this->getId());
     24
     25    return $criteria;
     26  }
    1927}
Note: See TracChangeset for help on using the changeset viewer.