Commit 641ab57f authored by 杨培's avatar 杨培

修改了门户评论头像的地址

parent 9a8105ce
......@@ -3,6 +3,7 @@ require(__DIR__ . "/../../class/connect.php");
require(__DIR__ . "/../../class/db_sql.php");
require(__DIR__ . "/../../member/class/user.php");
require(__DIR__ . "/../../class/q_functions.php");
require __DIR__.'/../../config/config_ibanshou.php';
$link=db_connect();
$empire=new mysqlquery();
......@@ -115,6 +116,7 @@ function replyComment($plid, $content) {
//评论列表
function comments($newsid, $plid=0, $num=10) {
global $empire,$dbtbpre;
$tablecomment = $dbtbpre.'ecms_comments';
$tablemember = $dbtbpre.'enewsmember';
......@@ -123,7 +125,7 @@ function comments($newsid, $plid=0, $num=10) {
$where = "c.id<{$plid} and ";
}
$sql = "select c.*,u.avatar,u.nickname,u.username from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where {$where} c.newsid={$newsid} and c.reply_id=0 order by c.id desc limit {$num}";
$sql = "select c.*,u.nickname,u.username,u.ucid from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where {$where} c.newsid={$newsid} and c.reply_id=0 order by c.id desc limit {$num}";
$query = $empire->query($sql);
$list = [];
......@@ -168,7 +170,7 @@ function replyComments($plid) {
$tablecomment = $dbtbpre.'ecms_comments';
$tablemember = $dbtbpre.'enewsmember';
$sql = "select c.content,c.created_at,u.nickname,u.username from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where reply_id={$plid}";
$sql = "select c.content,c.created_at,u.nickname,u.username,u.ucid from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where reply_id={$plid}";
$query = $empire->query($sql);
$list = [];
......@@ -185,7 +187,7 @@ function comment($id) {
$tablecomment = $dbtbpre.'ecms_comments';
$tablemember = $dbtbpre.'enewsmember';
$sql = "select c.*,u.avatar,u.nickname,u.username from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where c.id={$id} limit 1";
$sql = "select c.*,u.nickname,u.username,u.ucid from $tablecomment c left join {$tablemember} u on c.user_id=u.userid where c.id={$id} limit 1";
$comment = $empire->fetchassoc1($sql);
return handelcomment($comment);
......@@ -226,6 +228,8 @@ function likeComment($plid) {
}
function handelcomment($comment) {
global $config;
$comment['avatar'] = $config['wxhpro']['ucenter'].'/avatar/'.$comment['ucid'].'/m';
$comment['created_at'] = date('Y-m-d H:i', $comment['created_at']);
return $comment;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment