个人主页显示微博列表(自己及关注人的微博列表)

/*获取最新的50微博信息列表,列出自己发布的微博及我关注用户的微博
*1.根据推送的信息获取postid
*2.根据postid获取发送的信息
*/
$r->ltrim("recivepost:".$user['userid'],0,49);
$postid_arr = $r->sort("recivepost:".$user['userid'],array('sort'=>'desc'));
if($postid_arr){
    foreach($postid_arr as $postid){
        $p = $r->hmget("post:postid:".$postid,array('userid','username','time','content'));
        $weiboList .=  '<div class="post"><a class="username" href="profile.php?u='.$p['username'].'">'.$p['username'].'</a>'.$p['content'].'<br><i>'.formattime($p['time']).'前发布</i></div>'; 
    }
    echo $weiboList;
}else{
    echo '<div class="post" >这个家伙很懒,还未发布消息哦~</div>';
}

 

显示个人微博列表

/**
*1.获取个人发布微博的id的队列
*2.根据postid获取微博信息
**/
$r->ltrim("userpostid:".$prouid,0,49);
$postid_arr = $r->sort("userpostid:".$prouid,array('sort'=>'desc'));
if($postid_arr){
    foreach($postid_arr as $postid){
        $p = $r->hmget("post:postid:".$postid,array('userid','username','time','content'));
        $weiboList .=  '<div class="post"><a class="username" href="profile.php?u='.$p['username'].'">'.$p['username'].'</a>'.$p['content'].'<br><i>'.formattime($p['time']).'前发布</i></div>'; 
    }
    echo $weiboList;
}else{
    echo '<div class="post" >这个家伙很懒,还未发布消息哦~</div>';
}

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-22
  • 2021-09-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2022-12-23
相关资源
相似解决方案