index.php 4.2 KB

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