dede文章页面如何显示作者的头像-DEDECMS

资源魔 52 0

dede文章页面若何显示作者的头像?

dede正在文章页面显示作者只是显示其用户名,然而如果我想把dede革新成较为交际化的网站,我感觉是有须要显示作者的头像的,然而民间并无相应的模版标签。

保举学习:织梦cms

正在网上看到处理这个成绩的方法根本上是间接正在模版页面挪用runphp的顺序段,确实这类方法是可行的。

然而我没有偏向于这么做,由于不少时分咱们都需求差别化的性能,每一次都这样混合着php代码看起来很乱。

我是间接正在php文件外面修正的,让文章模版能够挪用几个新的标签。

找到/include/arc.archives.class.php文件

搜寻“$this->addTableRow = $this->dsql->GetOne($query);”,跳转到大略154行,正在else{ $this->Fields['templet'] = $this->Fields['redirecturl'] = '';}上面增加以下代码:

代码以下:

/*HEJIE_MODIFY文章作者信息 @www.68cpu.com*/ 
$query = "SELECT * FROM jcode_member WHERE `mid` = ".$this->Fields['mid']; 
$authorInfo = $this->dsql->GetOne($query); 
$this->Fields['authoranme']=$authorInfo['uname']; 
$this->Fields['authorface']=$authorInfo['face']; 
if(empty($this->Fields['authorface'])) 
{ 
$this->Fields['authorface']=($this->authorInfo['sex']=='女')? '../member/templets/images/dfgirl.png' : '../member/templets/images/dfboy.png'; 
} 
$this->Fields['authorface']="<a href='".$GLOBALS['cfg_basehost']."/member/index.php?uid=".$authorInfo['userid']."'><img width='32' height='32' src='".$this->Fields['authorface']."' /></a>"; 
$this->Fields['authoremail']=$authorInfo['email'];

标签: 织梦教程 织梦技巧 dedecms教程 dede问题解决 dede

抱歉,评论功能暂时关闭!