Typecho通过判断用户登陆状态,文章页面添加编辑文章按钮
在Typecho中有些内容是希望登陆之后才可见,例如文章的编辑链接,可以用下面的方法实现。文章编辑代码如下:<?php if($this->user->hasLogin()):?>
<a href="<?php $this->options->adminUrl(); ?>write-post.php?cid=<?php echo $this->cid;?>">编辑</a>
<?php endif;?>
独立页面编辑代码如下:<?php if($this->user->hasLogin()):?>
<a href="<?php $this->options->adminUrl(); ?>write-page.php?cid=<?php echo $this->cid;?>" >编辑</a>
<?php endif;?>
出售各类老款游戏手机,可找游戏
微信: lost155805 QQ: 189515079