root/branches/release-36/php/lib/function.mtcommentauthor.php @ 2055

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

Display auth'd commenter name for comment author tag when comment was posted by auth'd user. BugId:79475

  • 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    $a or $a = '';
21    return strip_tags($a);
22}
Note: See TracBrowser for help on using the browser.