user_favorite.php 3.3 KB

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