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

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

Updated copyright year for source.

  • Property svn:keywords set to Author Date Id Revision
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_mtcommentauthor($args, &$ctx) {
9    $c = $ctx->stash('comment');
10    if (!$c) {
11        return $ctx->error("No comment available");
12    }
13    $a = isset($c['comment_author']) ? $c['comment_author'] : '';
14    if (isset($args['default'])) {
15        $a or $a = $args['default'];
16    }
17    $a or $a = '';
18    return strip_tags($a);
19}
20?>
Note: See TracBrowser for help on using the browser.