Ejemplo n.º 1
0
 static function getCountOfCreatedThreadsForUser($user)
 {
     $c = new Criteria();
     $c->add(ThreadPeer::POSTER_ID, $user->getId());
     return ThreadPeer::doCount($c);
 }
Ejemplo n.º 2
0
      <div class="cat">
        <div class="iconnew2"><img src="../images/forum-icon-new2.png" /></div>
        <div class="desc">
          <h1><a href="#"><?php 
        echo link_to($publicforum->getName(), 'forum/' . $publicforum->getID());
        ?>
</a></h1>
          <?php 
        echo $publicforum->getDescription();
        ?>
 </div>
        <?php 
        $t = new Criteria();
        $t->add(ThreadPeer::CATEGORY_ID, $publicforum->getID());
        $t->add(ThreadPeer::CANCEL, 0);
        $forumcount = ThreadPeer::doCount($t);
        ?>
        <div class="threads"><?php 
        echo $forumcount;
        ?>
 Topics<br />
          <?php 
        $p = new Criteria();
        $p->addJoin(ThreadPeer::ID, PostPeer::THREAD_ID, Criteria::JOIN);
        $p->add(ThreadPeer::CATEGORY_ID, $publicforum->getID());
        $p->add(ThreadPeer::CANCEL, 0);
        $postcount = PostPeer::doCount($p);
        ?>
          <?php 
        echo $postcount - $forumcount;
        ?>