zblog评论默认是没有头像图片,可以通过判断用户填写的QQ邮箱来获取用户QQ头像,如果用户没有头像则默认显示QQ小企鹅。
模板目录“comment.php”评论输出模板,找到如下代码。
<img src="{$comment.Author.Avatar}" alt="{$comment.Author.StaticName}"/>
替换
<img src="{if $comment.Author.Email}https://q2.qlogo.cn/headimg_dl?dst_uin={$comment.Author.Email}&spec=100{else}{$comment.Author.Avatar}{/if}" alt="{$comment.Author.StaticName}" width="45"/>
这样就可以实现在无图时自动获取用户QQ头像。
广告插入