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

Revision 1174, 1.2 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_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    } else {
22        return "";
23    }
24    require_once "function.mtstaticwebpath.php";
25    $static_path = smarty_function_mtstaticwebpath($args, $ctx);
26    require_once "commenter_auth_lib.php";
27    $logo = _auth_icon_url($static_path, $cmntr);
28    if (!$logo) {
29        $root_url = $static_path . 'images/';
30        if (!preg_match('/\/$/', $root_url)) {
31            $root_url .= '/';
32        }
33        $logo = $root_url . "nav-commenters.gif";
34    }
35    return "<a class=\"commenter-profile\" href=\"$link\"><img alt=\"Author Profile Page\" src=\"$logo\" width=\"16\" height=\"16\" /></a>";
36}
37?>
Note: See TracBrowser for help on using the browser.