Show
Ignore:
Timestamp:
05/16/08 07:45:14 (22 months ago)
Author:
takayama
Message:

Fixed BugId:79763
* When author object was not found in the context, try to load author object from entry in the context

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-38/php/lib/function.mtauthoruserpic.php

    r1174 r2356  
    88function smarty_function_mtauthoruserpic($args, &$ctx) { 
    99    $author = $ctx->stash('author'); 
    10     if (!$author) return ''; 
     10    if (empty($author)) { 
     11        $entry = $ctx->stash('entry'); 
     12        if (!empty($entry)) { 
     13            $author = $ctx->mt->db->fetch_author($entry['entry_author_id']); 
     14        } 
     15    } 
     16    if (empty($author)) { 
     17        return $ctx->error("No author available"); 
     18    } 
    1119 
    1220    $asset_id = isset($author['author_userpic_asset_id']) ? $author['author_userpic_asset_id'] : 0;