search_hash_tag.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php include ('header.php'); ?>
  2. <main id="main">
  3. <?php include dirname(__FILE__).('/widgets/search_header.php'); ?>
  4. <div class="article_wrap">
  5. <aside class="left_column">
  6. <?php include dirname(__FILE__).('/widgets/side_who_to_follow.php'); ?>
  7. <?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
  8. </aside>
  9. <article class="center_column">
  10. <header class="timeline_header">
  11. <ul class="header_items">
  12. <li class="item toots view">
  13. </li>
  14. </ul>
  15. </header>
  16. <div id="js-stream_update">
  17. <button>
  18. View <span></span> new Toots
  19. </button>
  20. </div>
  21. <ul id="js-timeline" class="timeline">
  22. </ul>
  23. <footer id="js-timeline_footer" class="timeline_footer">
  24. <i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
  25. </footer>
  26. </article>
  27. <aside class="right_column"></aside>
  28. </div>
  29. </main>
  30. <script>
  31. current_file = location.pathname+location.search;
  32. <?php if(isset($_GET['q'])) { ?>
  33. $(function() {
  34. const query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>";
  35. $('#main > .article_wrap > .center_column > .timeline_header > .header_items > .item').text("#"+query);
  36. $('#js-header_title_box > h1').text(query);
  37. $('title').text('#'+query+' - Halcyon Search');
  38. $('#js-search_nav_toots').toggleClass('view');
  39. $('#js-search_nav_toots a ').attr('href','/search'+location.search);
  40. $('#js-search_nav_peoples a ').attr('href','/search/users'+location.search)
  41. if(localStorage.getItem("setting_search_filter") === "all") {
  42. setTimeline("timelines/tag/"+query);
  43. }
  44. else if(localStorage.getItem("setting_search_filter") === "local") {
  45. setTimeline("timelines/tag/"+query,[{name:"local",data:"true"}]);
  46. }
  47. replace_emoji();
  48. });
  49. <?php } else { ?>
  50. window.location.href = "/";
  51. <?php } ?>
  52. </script>
  53. <?php include ('footer.php'); ?>