Typecho博客主题模版制作常用变量和函数代码之用户篇

typecho模版代码

获取密码

<?php $this->author->password(); ?> 

获取用户名

<?php $this->author->name(); ?> 

获取用户昵称

<?php $this->author->screenName(); ?>
``````php
<?php $this->author(); ?>

获取用户ID

<?php $this->author->uid(); ?>

获取用户头像

<?php $this->author->gravatar('120', '') ?>

<img src="http://cn.gravatar.com/avatar/<?php echo MD5($this->author->mail); ?>?s=120" alt="" class="" />

其中120代表方形图像的宽和高。获取头像,第一个傻瓜版,后面‘’中可以放入一个图片地址,当mail没有注册gravatar.com时采取改设置;第二个可以对img更多自定义比如自定义alt、class等。。。

获取用户全部文章列表链接

<?php $this->author->permalink(); ?>

获取用户个人网站链接

<?php $this->author->url(); ?>

获取用户邮箱

<?php $this->author->mail(); ?>

Relay Tips: 一极乐https://yijile.com/log/354/