search_hash_tag.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. var query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>";
  35. if(query[0] == "@") {
  36. window.location.href = "/search/users/?q="+query.substr(1);
  37. }
  38. else {
  39. if(query[0] == "#") {
  40. query = query.substr(1);
  41. }
  42. $('#main > .article_wrap > .center_column > .timeline_header > .header_items > .item').text("#"+query);
  43. $('#js-header_title_box > h1').text(query);
  44. $('title').text('#'+query+' - Halcyon Search');
  45. $('#js-search_nav_toots').toggleClass('view');
  46. $('#js-search_nav_toots a ').attr('href','/search'+location.search);
  47. $('#js-search_nav_peoples a ').attr('href','/search/users'+location.search)
  48. if(localStorage.getItem("setting_search_filter") === "all") {
  49. setTimeline("timelines/tag/"+query);
  50. }
  51. else if(localStorage.getItem("setting_search_filter") === "local") {
  52. setTimeline("timelines/tag/"+query,[{name:"local",data:"true"}]);
  53. }
  54. replace_emoji();
  55. }
  56. });
  57. <?php } else { ?>
  58. window.location.href = "/";
  59. <?php } ?>
  60. </script>
  61. <?php include ('footer.php'); ?>