index.php 4.5 KB

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