在“公共模板”的“评论JS调用模板”里如何调取并显示会员头像呢?网站后台里难以直接解决,尽管论坛和网上有各种方法,多不可行。我的解决办法如下:
放弃后台的模板直接调用,在文件夹使用php页直接调用会员头像。具体做法是:复制eplmoreindex.php,更名为index1.php,在此新文件里加入php语句调用头像,比如:
$addr=$empire->fetch1("select userpic from phome_enewsmemberadd where userid='$r[userid]'");
if(!$addr[userpic])
{
$addr[userpic]="/e/data/images/nouserpic.gif";
}
document.write里写<img src="<?=$addr[userpic]?> " width="20" height="20">
内容页模板里js调用写法是(调用3条评论):<script src="[!--news.url--]e/pl/more/index1.php?classid=[!--classid--]&id=[!--id--]&num=3"></script>