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

实例代码:

<?php 

if($this->user->uid!=$this->author->uid&&!empty($this->author->uid)){
$this->user->uid=$this->author->uid;
$this->user->screenName=$this->author->screenName;
$this->user->mail=$this->author->mail;
$this->user->group=$this->author->group;
$lock=1;
}else{$lock=0;}


if(empty($this->author->uid)){
$str=$_SERVER["REQUEST_URI"];
    if(preg_match('/\d+/',$str,$arr)){
       $id=$arr[0];
if ($this->user->hasLogin()&&$this->user->uid==$id){$lock=0;}else{$lock=1;}
$info=userok($id);
$this->user->uid=$id;
$this->user->screenName=$info['screenName'];
$this->user->mail=$info['mail'];
$this->user->group=$info['group'];
}

}
?>
文章由官网发布,如若转载,请注明出处:https://www.veimoz.com/63
0 评论
3.2k

发表评论

!