root/branches/release-26/php/lib/function.mtentriescount.php @ 1174

Revision 1174, 0.8 kB (checked in by bchoate, 23 months ago)

Updated copyright year for source.

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_mtentriescount($args, &$ctx) {
9    if ($ctx->stash('inside_mt_categories')) {
10        return $ctx->tag('MTCategoryCount', $args);
11    } elseif ($count = $ctx->stash('archive_count')) {
12        return $count;
13    } else {
14        $entries = $ctx->stash('entries');
15        if (!is_array($entries)){
16            $blog = $ctx->stash('blog');
17            $args['blog_id'] = $blog['blog_id'];
18            $entries =& $ctx->mt->db->fetch_entries($args);
19        }
20   
21        $lastn = $ctx->stash('_entries_lastn');
22        if ($lastn && $lastn <= count($entries))
23            return $lastn;
24        else
25            return count($entries);
26    }
27}
28?>
Note: See TracBrowser for help on using the browser.