标签:csdn 问题 cpu == width php 处理 his rda
dede在文章页面显示作者仅仅是显示其username,可是假如我想把dede改造成较为社交化的站点。我认为是有必要显示作者的头像的,可是官方并没有相应的模版标签。
在网上看到解决问题的办法基本上是直接在模版页面调用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‘];
标签:csdn 问题 cpu == width php 处理 his rda
原文地址:https://www.cnblogs.com/ldxsuanfa/p/10667207.html