user_only_media.php 3.3 KB

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