index.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?php
  2. session_start();
  3. include("../functions.php");
  4. $con = startdb();
  5. $proto = getProtocol();
  6. //Language
  7. $lang = selectLanguage();
  8. include("../lang/lang_" . $lang . ".php");
  9. $cur_section = $lng['section_lablanca'];
  10. //Is festivals enabled in settings?
  11. $q = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
  12. if (mysqli_num_rows($q) == 0)
  13. $is_festivals = false;
  14. else{
  15. $r = mysqli_fetch_array($q);
  16. if ($r['value'] == 1){
  17. $is_festivals = true;
  18. }
  19. else{
  20. $is_festivals = false;
  21. }
  22. }
  23. //Get year
  24. $year = date("Y");
  25. //if (is_int($_GET['year']) == false){
  26. if ($_GET['year'] != ''){
  27. $q_year = mysqli_query($con, "SELECT id FROM festival WHERE year = " . mysqli_real_escape_string($con, $_GET['year']));
  28. if (mysqli_num_rows($q_year) > 0){
  29. $year = $_GET['year'];
  30. $is_festivals = true;
  31. }
  32. }
  33. //echo $_GET['year'];
  34. ?>
  35. <!DOCTYPE html>
  36. <html>
  37. <head>
  38. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  39. <meta charset="utf-8"/>
  40. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  41. <title>
  42. <?php
  43. if ($is_festivals){
  44. echo str_replace('#', $year, $lng['lablanca_title']);
  45. }
  46. else{
  47. echo $lng['lablanca_no_title'];
  48. }
  49. ?>
  50. - Gasteizko Margolariak
  51. </title>
  52. <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
  53. <!-- CSS files -->
  54. <style>
  55. <?php
  56. include("../css/ui.css");
  57. include("../css/lablanca.css");
  58. ?>
  59. </style>
  60. <!-- CSS for mobile version -->
  61. <style media="(max-width : 990px)">
  62. <?php
  63. include("../css/m/ui.css");
  64. include("../css/m/lablanca.css");
  65. ?>
  66. </style>
  67. <!-- Script files -->
  68. <script type="text/javascript">
  69. <?php
  70. include("../script/ui.js");
  71. include("../script/lablanca.js");
  72. ?>
  73. </script>
  74. <!-- Meta tags -->
  75. <link rel="canonical" href="<?php echo "$proto$http_host/lablanca/"; ?>"/>
  76. <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
  77. <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
  78. <meta name="description" content="<?php echo $lng['lablanca_description'];?>"/>
  79. <meta property="og:title"
  80. content="<?php
  81. if ($is_festivals){
  82. echo str_replace('#', $year, $lng['lablanca_title']);
  83. }
  84. else{
  85. echo $lng['lablanca_no_title'];
  86. }
  87. ?> - Gasteizko Margolariak"
  88. />
  89. <meta property="og:url" content="<?php echo "$proto$http_host"; ?>"/>
  90. <meta property="og:description" content="<?php echo $lng['lablanca_description'];?>"/>
  91. <meta property="og:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
  92. <meta property="og:site_name" content="<?php echo $lng['lablanca_title'];?>"/>
  93. <meta property="og:type" content="website"/>
  94. <meta property="og:locale" content="<?php echo $lang; ?>"/>
  95. <meta name="twitter:card" content="summary"/>
  96. <meta name="twitter:title"
  97. content="<?php
  98. if ($is_festivals){
  99. echo str_replace('#', $year, $lng['lablanca_title']);
  100. }
  101. else{
  102. echo $lng['lablanca_no_title'];
  103. }
  104. ?> - Gasteizko Margolariak"
  105. />
  106. <meta name="twitter:description" content="<?php echo $lng['lablanca_description'];?>"/>
  107. <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
  108. <meta name="twitter:url" content="<?php echo"$proto$http_host"; ?>"/>
  109. <meta name="robots" content="index follow"/>
  110. </head>
  111. <body>
  112. <?php include("../header.php"); ?>
  113. <div id="content">
  114. <?php
  115. //Include file
  116. if ($is_festivals){
  117. include("fiestas.php");
  118. }
  119. else{
  120. include("nofiestas.php");
  121. }
  122. ?>
  123. <?php
  124. //If the program of previous years exist, show a drop list
  125. $year = date("Y");
  126. if (date("M") <= 8 || (date("M") == 8 && date("D") < 25)){
  127. $year --;
  128. }
  129. if (date("M") <= 8){
  130. $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year != " . date("Y") . " ORDER BY year DESC;");
  131. }
  132. else{
  133. $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year <= " . date("Y") . " ORDER BY year DESC;");
  134. }
  135. if (mysqli_num_rows($q_years) >= 0){
  136. echo("<br/><br/><div class='section' id='past_festivals'>\n");
  137. echo("<h3 class='section_title'>$lng[lablanca_past_title]</h3>\n");
  138. echo("<div class='entry'><ul>\n");
  139. while ($r_years = mysqli_fetch_array($q_years)){
  140. echo("<li><a href='$proto$http_host/lablanca/$r_years[year]'>$lng[lablanca_past_link] $r_years[year]</a></li>\n");
  141. }
  142. echo("</ul></div>\n");
  143. echo("</div>\n");
  144. }
  145. ?>
  146. </div>
  147. <?php
  148. include("../footer.php");
  149. $ad = ad($con, $lang, $lng);
  150. stats($ad, $ad_static, "fiestas", "");
  151. ?>
  152. </body>
  153. </html>