user_favorite.php 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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" class="emoji_poss" 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 emoji_poss"></p>
  17. <?php include dirname(__FILE__).('/widgets/user_recent_images.php'); ?>
  18. </section>
  19. </aside>
  20. <article class="center_column">
  21. <header class="timeline_header">
  22. <ul class="header_items">
  23. <li class="item toots view">
  24. <a id="toots_link">
  25. Favourites
  26. </a>
  27. </li>
  28. </ul>
  29. </header>
  30. <div id="js-stream_update">
  31. <button>
  32. View <span></span> new Toots
  33. </button>
  34. </div>
  35. <ul id="js-timeline" class="timeline">
  36. </ul>
  37. <footer id="js-timeline_footer" class="timeline_footer">
  38. <i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
  39. </footer>
  40. </article>
  41. <aside class="right_column">
  42. <section class="side_widgets_wrap">
  43. <?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
  44. </section>
  45. <?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
  46. </aside>
  47. </div>
  48. </main>
  49. <script>
  50. current_file = location.pathname;
  51. $("#js-profile_nav_favourites").toggleClass("view");
  52. $("#js-profile_nav_toots > a").attr('href', './'+location.search);
  53. $("#js-profile_nav_following > a").attr('href', 'following'+location.search);
  54. $("#js-profile_nav_followers > a").attr('href', 'followers'+location.search);
  55. $("#js-profile_nav_favourites > a").attr('href', 'favourites'+location.search);
  56. <?php if (isset($_GET['mid'])): ?>
  57. $(function() {
  58. const account_id = <?php echo $_GET['mid']; ?>;
  59. api.get('accounts/'+account_id, function(AccountObj) {
  60. if ( AccountObj !== null ) {
  61. setAccount(AccountObj);
  62. setTimeline("favourites");
  63. setRecentImages(AccountObj.id);
  64. } else {
  65. location.href = "/404.php";
  66. }
  67. });
  68. });
  69. <?php elseif((isset($_GET['user']))): ?>
  70. $(function(){
  71. <?php
  72. $name = preg_split("/@/", $_GET['user'])[1];
  73. $domain = preg_split("/@/", $_GET['user'])[2];
  74. $url= "https://$domain/@$name";
  75. ?>
  76. const query = '<?= htmlspecialchars((string)filter_input(INPUT_GET, 'user'), ENT_QUOTES) ?>';
  77. api.get('search', [{name:'q',data:query},{name:'resolve',data:'true'}], function(search) {
  78. if ( !search.accounts.length ) {
  79. location.href="/404.php";
  80. } else if ("@"+search.accounts[0].acct === query || "@"+search.accounts[0].acct+"@"+localStorage.current_instance === query) {
  81. setAccount(search.accounts[0]);
  82. setTimeline("favourites");
  83. setRecentImages(search.accounts[0]);
  84. } else {
  85. location.href="/404.php";
  86. }
  87. });
  88. })
  89. <?php endif; ?>
  90. </script>
  91. <?php include ('footer.php'); ?>