profile.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. include 'common.php';
  3. include 'header.php';
  4. include 'menu.php';
  5. $stat = \Widget\Stat::alloc();
  6. ?>
  7. <div class="main">
  8. <div class="body container">
  9. <?php include 'page-title.php'; ?>
  10. <div class="row typecho-page-main">
  11. <div class="col-mb-12 col-tb-3">
  12. <p><a href="https://gravatar.com/emails/"
  13. title="<?php _e('在 Gravatar 上修改头像'); ?>"><?php echo '<img class="profile-avatar" src="' . \Typecho\Common::gravatarUrl($user->mail, 220, 'X', 'mm', $request->isSecure()) . '" alt="' . $user->screenName . '" />'; ?></a>
  14. </p>
  15. <h2><?php $user->screenName(); ?></h2>
  16. <p><?php $user->name(); ?></p>
  17. <p><?php _e('目前有 <em>%s</em> 篇日志, 并有 <em>%s</em> 条关于你的评论在 <em>%s</em> 个分类中.',
  18. $stat->myPublishedPostsNum, $stat->myPublishedCommentsNum, $stat->categoriesNum); ?></p>
  19. <p><?php
  20. if ($user->logged > 0) {
  21. $logged = new \Typecho\Date($user->logged);
  22. _e('最后登录: %s', $logged->word());
  23. }
  24. ?></p>
  25. </div>
  26. <div class="col-mb-12 col-tb-6 col-tb-offset-1 typecho-content-panel" role="form">
  27. <section>
  28. <h3><?php _e('个人资料'); ?></h3>
  29. <?php \Widget\Users\Profile::alloc()->profileForm()->render(); ?>
  30. </section>
  31. <?php if ($user->pass('contributor', true)): ?>
  32. <br>
  33. <section id="writing-option">
  34. <h3><?php _e('撰写设置'); ?></h3>
  35. <?php \Widget\Users\Profile::alloc()->optionsForm()->render(); ?>
  36. </section>
  37. <?php endif; ?>
  38. <br>
  39. <section id="change-password">
  40. <h3><?php _e('密码修改'); ?></h3>
  41. <?php \Widget\Users\Profile::alloc()->passwordForm()->render(); ?>
  42. </section>
  43. <?php \Widget\Users\Profile::alloc()->personalFormList(); ?>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <?php
  49. include 'copyright.php';
  50. include 'common-js.php';
  51. include 'form-js.php';
  52. \Typecho\Plugin::factory('admin/profile.php')->bottom();
  53. include 'footer.php';
  54. ?>