user_followers.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. <?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
  31. <?php include dirname(__FILE__).('/widgets/side_trending.php'); ?>
  32. <?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
  33. </aside>
  34. <article class="center_column">
  35. <div id="js-follows_profile">
  36. </div>
  37. <footer id="js-follows_footer">
  38. <i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
  39. </footer>
  40. </article>
  41. </div>
  42. </main>
  43. <script>
  44. current_file = location.pathname;
  45. $("#js-profile_nav_followers").toggleClass("view");
  46. $("#js-profile_nav_toots > a").attr('href', './'+location.search);
  47. $("#js-profile_nav_following > a").attr('href', 'following'+location.search);
  48. $("#js-profile_nav_followers > a").attr('href', 'followers'+location.search);
  49. $("#js-profile_nav_favourites > a").attr('href','favourites'+location.search);
  50. <?php if (isset($_GET['mid'])): ?>
  51. $(function() {
  52. const account_id = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'mid'), ENT_QUOTES) ?>";
  53. api.get('accounts/'+account_id, function(AccountObj) {
  54. if ( AccountObj !== null ) {
  55. setAccount(AccountObj);
  56. setFollows(account_id,'followers',[{name:'limit',data:18}]);
  57. setRecentImages(AccountObj.id);
  58. } else {
  59. location.href="/404.php";
  60. }
  61. });
  62. });
  63. <?php elseif((isset($_GET['user']))): ?>
  64. $(function(){
  65. <?php
  66. $name = preg_split("/@/", $_GET['user'])[1];
  67. $domain = preg_split("/@/", $_GET['user'])[2];
  68. $url= "https://$domain/@$name";
  69. ?>
  70. const query = '<?= htmlspecialchars((string)filter_input(INPUT_GET, 'user'), ENT_QUOTES) ?>';
  71. api.get('search', [{name:'q',data:query},{name:'resolve',data:'true'}], function(search) {
  72. if ( !search.accounts.length ) {
  73. location.href="/404.php";
  74. } else if ("@"+search.accounts[0].acct === query || "@"+search.accounts[0].acct+"@"+localStorage.current_instance === query) {
  75. setAccount(search.accounts[0]);
  76. setFollows(search.accounts[0].id,'followers',[{name:'limit',data:18}]);
  77. setRecentImages(search.accounts[0].id);
  78. } else {
  79. location.href="/404.php";
  80. }
  81. });
  82. })
  83. <?php endif; ?>
  84. </script>
  85. <?php include ('footer.php'); ?>