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.4k
发表评论
热门文章
自媒体博客Spimes主题44w 阅读
Spimes主题专为博客、自媒体、资讯类的网站设计....
Splity博客双栏主题14w 阅读
仿制主题,Typecho博客主题,昼夜双版设计,可....
vCard主题个人简历主题13w 阅读
一款个人简历主题,可以简单搭建一下,具体也比较简单....
Spzac个人资讯下载类主题12w 阅读
用于作品展示、资源下载,行业垂直性网站、个人博客,....
热评文章
自媒体博客Spimes主题424 评论
Splity博客双栏主题191 评论
Spzac个人资讯下载类主题89 评论
Splinx博客图片主题35 评论
Spzhi知识付费社区主题34 评论
三栏清新博客S_blog主题31 评论
vCard主题个人简历主题29 评论
Pure轻简主题29 评论
chenyu
昨天 12:39
能不能支持deepseek