index.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. </title>
  51. <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
  52. <!-- CSS files -->
  53. <style>
  54. <?php
  55. include("../css/ui.css");
  56. include("../css/lablanca.css");
  57. ?>
  58. </style>
  59. <!-- CSS for mobile version -->
  60. <style media="(max-width : 990px)">
  61. <?php
  62. include("../css/m/ui.css");
  63. include("../css/m/lablanca.css");
  64. ?>
  65. </style>
  66. <!-- Script files -->
  67. <script type="text/javascript">
  68. <?php
  69. include("../script/ui.js");
  70. include("../script/lablanca.js");
  71. ?>
  72. </script>
  73. <!-- Meta tags -->
  74. <link rel="canonical" href="<?php echo "$proto$http_host/lablanca/"; ?>"/>
  75. <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
  76. <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
  77. <meta name="description" content="<?php echo $lng['lablanca_description'];?>"/>
  78. <meta property="og:title"
  79. content="<?php
  80. if ($is_festivals){
  81. echo str_replace('#', $year, $lng['lablanca_title']);
  82. }
  83. else{
  84. echo $lng['lablanca_no_title'];
  85. }
  86. ?>"
  87. />
  88. <meta property="og:url" content="<?php echo "$proto$http_host"; ?>"/>
  89. <meta property="og:description" content="<?php echo $lng['lablanca_description'];?>"/>
  90. <meta property="og:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
  91. <meta property="og:site_name" content="<?php echo $lng['lablanca_title'];?>"/>
  92. <meta property="og:type" content="website"/>
  93. <meta property="og:locale" content="<?php echo $lang; ?>"/>
  94. <meta name="twitter:card" content="summary"/>
  95. <meta name="twitter:title"
  96. content="<?php
  97. if ($is_festivals){
  98. echo str_replace('#', $year, $lng['lablanca_title']);
  99. }
  100. else{
  101. echo $lng['lablanca_no_title'];
  102. }
  103. ?>"
  104. />
  105. <meta name="twitter:description" content="<?php echo $lng['lablanca_description'];?>"/>
  106. <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
  107. <meta name="twitter:url" content="<?php echo"$proto$http_host"; ?>"/>
  108. <meta name="robots" content="index follow"/>
  109. </head>
  110. <body>
  111. <?php include("../header.php"); ?>
  112. <div id="content">
  113. <?php
  114. //Include file
  115. if ($is_festivals){
  116. include("fiestas.php");
  117. }
  118. else{
  119. include("nofiestas.php");
  120. }
  121. ?>
  122. <?php
  123. //If the program of previous years exist, show a drop list
  124. $year = date("Y");
  125. if (date("M") <= 8 || (date("M") == 8 && date("D") < 25)){
  126. $year --;
  127. }
  128. if (date("M") <= 8){
  129. $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year != " . date("Y") . " ORDER BY year DESC;");
  130. }
  131. else{
  132. $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year <= " . date("Y") . " ORDER BY year DESC;");
  133. }
  134. if (mysqli_num_rows($q_years) >= 0){
  135. echo("<br/><br/><div class='section' id='past_festivals'>\n");
  136. echo("<h3 class='section_title'>$lng[lablanca_past_title]</h3>\n");
  137. echo("<div class='entry'><ul>\n");
  138. while ($r_years = mysqli_fetch_array($q_years)){
  139. echo("<li><a href='$proto$http_host/lablanca/$r_years[year]'>$lng[lablanca_past_link] $r_years[year]</a></li>\n");
  140. }
  141. echo("</ul></div>\n");
  142. echo("</div>\n");
  143. }
  144. ?>
  145. </div>
  146. <?php
  147. include("../footer.php");
  148. $ad = ad($con, $lang, $lng);
  149. stats($ad, $ad_static, "fiestas", "");
  150. ?>
  151. </body>
  152. </html>