user_favorite.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. </section>
  52. <?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
  53. </aside>
  54. </div>
  55. </main>
  56. <script>
  57. current_file = location.pathname;
  58. $("#js-profile_nav_favourites").toggleClass("view");
  59. $("#js-profile_nav_toots > a").attr('href', './'+location.search);
  60. $("#js-profile_nav_following > a").attr('href', 'following'+location.search);
  61. $("#js-profile_nav_followers > a").attr('href', 'followers'+location.search);
  62. $("#js-profile_nav_favourites > a").attr('href', 'favourites'+location.search);
  63. <?php if (isset($_GET['mid'])): ?>
  64. $(function() {
  65. const account_id = "<?php echo $_GET['mid']; ?>";
  66. api.get('accounts/'+account_id, function(AccountObj) {
  67. if ( AccountObj !== null ) {
  68. setAccount(AccountObj);
  69. setTimeline("favourites");
  70. setRecentImages(AccountObj.id);
  71. } else {
  72. location.href = "/404.php";
  73. }
  74. });
  75. });
  76. <?php elseif((isset($_GET['user']))): ?>
  77. $(function(){
  78. <?php
  79. $name = preg_split("/@/", $_GET['user'])[1];
  80. $domain = preg_split("/@/", $_GET['user'])[2];
  81. $url= "https://$domain/@$name";
  82. ?>
  83. const query = '<?= htmlspecialchars((string)filter_input(INPUT_GET, 'user'), ENT_QUOTES) ?>';
  84. api.get('search', [{name:'q',data:query},{name:'resolve',data:'true'}], function(search) {
  85. if ( !search.accounts.length ) {
  86. location.href="/404.php";
  87. } else if ("@"+search.accounts[0].acct === query || "@"+search.accounts[0].acct+"@"+localStorage.current_instance === query) {
  88. setAccount(search.accounts[0]);
  89. setTimeline("favourites");
  90. setRecentImages(search.accounts[0]);
  91. } else {
  92. location.href="/404.php";
  93. }
  94. });
  95. })
  96. <?php endif; ?>
  97. </script>
  98. <?php include ('footer.php'); ?>