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

Revision 2503, 1.3 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_mtcommentauthoridentity($args, &$ctx) {
9    $cmt = $ctx->stash('comment');
10    $cmntr = $ctx->stash('commenter');
11    if (!$cmntr) {
12        if ($cmt['comment_commenter_id']) {
13            # load author related to this commenter.
14            $cmntr = $ctx->mt->db->fetch_author($cmt['comment_commenter_id']);
15            if (!$cmntr) return "";
16        }
17    }
18    if (!$cmntr) return "";
19    if (isset($cmntr['author_url']))
20        $link = $cmntr['author_url'];
21    require_once "function.mtstaticwebpath.php";
22    $static_path = smarty_function_mtstaticwebpath($args, $ctx);
23    require_once "commenter_auth_lib.php";
24    $logo = _auth_icon_url($static_path, $cmntr);
25    if (!$logo) {
26        $root_url = $static_path . 'images/';
27        if (!preg_match('/\/$/', $root_url)) {
28            $root_url .= '/';
29        }
30        $logo = $root_url . "nav-commenters.gif";
31    }
32    $result = "<img alt=\"Author Profile Page\" src=\"$logo\" width=\"16\" height=\"16\" />";
33    if ($link) {
34        $result = "<a class=\"commenter-profile\" href=\"$link\">$result</a>";
35    }
36    return $result;
37}
Note: See TracBrowser for help on using the browser.