search_hash_tag.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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_trending.php'); ?>
  8. <?php include dirname(__FILE__).('/widgets/side_firefox_addon.php'); ?>
  9. <?php include dirname(__FILE__).('/widgets/side_footer.php'); ?>
  10. </aside>
  11. <article class="center_column">
  12. <header class="timeline_header">
  13. <ul class="header_items">
  14. <li class="item toots view">
  15. </li>
  16. </ul>
  17. </header>
  18. <div id="js-stream_update">
  19. <button>
  20. <?=_('View ')?> <span></span><?=_(' new Toots')?>
  21. </button>
  22. </div>
  23. <ul id="js-timeline" class="timeline">
  24. </ul>
  25. <footer id="js-timeline_footer" class="timeline_footer">
  26. <i class="fa fa-spin fa-circle-o-notch" aria-hidden="true"></i>
  27. </footer>
  28. </article>
  29. <aside class="right_column"></aside>
  30. </div>
  31. </main>
  32. <script>
  33. current_file = location.pathname+location.search;
  34. <?php if(isset($_GET['q'])) { ?>
  35. $(function() {
  36. var query = "<?= htmlspecialchars((string)filter_input(INPUT_GET, 'q'), ENT_QUOTES) ?>";
  37. if(query[0] == "@") {
  38. window.location.href = "/search/users?q="+query.substr(1);
  39. }
  40. else {
  41. if(query[0] == "#") {
  42. query = query.substr(1);
  43. }
  44. if(query.length > 0) {
  45. current_search_history.push(query);
  46. if(current_search_history.length > 99) {
  47. current_search_history.shift();
  48. }
  49. localStorage.current_search_history = JSON.stringify(current_search_history);
  50. $('#main > .article_wrap > .center_column > .timeline_header > .header_items > .item').text("#"+query);
  51. $('#js-header_title_box > h1').text(query);
  52. $('title').text('#'+query+' - Halcyon Search');
  53. $('#js-search_nav_toots').toggleClass('view');
  54. $('#js-search_nav_toots a ').attr('href','/search'+location.search);
  55. $('#js-search_nav_peoples a ').attr('href','/search/users'+location.search)
  56. if(localStorage.getItem("setting_search_filter") === "all") {
  57. setTimeline("timelines/tag/"+query);
  58. }
  59. else if(localStorage.getItem("setting_search_filter") === "local") {
  60. setTimeline("timelines/tag/"+query,[{name:"local",data:"true"}]);
  61. }
  62. replace_emoji();
  63. }
  64. else {
  65. history.back();
  66. }
  67. }
  68. });
  69. <?php } else { ?>
  70. window.location.href = "/";
  71. <?php } ?>
  72. </script>
  73. <?php include ('footer.php'); ?>