之前写过《typecho前台修改个人设置》这么一篇文章,但是里面的html结构是写死的,不够灵活。由因为我现在的模板使用的前端框架,前端框架只要改改html结构就能作出很好看的样式,于是乎我就折腾了这个。
核心代码
个人资料页面
<?php Typecho_Widget::widget('Widget_Security')->to($security); ?>
<form action="<?php $security->index('/action/users-profile'); ?>" method="post" enctype="application/x-www-form-urlencoded">
<label>用户ID</label>
<?php $this->user->uid() ?>
<label>昵称</label>
<input type="text" name="screenName" value="<?php $this->user->screenName(); ?>"/>
<label>邮箱</label>
<input type="text" name="mail" value="<?php $this->user->mail(); ?>"/>
<label>网站</label>
<input type="text" name="url" value="<?php $this->user->url(); ?>"/>
<input name="do" type="hidden" value="profile">
<button type="submit">确定</button>
</form>
密码修改页面
<?php Typecho_Widget::widget('Widget_Security')->to($security); ?>
<form action="<?php $security->index('/action/users-profile'); ?>" method="post" enctype="application/x-www-form-urlencoded">
<label><font style="vertical-align: inherit;">密码</label>
<input type="password" name="password"/>
<label>重复密码</label>
<inputtype="password" name="confirm"/>
<input name="do" type="hidden" value="password">
<button type="submit">确定</button>
</form>
html结构根据自己写的样式调整美化即可。
版权属于:泽泽社长
本文链接:https://blog.zezeshe.com/archives/typecho-diy-settings-page.html
本站未注明转载的文章均为原创,并采用
CC BY-NC-SA 4.0 授权协议,转载请注明来源,谢谢!
前台消息该怎么写呢
前台提示消息吗,比如登录成功或者失败提示?其实文章上周就写了,然后因为我开了防火墙发布出去代码文章哈哈哈,服务器密码啥的都在家里电脑里,回家懒得开电脑
好像并没什么用,哈哈,勿怪
确实没啥用,还有个小缺陷