user_followers.php 3.4 KB

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