user_favorite.php 3.1 KB

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