user_followers.php 2.9 KB

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