Development

Changeset 4015

You must first sign up to be able to contribute.

Changeset 4015

Show
Ignore:
Timestamp:
05/16/07 12:37:00 (1 year ago)
Author:
superhaggis
Message:

sfBBPlugin:
Added method to retrieve a thread's replies.
Created initial HTML template for viewThread.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/sfBBPlugin/lib/model/sfBBPost.php

    r3677 r4015  
    3838    return $post[0]; 
    3939  } 
     40 
     41  public function getReplies() 
     42  { 
     43    $c = new Criteria(); 
     44    $c->add(sfBBPostPeer::PARENT_ID, $this->getId()); 
     45    $c->addJoin(sfGuardUserPeer::ID, sfBBPostPeer::USER_ID, Criteria::LEFT_JOIN); 
     46    $c->addAscendingOrderByColumn(sfBBPostPeer::CREATED_AT); 
     47    return sfBBPostPeer::doSelectJoinsfGuardUser($c); 
     48  } 
    4049} 
  • plugins/sfBBPlugin/modules/sfBB/templates/viewThreadSuccess.php

    r3667 r4015  
     1<?php use_helper('sfBB') ?> 
     2<div id="threads"> 
     3  <table cellpadding="4" cellspacing="2"> 
     4    <tr> 
     5      <th style="width: 150px">Author</th> 
     6      <th style="width: 848px">Message</th> 
     7    </tr> 
     8    <tr> 
     9      <td> 
     10        <?php echo $thread->getsfGuardUser() ?> 
     11      </td> 
     12      <td> 
     13        Posted: <?php echo $thread->getCreatedAt() ?>, Post subject: <?php echo $thread->getTitle() ?> 
     14        <hr /> 
     15        <?php echo $thread->getContent() ?> 
     16      </td> 
     17    </tr> 
     18    <?php foreach ($thread->getReplies() as $reply): ?> 
     19    <tr> 
     20      <td> 
     21        <?php echo $reply->getsfGuardUser() ?> 
     22      </td> 
     23      <td> 
     24        Posted: <?php echo $reply->getCreatedAt() ?>, Post subject: <?php echo $reply->getTitle() ?> 
     25        <hr /> 
     26        <?php echo $reply->getContent() ?> 
     27      </td> 
     28    </tr> 
     29    <?php endforeach ?> 
     30  </table> 
     31</div>