typecho判断用户id来区别author.php页面的显示用户

实例代码:

  1. <?php
  2. if($this->user->uid!=$this->author->uid&&!empty($this->author->uid)){
  3. $this->user->uid=$this->author->uid;
  4. $this->user->screenName=$this->author->screenName;
  5. $this->user->mail=$this->author->mail;
  6. $this->user->group=$this->author->group;
  7. $lock=1;
  8. }else{$lock=0;}
  9. if(empty($this->author->uid)){
  10. $str=$_SERVER["REQUEST_URI"];
  11. if(preg_match('/\d+/',$str,$arr)){
  12. $id=$arr[0];
  13. if ($this->user->hasLogin()&&$this->user->uid==$id){$lock=0;}else{$lock=1;}
  14. $info=userok($id);
  15. $this->user->uid=$id;
  16. $this->user->screenName=$info['screenName'];
  17. $this->user->mail=$info['mail'];
  18. $this->user->group=$info['group'];
  19. }
  20. }
  21. ?>
文章由官网发布,如若转载,请注明出处:https://www.veimoz.com/63
0 评论
3.4k

发表评论

!