user_include_replies.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php include ('header.php'); ?>
  2. <main id="main">
  3. <?php include dirname(__FILE__).('/widgets/user_header.php'); ?>
  4. <div class="article_wrap">
  5. <aside class="left_column">
  6. <div class="profile_icon_box">
  7. <img id="js_profile_image" src="/assets/images/missing.png" mediaaccess="true">
  8. </div>
  9. <section class="profile_section_wrap">
  10. <h1 class="profile_displayname">
  11. <a id="js_profile_displayname" href="#"></a>
  12. </h1>
  13. <h2 class="profile_username">
  14. @<a id="js_profile_username" href="#"></a>
  15. </h2>
  16. <p id="js_profile_bio" class="profile_bio"></p>
  17. <div id="js_profile_public_link" class="profile_with_icon invisible" style="margin-bottom:5px">
  18. <a target="_blank"><i class="fa fa-fw fa-link" aria-hidden="true"></i><span><?=_('Open public profile')?></span></a>
  19. </div>
  20. <div id="js_profile_joined_date" class="profile_with_icon" style="margin-bottom:5px">
  21. <span><i class="fa fa-fw fa-calendar" aria-hidden="true"></i><span></span></span>
  22. </div>
  23. <div id="profile_toot_buttons" style="height:31px;margin-bottom:5px;display:none">
  24. <button class="toot_button profile_sendto" style="width:calc(50% - 3px)"><div class="toot_button_label"><i class="fa fa-fw fa-pencil-square-o"></i><span><?=_('Toot to')?></span></div></button>
  25. <button class="toot_button profile_sendto" style="width:calc(50% - 3px)" privacy="direct"><div class="toot_button_label"><i class="fa fa-fw fa-envelope"></i><span><?=_('Message')?></span></div></button>
  26. </div>
  27. <?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
  28. </section>
  29. </aside>
  30. <article class="center_column">
  31. <header class="timeline_header">
  32. <ul class="header_items">
  33. <li class="item toots">
  34. <a id="toots_link">
  35. <?=_('Toots')?>
  36. </a>
  37. </li>
  38. <li class="item wreplies view">
  39. <a id="with_replies_link">
  40. <?=_('Toots')?> &amp; <?=_('replies')?>
  41. </a>
  42. </li>
  43. <li class="item media">
  44. <a id="media_link">
  45. <?=_('Media')?>
  46. </a>
  47. </li>
  48. </ul>
  49. </header>
  50. <div id="js-stream_update">
  51. <button>
  52. <?=_('View ')?><span></span><?=_(' new Toots')?>
  53. </button>
  54. </div>
  55. <ul id="js-timeline" class="timeline">
  56. </ul>
  57. <footer id="js-timeline_footer" class="timeline_footer">
  58. <i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
  59. </footer>
  60. </article>
  61. <aside class="right_column">
  62. <section class="side_widgets_wrap">
  63. <?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
  64. </section>
  65. <?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
  66. </aside>
  67. </div>
  68. </main>
  69. <script>
  70. current_file = location.pathname;
  71. $("#toots_link").attr('href', './'+location.search);
  72. $("#with_replies_link").attr('href', './with_replies'+location.search);
  73. $("#media_link").attr('href', './media'+location.search);
  74. $("#js-profile_nav_toots > a").toggleClass("view");
  75. $("#js-profile_nav_toots > a").attr('href', location.pathname+location.search);
  76. $("#js-profile_nav_following > a").attr('href', './following'+location.search);
  77. $("#js-profile_nav_followers > a").attr('href', './followers'+location.search);
  78. $("#js-profile_nav_favourites > a").attr('href', './favourites'+location.search);
  79. <?php if (isset($_GET['mid'])): ?>
  80. $(function() {
  81. const account_id = <?= htmlspecialchars((string)filter_input(INPUT_GET, 'mid'), ENT_QUOTES) ?>;
  82. api.get('accounts/'+account_id, function(AccountObj) {
  83. if ( AccountObj !== null ) {
  84. setAccount(AccountObj);
  85. setTimeline("accounts/"+AccountObj.id+"/statuses",undefined,"true");
  86. setRecentImages(AccountObj.id);
  87. } else {
  88. location.href = "/404.php";
  89. }
  90. });
  91. });
  92. <?php elseif((isset($_GET['user']))): ?>
  93. $(function(){
  94. <?php
  95. $name = preg_split("/@/", $_GET['user'])[1];
  96. $domain = preg_split("/@/", $_GET['user'])[2];
  97. $url= "https://$domain/@$name";
  98. ?>
  99. const query = '<?= htmlspecialchars((string)filter_input(INPUT_GET, 'user'), ENT_QUOTES) ?>';
  100. api.get('search', [{name:'q',data:query},{name:'resolve',data:'true'}], function(search) {
  101. if ( !search.accounts.length ) {
  102. location.href = "/404.php";
  103. } else if ("@"+search.accounts[0].acct === query || "@"+search.accounts[0].acct+"@"+localStorage.current_instance === query) {
  104. setAccount(search.accounts[0]);
  105. setTimeline("accounts/"+search.accounts[0].id+"/statuses",undefined,"true");
  106. setRecentImages(search.accounts[0].id);
  107. } else {
  108. location.href = "/404.php";
  109. }
  110. });
  111. })
  112. <?php endif; ?>
  113. </script>
  114. <?php include ('footer.php'); ?>