Faguss

soup_header.php

Jul 21st, 2020
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.86 KB | None | 0 0
  1. <!-- This is my soup description -->
  2. Found on the net<br>
  3. Znalezione w sieci<br>
  4.  
  5.  
  6.  
  7. <!-- Link displaying hidden content and then hiding itself after click -->
  8. <a id="showmyoptions"
  9. onclick=
  10. '
  11. document.getElementById("myoptions").style.display = "inline";
  12. document.getElementById("searchcontainer").style.display = "block";
  13. document.getElementById("showmyoptions").style.display = "none";
  14. '
  15. STYLE="cursor:url(http://ofp-faguss.com/img/cursor2.png), auto; font-size:0.75em;">show options</a>
  16.  
  17.  
  18.  
  19.  
  20. <!-- Start of the hidden content -->
  21. <span id="myoptions" style="display:none;">
  22. <hr>
  23.  
  24.  
  25.  
  26. <!-- Form drop-down -->
  27. <select id="filterbydate" onchange='window.location="http://faguss.soup.io/?date=" + document.getElementById("filterbydate").value'>
  28. <option>Filter by date...</option>
  29.  
  30. <?php
  31. // Get current date
  32. $CURRyear = date("Y");
  33. $CURRmonth = date("m");
  34. $CURRday = date("d");
  35.  
  36.  
  37. // Prepare vars for iteration
  38. $startYear = 2010;
  39. $year = $CURRyear;
  40. $month = 0;
  41. $day = 0;
  42. $quarter = "IV";
  43.  
  44.  
  45. // Determine current quarter of the year
  46. $CURRquarter = floor(--$CURRmonth / 3);
  47.  
  48. switch ($CURRquarter) {
  49. case 0: $month=3; $day=31; $quarter="I"; break;
  50. case 1: $month=6; $day=30; $quarter="II"; break;
  51. case 2: $month=9; $day=30; $quarter="III"; break;
  52. case 3: $month=12; $day=31; $quarter="IV"; break;
  53. };
  54.  
  55.  
  56. // Loop filling drop-down with dates
  57. while ($year>=$startYear && $month>0) {
  58. // Exception for 2013 III - skip it
  59. if ($year==2013 && $month==9) {
  60. $month -= 3;
  61. $quarter = "II";
  62. continue;
  63. };
  64.  
  65. // Exception for data lost in 2017 crash
  66. if ($year == 2016) {
  67. $year = 2015;
  68. $month = 9;
  69. $quarter = "III";
  70. $day = 30;
  71. continue;
  72. }
  73.  
  74. echo "<option value=\"$year-$month-$day\">$year $quarter</option>\n";
  75.  
  76. $month -= 3;
  77. switch($month) {
  78. case 9: $quarter="III"; $day=30; break;
  79. case 6: $quarter="II"; $day=30; break;
  80. case 3: $quarter="I"; $day=31; break;
  81. case 0: $quarter="IV"; $month=12; $day=31; $year--; break;
  82. };
  83. };
  84. ?>
  85.  
  86. </select>
  87. <hr>
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. <!-- Tag list -->
  102. All tags: <br>
  103.  
  104. <?php
  105. // List of my tags
  106. $mytags = array(
  107. "Actor", "Animals", "Art", "Cards", "Cat", "Comics", "Drink", "Body", "Film", "Food", "Gadget", "Games", "Goth", "Graph",
  108. "Homosexuality", "Info", "IT", "Language", "Lego", "Men-Women", "Military", "Misc", "Music", "Politics", "PL",
  109. "Religion", "Science", "Skill", "Studies", "Sport", "TV", "ChuckNorris",
  110. "Drugs", "Procrastination", "Tabloids", "Kids", "CalvinHobbes", "Pooh", "Car", "Valentine", "Job",
  111. "Christmas", "DYI", "Police", "Country", "Comment", "Soup", "Pun", "Pareidolia", "Books", "Photography", "Reaction",
  112. "NewYear", "Quotes", "Creativity", "Motivational", "Depression", "PixelArt", "Winter", "Dog", "Cthulhu",
  113. "StreetArt", "Internet", "Coding", "FatThursday", "Women", "Dark", "City", "Animation",
  114. "Jap", "MetaArt", "Overwatch"
  115.  
  116. // Lost in 2017 crash
  117. //"Halloween", "Clothing",
  118. //"Pop",
  119. //"Easter", "VideoGames", "FourChan", "Summer", "Astronaut", "Sandman",
  120. //,"PopTeamEpic", "Chordophones", "Lolnein", "JoJo", "Kancolle", "Carving"
  121. );
  122.  
  123. sort($mytags);
  124.  
  125. // Loop creating links
  126. foreach ($mytags as &$value) {
  127. // exceptions: different name for sorting and different for display
  128. if ($value == "FourChan")
  129. $value = "4chan";
  130.  
  131. echo "<a href=http://faguss.soup.io/tag/$value>$value</a>\n";
  132. };
  133. ?>
  134.  
  135. <hr>
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. <!-- Add soup search field -->
  143. <div class="hidden" id="searchcontainer">
  144. <form action="" method="get" accept-charset="utf-8">
  145. <input class="search" type="text" name="search" value="" size="20" />
  146. <input class="btn" type="submit" value="Search" />
  147. </form>
  148. </div>
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155. <!-- End of hidden content -->
  156. </span>
Add Comment
Please, Sign In to add comment