root/branches/release-39/php/lib/function.mtcommentauthor.php @ 2503

Revision 2503, 0.7 kB (checked in by takayama, 18 months ago)

Fixed BugId:80007
* Related fix of case 79997

  • 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 ($commenter)
16            $a = $commenter['author_nickname'];
17    }
18    if (isset($args['default']))
19        $a or $a = $args['default'];
20    else {
21        global $mt;
22        $a or $a = $mt->translate("Anonymous");
23    }
24    $a or $a = '';
25    return strip_tags($a);
26}
Note: See TracBrowser for help on using the browser.