discuzx2.5 公告发布者链接显示不正确

不管任何人发布的公告,公告发布者的uid总是1,调试了一遍,发现这是discuzx2.5的bug,

文件

source\function\cache\cache_announcements_forum.php

 

 

function build_cache_announcements_forum() {

$data = array();

 

$data = C::t('forum_announcement')->fetch_by_displayorder(TIMESTAMP);

if($data) {

/**

* $memberdata 就是返回的对应 uid 了,不是数组,此处是discuzx的bug

*/

$memberdata = C::t('common_member')->fetch_uid_by_username($data['author']);

// $data['authorid'] = $memberdata['uid'];

$data['authorid'] = $memberdata;

$data['authorid'] = intval($data['authorid']);

if(empty($data['type'])) {

unset($data['message']);

}

} else {

$data = array();

}

savecache('announcements_forum', $data);

}

 

修改为以上代码即可。

你可能感兴趣的:(discuz)