public function entry_count()
 {
     $child_class = $this->class === 'category' ? 'entry' : 'page';
     $blog_id = $this->blog_id;
     $cat_id = $this->id;
     $where = "entry_status = 2\n                  and entry_class = '{$child_class}'\n                  and entry_blog_id = {$blog_id}";
     $join = array();
     $join['mt_placement'] = array('condition' => "placement_entry_id = entry_id and placement_category_id = {$cat_id}");
     require_once 'class.mt_entry.php';
     $entry = new Entry();
     $cnt = $entry->count(array('where' => $where, 'join' => $join));
     return $cnt;
 }
Exemple #2
0
 public function author_entry_count($args)
 {
     if ($sql = $this->include_exclude_blogs($args)) {
         $blog_filter = 'and entry_blog_id ' . $sql;
     } elseif (isset($args['blog_id'])) {
         $blog_id = intval($args['blog_id']);
         $blog_filter = 'and entry_blog_id = ' . $blog_id;
     }
     if (isset($args['author_id'])) {
         $author_id = intval($args['author_id']);
         $author_filter = " and entry_author_id = {$author_id}";
     }
     $class = 'entry';
     if (isset($args['class'])) {
         $class = $args['class'];
     }
     $where = "entry_status = 2\n                  and entry_class='{$class}'\n                  {$blog_filter}\n                  {$author_filter}";
     require_once 'class.mt_entry.php';
     $entry = new Entry();
     $count = $entry->count(array('where' => $where));
     return $count;
 }