root/branches/release-38/php/lib/function.mtcommentauthor.php @ 2395

Revision 2395, 0.7 kB (checked in by bchoate, 19 months ago)

Applied fixes for commentauthoridentity and commentauthor tags. BugId:79329,79811

  • 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    $a = isset($c['comment_author']) ? $c['comment_author'] : '';
13    if ($c['comment_commenter_id']) {
14        $commenter = $ctx->stash('commenter');
15        if (is_array($commenter))
16            $commenter = $commenter[0];
17        if ($commenter)
18            $a = $commenter['author_nickname'];
19    }
20    if (isset($args['default']))
21        $a or $a = $args['default'];
22    $a or $a = '';
23    return strip_tags($a);
24}
Note: See TracBrowser for help on using the browser.