user_include_replies.php 4.3 KB

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