user_following.php 2.5 KB

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