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.3k
发表评论
热门文章
自媒体博客Spimes主题41w 阅读
Spimes主题专为博客、自媒体、资讯类的网站设计....
Splity博客双栏主题14w 阅读
仿制主题,Typecho博客主题,昼夜双版设计,可....
vCard主题个人简历主题13w 阅读
一款个人简历主题,可以简单搭建一下,具体也比较简单....
Spzac个人资讯下载类主题12w 阅读
用于作品展示、资源下载,行业垂直性网站、个人博客,....
热评文章
自媒体博客Spimes主题421 评论
Splity博客双栏主题191 评论
Spzac个人资讯下载类主题89 评论
Splinx博客图片主题35 评论
Spzhi知识付费社区主题34 评论
三栏清新博客S_blog主题31 评论
vCard主题个人简历主题29 评论
Pure轻简主题28 评论
最新评论
bluejay21st
1月30日
我是作者,很意外我的插件会被转载,非常感谢。因为平时比较忙,改了博客的域名但是并没有及时做重定向以及更新插件,十分抱歉。
大家如果需要可以去Github下载我的插件:
https://github.com/bluejay21st/Typecho-BaiduSeo
https://github.com/bluejay21st/Typecho-Sitemap
chenyu
3天前
[已回复]
怎么配置主题 没看到教程