root/branches/release-35/php/lib/function.mtcategorycommentcount.php @ 1956

Revision 1956, 0.5 kB (checked in by bchoate, 20 months ago)

Added support for phrases on count tags. BugId:79359

Line 
1<?php
2# Movable Type (r) Open Source (C) 2001-2008 Six Apart, Ltd.
3# This program is distributed under the terms of the
4# GNU General Public License, version 2.
5#
6# $Id$
7
8function smarty_function_mtcategorycommentcount($args, &$ctx) {
9    global $mt;
10    $db =& $mt->db;
11    $category = $ctx->stash('category');
12    $cat_id = (int)$category['category_id'];
13    $count = 0;
14    if ($cat_id) {
15        $count = $db->category_comment_count(array( 'category_id' => $cat_id ));
16    }
17    return $ctx->count_format($count, $args);
18}
Note: See TracBrowser for help on using the browser.