海狸网

  • 首页
  • 源码分享
    • APP源码
    • 商业源码
  • 主题插件
    • wordpress主题
    • wordpress插件
    • Typecho主题
    • Typecho插件
    • Zblog主题
    • Zblog插件
    • Emlog主题
    • Emlog插件
    • 苹果cms主题
    • 苹果cms插件
    • Discuzq
  • 系统软件
    • Windows平台
    • Mac平台
    • Android平台
    • Nas平台
    • VPS相关
    • 软件分享
  • 建站技巧
  • 视频推荐
  • 生活圈
  • 网址导航
海狸网
佛系博主,随缘更新,有事请留言。
  1. 首页
  2. 建站技巧
  3. 正文

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

2020年04月02日 171点热度 0人点赞 2条评论

实例代码:

<?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'];
}

}
?>
打赏赞微海报分享
本作品采用 知识共享署名 4.0 国际许可协议 进行许可
标签: Typecho教程
最后更新:2020年11月02日

小海

打赏 点赞
< 上一篇
下一篇 >

文章评论

  • venlor buy

    A lot of thanks for all your efforts on this site. Gloria enjoys doing investigation and it's easy to understand why. Almost all know all concerning the dynamic means you deliver great items on the web blog and as well encourage contribution from other people on that concern plus our daughter is actually being taught a lot. Have fun with the remaining portion of the new year. You're the one conducting a glorious job.

    2021年01月09日
    回复
  • mirtazapine cost

    My wife and i were very thrilled when Raymond managed to round up his web research with the ideas he gained in your web page. It's not at all simplistic to just choose to be giving freely information that many other folks have been selling. And we all figure out we have the website owner to be grateful to for that. The explanations you have made, the simple site menu, the friendships you can give support to engender - it's got everything fabulous, and it's really facilitating our son and the family feel that the idea is enjoyable, and that is incredibly important. Thank you for all the pieces!

    2021年01月09日
    回复
  • 取消回复

    内容搜索

    小海狸

    保持饥渴的专注,追求最佳的品质

    毒鸡汤
    分类目录
    • APP源码
    • Mac平台
    • Nas平台
    • Typecho主题
    • Typecho插件
    • Windows平台
    • wordpress主题
    • wordpress插件
    • Zblog插件
    • 商业源码
    • 建站技巧
    • 生活圈
    • 苹果cms主题
    • 苹果cms插件
    • 视频推荐
    • 软件分享
    最新 热点 随机
    最新 热点 随机
    WordPress免费博客杂志主题CX-MULTI 推荐一款极简约的wordpress免费博客自媒体文艺主题下载 WordPress导航主题VIK Git:一款比付费主题更像是付费主题的WordPress免费主题 千面家园wordpress多行业主题-免费版 自适应wordpress电影电视网站中文免费主题模板
    推荐一款极简约的wordpress免费博客自媒体文艺主题下载WordPress免费博客杂志主题CX-MULTI
    Typecho通过后台多cid获取文章信息的字段写法教程 自用lsky-pro图床程序-支持第三方云储存,支持本地、阿里云OSS、腾讯云COS、七牛云、又拍云 Typecho 热门标签及标签云 RIPro主题 v7.2 免授权修复后门完美版 最新版苹果cms如何去掉首页帮助提示信息 WordPress主题导航模版
    标签聚合
    Mac 导航 wordpress主题 影视CMS 苹果模板 苹果cms Typecho教程 影视源码
    最近评论
    发布于 9 小时前(01月18日) Kaliteli işçilik ve hesaplı fiyatlarımız ile su de...
    发布于 9 小时前(01月18日) Kaliteli işçilik ve hesaplı fiyatlarımız ile su de...
    发布于 11 小时前(01月18日) <a href="http://propeciaff.com/">p...
    发布于 11 小时前(01月18日) <a href="http://retinabuy.com/">wh...
    发布于 11 小时前(01月18日) <a href="https://propeciaff.com/">...
    书签
    • 战东海
    • 海狸综合导航
    • 海狸网
    • 音乐搜索
    小姐姐

    COPYRIGHT © 2020 海狸网. ALL RIGHTS RESERVED.

    THEME KRATOS MADE BY VTROIS

    辽ICP备20001688号