在我正在处理的页面上,用户可以在博客帖子上提交评论并显示其头像。虽然我可以检索有关评论作者的信息,当我查询其化身时,即使所有信息都在那里,查询总是返回空白。
示例链接为:http://www.natives.de/blogeintrag/items/59.html
,模板代码如下:
<?php
$this->import('Database');
$authoravatar = $this->Database->prepare("SELECT xt_avatar FROM tl_user WHERE email=?")
->execute($this->email);
//var_dump($authoravatar);
?>
<div class="comment_default<?php echo $this->class; ?>" id="<?php echo $this->id; ?>">
<h3 class="info"><strong><?php if ($this->website): ?><a href="<?php echo $this->website; ?>" rel="nofollow" target="_blank"><?php endif; ?><?php echo $this->name; ?><?php if ($this->website): ?></a><?php endif; ?></strong> <time datetime="<?php echo $this->datetime; ?>" class="date"><?php echo $this->date; ?></time></h3>
<div class="authoravatar">
{{image::<?php echo $authoravatar->xt_avatar =='' ? 'tl_files/theme/image/notauser.png' : $authoravatar->xt_avatar; ?>?width=102&height=87&alt=<?php echo $this->name; ?>}}
</div>
<div class="comment">
<?php echo $this->comment; ?>
</div>
<?php if ($this->addReply): ?>
<div class="reply">
<p class="info"><?php echo $this->rby; ?> <?php echo $this->authorName; ?></p>
<div class="comment">
<?php echo $this->reply; ?>
</div>
</div>
<?php endif; ?>
</div>
我尝试了一切,但无法找到如何归还头像。有没有? 任何帮助都非常感谢!