search_hash_tag.php 2.1 KB

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