index.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <?php
  2. session_start();
  3. #$proto = $_SERVER['SERVER_PROTOCOL'];
  4. #$proto = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,strpos( $_SERVER["SERVER_PROTOCOL"],'/'))).'://';
  5. $http_host = $_SERVER['HTTP_HOST'];
  6. include("functions.php");
  7. $proto = getProtocol();
  8. $con = startdb();
  9. //Language
  10. $lang = selectLanguage();
  11. include("lang/lang_" . $lang . ".php");
  12. $cur_section = $lng['section_home'];
  13. ?>
  14. <!DOCTYPE html>
  15. <html>
  16. <head>
  17. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  18. <meta charset="utf-8"/>
  19. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
  20. <title><?php echo $lng['index_title'];?></title>
  21. <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
  22. <!-- CSS files -->
  23. <style>
  24. <?php
  25. include("css/ui.css");
  26. include("css/index.css");
  27. ?>
  28. </style>
  29. <!-- CSS for mobile version -->
  30. <style media="(max-width : 990px)">
  31. <?php
  32. include("css/m/ui.css");
  33. include("css/m/index.css");
  34. ?>
  35. </style>
  36. <!-- Script files -->
  37. <script type="text/javascript">
  38. <?php include("script/ui.js"); ?>
  39. </script>
  40. <!-- Meta tags -->
  41. <link rel="canonical" href="<?php echo "$proto$http_host"; ?>"/>
  42. <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
  43. <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
  44. <meta name="description" content="<?php echo $lng['index_us_content'];?>"/>
  45. <meta property="og:title" content="<?php echo $lng['index_title'];?>"/>
  46. <meta property="og:url" content="<?php echo "$proto$http_host"; ?>"/>
  47. <meta property="og:description" content="<?php echo $lng['index_us_content'];?>"/>
  48. <meta property="og:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
  49. <meta property="og:site_name" content="<?php echo $lng['index_title'];?>"/>
  50. <meta property="og:type" content="website"/>
  51. <meta property="og:locale" content="<?php echo $lang; ?>"/>
  52. <meta name="twitter:card" content="summary"/>
  53. <meta name="twitter:title" content="<?php echo $lng['index_title'];?>"/>
  54. <meta name="twitter:description" content="<?php echo $lng['index_us_content'];?>"/>
  55. <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
  56. <meta name="twitter:url" content="<?php echo"$proto$http_host"; ?>"/>
  57. <meta name="robots" content="index follow"/>
  58. </head>
  59. <body>
  60. <?php include("header.php"); ?>
  61. <div id="content">
  62. <?php
  63. //Festivals section
  64. $year = date("Y");
  65. $q_settings = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
  66. $r_settings = mysqli_fetch_array($q_settings);
  67. $festivals = $r_settings['value'];
  68. if ($festivals == 1){
  69. echo "<div class='section' id='festivales' itemscope itemtype='$protoschema.org/Event'>\n";
  70. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  71. echo "<meta itemprop='name' content='$lng[index_festivals_header] $year'/>\n";
  72. echo "<meta itemprop='description' content='$lng[index_festivals_header] $year'/>\n";
  73. echo "<meta itemprop='startDate' content='$year-08-04'/>\n";
  74. echo "<meta itemprop='endDate' content='$year-08-09'/>\n";
  75. echo "<meta itemprop='url' content='$proto$http_host/lablanca/'/>\n";
  76. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' itemprop='name' content='Vitoria-Gasteiz'/></span>\n");
  77. echo "<h3 class='section_title'>$lng[index_festivals_header] $year</h3>\n";
  78. echo "<table class='festival_section_table'><tr>\n";
  79. //Summary
  80. $q_festivals = mysqli_query($con, "SELECT text_$lang AS text, summary_$lang AS summary, img FROM festival WHERE year = $year;");
  81. if(mysqli_num_rows($q_festivals)){
  82. echo "<td><div class='entry' id='festivals_summary'>\n";
  83. $r_festivals = mysqli_fetch_array($q_festivals);
  84. if ($r_festivals['img'] != ''){
  85. echo "<meta itemprop='image' content='$proto$http_host/img/fiestas/$r_festivals[img]'/>\n";
  86. echo "<img id='festivals_image' alt=' ' src='$proto$http_host/img/fiestas/$r_festivals[img]'/>\n";
  87. }
  88. if ($r_festivals['summary'] != ''){
  89. echo "<span class='entry_title' id='festivals_summary_text'><br/>$r_festivals[summary]</span>\n";
  90. echo "<br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='$proto$http_host/lablanca/'>$lng[index_festivals_link]</a>\n";
  91. }
  92. else{
  93. echo "<span id='festivals_summary_text'><br/>" . cutText($r_festivals['text'], 300, "$lng[index_read_more]", "$proto$http_host/lablanca/") . "</span>\n";
  94. //echo "<br/><br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='$proto$http_host/lablanca/'>$lng[index_festivals_link]</a>\n";
  95. }
  96. echo "</div></td>\n";
  97. }
  98. //Location
  99. $q_location = mysqli_query($con, "SELECT lat, lon FROM location WHERE action = 'report' AND dtime > NOW() - INTERVAL 30 MINUTE ORDER BY dtime DESC LIMIT 1;");
  100. if (mysqli_num_rows($q_location) > 0){
  101. $r_location = mysqli_fetch_array($q_location);
  102. echo "<td><div class='entry' id='festival_entry_map'>\n";
  103. echo "<h3 class='entry_title'>$lng[index_festivals_location]</h3>\n";
  104. echo "<iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=$r_location[lat],$r_location[lon]' allowfullscreen></iframe>\n";
  105. echo "</div>\n";
  106. }
  107. echo "</tr></table>\n";
  108. echo "<table class='festival_section_table'><tr>\n";
  109. //GM schedule
  110. $q_sch_curr = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > NOW() - INTERVAL 45 MINUTE AND start < NOW() + INTERVAL 30 MINUTE ORDER BY start LIMIT 1;");
  111. $q_sch_next = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 1 AND start > NOW() AND start < NOW() + INTERVAL 240 MINUTE ORDER BY start LIMIT 1;");
  112. if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
  113. echo "<td><div class='entry festival_schedule'>\n";
  114. echo "<h3 class='entry_title'>$lng[index_festivals_gm_schedule]</h3>\n";
  115. if (mysqli_num_rows($q_sch_curr) > 0){
  116. $r_sch_curr = mysqli_fetch_array($q_sch_curr);
  117. echo "<div id='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'><h4>$lng[index_festivals_schedule_now]</h4>\n";
  118. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  119. echo "<meta itemprop='name' content='$r_sch_curr[title]'/>\n";
  120. echo "<meta itemprop='startDate' content='$r_sch_curr[isostart]'/>\n";
  121. if (strlen($r_sch_curr['isoend']) > 0){
  122. echo "<meta itemprop='endDate' content='$r_sch_curr[isoend]'/>\n";
  123. }
  124. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' content='Vitoria-Gasteiz'/><span>\n");
  125. echo "<span class='title'>$r_sch_curr[title]\n</span>";
  126. if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
  127. echo "<br/><span class='description'>$r_sch_curr[description]</span>\n";
  128. echo "<meta itemprop='description' content='$r_sch_curr[description]'/>\n";
  129. }
  130. echo "<table class='location'><tr>\n";
  131. echo "<td><a target='_blank' href='http://maps.google.com/maps?q=$r_sch_curr[lat],$r_sch_curr[lon]+(My+Point)&z=14&ll=$r_sch_curr[lat],$r_sch_curr[lon]'><img alt=' ' src='$proto$http_host/img/misc/pinpoint.png'/></a></td>\n";
  132. //If name and address are the same, show only name
  133. if ($r_sch_curr['place'] == $r_sch_curr['address']){
  134. echo "<td>$r_sch_curr[place]</td></tr></table>\n";
  135. }
  136. else{
  137. echo "<td>$r_sch_curr[place] <span class='address'>- $r_sch_curr[address]</span></td></tr></table>\n";
  138. }
  139. echo "</div\n>";
  140. }
  141. if (mysqli_num_rows($q_sch_next) > 0){
  142. $r_sch_next = mysqli_fetch_array($q_sch_next);
  143. echo "<div id='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'><h4>$lng[index_festivals_schedule_next]</h4>\n";
  144. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  145. echo "<meta itemprop='name' content='$r_sch_next[title]'/>\n";
  146. echo "<meta itemprop='startDate' content='$r_sch_next[isostart]'/>\n";
  147. if (strlen($r_sch_curr['isoend']) > 0){
  148. echo "<meta itemprop='endDate' content='$r_sch_next[isoend]'/>\n";
  149. }
  150. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta></span>\n");
  151. echo "<span class='title'>$r_sch_next[title] - $r_sch_next[st]\n</span>";
  152. if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
  153. echo "<br/><span class='description'>$r_sch_next[description]</span>\n";
  154. echo "<meta itemprop='description' content='$r_sch_next[description]'/>\n";
  155. }
  156. echo "<table class='location'><tr>\n";
  157. echo "<td><a target='_blank' href='http://maps.google.com/maps?q=$r_sch_next[lat],$r_sch_next[lon]+(My+Point)&z=14&ll=$r_sch_next[lat],$r_sch_next[lon]'><img alt=' ' src='$proto$http_host/img/misc/pinpoint.png'/></a></td>\n";
  158. //If name and address are the same, show only name
  159. if ($r_sch_next['place'] == $r_sch_next['address']){
  160. echo "<td>$r_sch_next[place]</td></tr></table>\n";
  161. }
  162. else{
  163. echo "<td>$r_sch_next[place] <span class='address'>- $r_sch_next[address]</span></td></tr></table>\n";
  164. }
  165. echo "</div\n>";
  166. }
  167. echo "</div></td>\n"; //close gm schedule entry;
  168. }
  169. //city schedule
  170. $q_sch_curr = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 0 AND start > NOW() - INTERVAL 45 MINUTE AND start < NOW() + INTERVAL 30 MINUTE ORDER BY start LIMIT 1;");
  171. $q_sch_next = mysqli_query($con, "SELECT festival_event.id AS id, gm, title_$lang AS title, description_$lang AS description, host, place, date_format(start, '%H:%i') AS st, date_format(end, '%H:%i') AS end, DATE_FORMAT(start, '%Y-%m-%dT%H:%i:00') AS isostart, DATE_FORMAT(end, '%Y-%m-%dT%H:%i:00') AS isoend, place.name_$lang AS place, address_$lang AS address, lat, lon FROM festival_event, place WHERE place.id = festival_event.place AND gm = 0 AND start > NOW() AND start < NOW() + INTERVAL 240 MINUTE ORDER BY start LIMIT 1;");
  172. if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
  173. echo "<td><div class='entry festival_schedule' >\n";
  174. echo "<h3 class='entry_title'>$lng[index_festivals_city_schedule]</h3>\n";
  175. if (mysqli_num_rows($q_sch_curr) > 0){
  176. $r_sch_curr = mysqli_fetch_array($q_sch_curr);
  177. echo "<div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'><h4>$lng[index_festivals_schedule_now]</h4>\n";
  178. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  179. echo "<meta itemprop='name' content='$r_sch_curr[title]'/>\n";
  180. echo "<meta itemprop='startDate' content='$r_sch_curr[isostart]'/>\n";
  181. if (strlen($r_sch_curr['isoend']) > 0){
  182. echo "<meta itemprop='endDate' content='$r_sch_curr[isoend]'/>\n";
  183. }
  184. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta></span>\n");
  185. echo "<span class='title'>$r_sch_curr[title]\n</span>";
  186. if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
  187. echo "<br/><span class='description'>$r_sch_curr[description]</span>\n";
  188. echo "<meta itemprop='description' content='$r_sch_curr[description]'/>\n";
  189. }
  190. echo "<table class='location'><tr>\n";
  191. echo "<td><a target='_blank' href='http://maps.google.com/maps?q=$r_sch_curr[lat],$r_sch_curr[lon]+(My+Point)&z=14&ll=$r_sch_curr[lat],$r_sch_curr[lon]'><img alt=' ' src='$proto$http_host/img/misc/pinpoint.png'/></a></td>\n";
  192. //If name and address are the same, show only name
  193. if ($r_sch_curr['place'] == $r_sch_curr['address']){
  194. echo "<td>$r_sch_curr[place]</td></tr></table>\n";
  195. }
  196. else{
  197. echo "<td>$r_sch_curr[place] <span class='address'>- $r_sch_curr[address]</span></td></tr></table>\n";
  198. }
  199. echo "</div\n>";
  200. }
  201. if (mysqli_num_rows($q_sch_next) > 0){
  202. $r_sch_next = mysqli_fetch_array($q_sch_next);
  203. echo "<div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'><h4>$lng[index_festivals_schedule_next]</h4>\n";
  204. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  205. echo "<meta itemprop='name' content='$r_sch_next[title]'/>\n";
  206. echo "<meta itemprop='startDate' content='$r_sch_next[isostart]'/>\n";
  207. if (strlen($r_sch_curr['isoend']) > 0){
  208. echo "<meta itemprop='endDate' content='$r_sch_next[isoend]'/>\n";
  209. }
  210. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta></span>\n");
  211. echo "<span class='title'>$r_sch_next[title] - ($r_sch_next[st])\n</span>";
  212. if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
  213. echo "<br/><span class='description'>$r_sch_next[description]</span>\n";
  214. echo "<meta itemprop='description' content='$r_sch_next[description]'/>\n";
  215. }
  216. echo "<table class='location'><tr>\n";
  217. echo "<td><a target='_blank' href='http://maps.google.com/maps?q=$r_sch_next[lat],$r_sch_next[lon]+(My+Point)&z=14&ll=$r_sch_next[lat],$r_sch_next[lon]'><img alt=' ' src='$proto$http_host/img/misc/pinpoint.png'/></a></td>\n";
  218. //If name and address are the same, show only name
  219. if ($r_sch_next['place'] == $r_sch_next['address']){
  220. echo "<td>$r_sch_next[place]</td></tr></table>\n";
  221. }
  222. else{
  223. echo "<td>$r_sch_next[place] <span class='address'>- $r_sch_next[address]</span></td></tr></table>\n";
  224. }
  225. echo "</div\n>";
  226. }
  227. echo "</div></td>\n"; //close city schedule entry;
  228. }
  229. echo "</tr></table>\n";
  230. echo "<a class='go_to_section' href='$proto$http_host/lablanca/'>$lng[index_festivals_link]</a><br/>\n";
  231. echo "</div>\n";
  232. }
  233. //Upcaming activity section
  234. $q_activity = mysqli_query($con, "SELECT id, permalink, date, DATE_FORMAT(date, '%Y-%m-%d') AS isodate, title_$lang AS title, text_$lang AS text, price, inscription, people, max_people, city FROM activity WHERE visible = 1 AND date > now() ORDER BY date LIMIT 1;");
  235. $upcoming_activity_shown = false;
  236. if (mysqli_num_rows($q_activity) > 0){
  237. $upcoming_activity_shown = true;
  238. $r_activity = mysqli_fetch_array($q_activity);
  239. echo "<div class='section'>\n";
  240. echo "<h3 class='section_title'>$lng[index_upcoming_activity]</h3>\n";
  241. echo "<div class='entry' itemscope itemtype='http://schema.org/Event'>\n";
  242. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  243. echo "<meta itemprop='name' content='$r_activity[title]'/>\n";
  244. echo "<meta itemprop='description' content='$r_activity[text]'/>\n";
  245. echo "<meta itemprop='startDate endDate' content='$r_activity[isodate]'/>\n";
  246. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' itemprop='name' content='$r_activity[city]'/></span>\n");
  247. echo "<meta itemprop='url' content='$proto$http_host/actividades/$r_activity[permalink]'/>\n";
  248. echo "<div class='hidden' itemprop='organizer' itemscope itemtype='http://schema.org/Organization'>\n";
  249. echo "<meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>\n";
  250. echo "<meta itemprop='name' content='Gasteizko Margolariak'/>\n";
  251. echo "<meta itemprop='logo' content='$proto$http_host/img/logo/logo.png'/>\n";
  252. echo "<meta itemprop='foundingDate' content='2013-02-03'/>\n";
  253. echo "<meta itemprop='telephone' content='+34637140371'/>\n";
  254. echo "</div>\n";
  255. echo "<div id='upcoming_activity' class='table'><div class='tr'>\n";
  256. //If image, show it
  257. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  258. if (mysqli_num_rows($q_activity_image) > 0){
  259. $r_activity_image = mysqli_fetch_array($q_activity_image);
  260. echo "<div class='td'><div id='upcoming_image'>\n";
  261. echo "<a href='$proto$http_host/actividades/$r_activity[permalink]'>\n";
  262. echo "<meta itemprop='image' content='$proto$http_host/img/actividades/$r_activity_image[image]'/>\n";
  263. echo "<img src='$proto$http_host/img/actividades/miniature/$r_activity_image[image]' alt='$r_activity[title]'/>\n";
  264. echo "</a>\n";
  265. echo "</div></div>\n";
  266. }
  267. echo "<div class='td'><div id='upcoming_text'>\n";
  268. echo "<h3 class='entry_title'><a itemprop='url' href='$proto$http_host/actividades/$r_activity[permalink]'>$r_activity[title]</a></h3>\n";
  269. echo "<p>". cutText($r_activity['text'], 250, "$lng[index_read_more]", "$http_host/actividades/$r_activity[permalink]") . "</p>\n";
  270. echo "</div></div>\n";
  271. echo "<div class='td'><div id='upcoming_details'>\n";
  272. echo "<table>\n";
  273. echo "<tr><td>\n";
  274. echo "$lng[index_upcoming_activity_date]</td><td>" . formatDate($r_activity['date'], $lang, false) . "\n";
  275. echo "</td></tr>\n";
  276. echo "<tr>\n";
  277. echo "<td>$lng[index_upcoming_activity_price]</td>";
  278. if ($r_activity['price'] == 0){
  279. echo "<td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>$lng[index_upcoming_activity_free]\n";
  280. echo "<meta itemprop='priceCurrency' content='EUR'/><meta itemprop='price' content='0'/><meta itemprop='url' content='$proto$http_host/actividades/$r_activity[permalink]'/>\n</td>\n";
  281. echo "</tr><tr>\n";
  282. echo "<td>$lng[index_upcoming_activity_inscription]</td>";
  283. if ($r_activity['inscription'] == 1)
  284. echo "<td>$lng[yes]</td>\n";
  285. else
  286. echo "<td>$lng[no]</td>\n";
  287. }
  288. else{
  289. echo "<td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>$r_activity[price] €\n";
  290. echo "<meta itemprop='priceCurrency' content='EUR'/><meta itemprop='price' content='$r_activity[price]'/></td>\n";
  291. }
  292. echo "</tr>\n";
  293. if ($r_activity['max_people'] > 0){
  294. echo "<tr><td>$lng[index_upcoming_activity_max_people]</td><td>$r_activity[max_people]</td></tr>\n";
  295. }
  296. echo "</table>\n";
  297. echo "<a href='$proto$http_host/actividades/$r_activity[permalink]'>$lng[index_upcoming_activity_see]</a><br/><br/>\n";
  298. echo "</div></div></div></div>\n";
  299. echo "</div>\n";//Entry
  300. echo "<a class='go_to_section' href='$proto$http_host/actividades/'>$lng[index_upcoming_activity_see_all]</a><br/>\n";
  301. echo "</div>\n";//Section
  302. }
  303. ?>
  304. <div class='section' itemscope itemtype='http://schema.org/Organization'>
  305. <meta itemprop='url' content='<?php echo("$proto$http_host"); ?>'/>
  306. <h3 class='section_title' itemprop='name'><?php echo($lng['index_us']); ?></h3>
  307. <div class='entry' id='us'>
  308. <p itemprop='description'><?php echo($lng['index_us_content']); ?></p>
  309. <div><img itemprop='logo' src='<?php echo("$proto$http_host/img/logo/GasteizkoMargolariak.png"); ?>'/></div>
  310. </div>
  311. <a class='go_to_section' href='<?php echo($proto.$http_host); ?>/nosotros/'><?php echo($lng['index_us_more']) ?></a>
  312. <br/>
  313. </div>
  314. <div id='content_table'>
  315. <div class='content_row'>
  316. <div class='content_cell' id='cell_posts'>
  317. <div class='section' id='latest_posts'>
  318. <?php
  319. echo "<h3 class='section_title'>$lng[index_latest_posts]</h3>\n";
  320. $q_post = mysqli_query($con, "SELECT id, permalink, title_$lang AS title, text_$lang AS text, dtime, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate FROM post WHERE visible = 1 ORDER BY dtime DESC LIMIT 2;");
  321. if (mysqli_num_rows($q_post) == 0){
  322. echo "<div class='entry'><h3 class='entry_title'>$lng[index_no_post]</div>\n";
  323. }
  324. else{
  325. while ($r_post = mysqli_fetch_array($q_post)){
  326. echo "<div class='entry post' itemscope itemtype='http://schema.org/BlogPosting'>\n";
  327. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  328. echo "<meta itemprop='datePublished dateModified' content='$r_post[isodate]'/>\n";
  329. echo "<meta itemprop='headline name' content='$r_post[title]'/>\n";
  330. echo "<meta itemprop='articleBody text' content='$r_post[text]'/>\n";
  331. echo "<meta itemprop='mainEntityOfPage' content='$proto$http_host'/>\n";
  332. echo "<div class='hidden' itemprop='author publisher' itemscope itemtype='http://schema.org/Organization'>\n";
  333. echo "<meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>\n";
  334. echo "<meta itemprop='name' content='Gasteizko Margolariak'/>\n";
  335. echo "<meta itemprop='logo' content='$proto$http_host/img/logo/logo.png'/>\n";
  336. echo "<meta itemprop='foundingDate' content='03-02-2013'/>\n";
  337. echo "<meta itemprop='telephone' content='+34637140371'/>\n";
  338. echo "<meta itemprop='url' content='$proto$http_host'/>\n";
  339. echo "</div>\n";
  340. $q_post_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_post[id] ORDER BY idx LIMIT 1;");
  341. if (mysqli_num_rows($q_post_image) > 0){
  342. $r_post_image = mysqli_fetch_array($q_post_image);
  343. echo "<meta itemprop='image' content='$proto$http_host/img/blog/preview/$r_post_image[image]'/>\n";
  344. echo "<a href='$proto$http_host/blog/$r_post[permalink]'><img src='$proto$http_host/img/blog/miniature/$r_post_image[image]'/></a>\n";
  345. }
  346. echo "<h3 class='entry_title'><a itemprop='url' href='$proto$http_host/blog/$r_post[permalink]'>$r_post[title]</a></h3>\n";
  347. echo "<p>". cutText($r_post['text'], 100, "$lng[index_read_more]", "$proto$http_host/blog/$r_post[permalink]") . "</p>\n";
  348. echo "<span>" . formatDate($r_post['dtime'], $lang, false) . "</span>\n";
  349. echo "</div>\n";
  350. }
  351. echo "<a class='go_to_section' href='$proto$http_host/blog/'>$lng[index_see_all_posts]</a><br/>\n";
  352. }
  353. ?>
  354. </div>
  355. </div>
  356. <div class='content_cell' id='cell_photos'>
  357. <div class='section' id='latest_photos'>
  358. <?php
  359. echo "<h3 class='section_title'>$lng[index_latest_photos]</h3>\n";
  360. $q_photos = mysqli_query($con, "SELECT id, file, title_$lang AS title, DATE_FORMAT(uploaded, '%Y-%m-%d') AS isodate FROM photo ORDER BY uploaded DESC LIMIT 6;");
  361. //TODO WHERE approved = 1
  362. if (mysqli_num_rows($q_photos) == 0){
  363. echo "<div class='entry'>$lng[index_no_photos]</div>\n";
  364. }
  365. else{
  366. echo "<div class='entry'>\n";
  367. echo "<table id='table_photos'>\n";
  368. echo "<tr>\n";
  369. $i = 0;
  370. while ($r_photos = mysqli_fetch_array($q_photos)){
  371. $q_album = mysqli_query($con, "select permalink from album, photo_album WHERE photo = $r_photos[id] AND id = album LIMIT 1;");
  372. $r_album = mysqli_fetch_array($q_album);
  373. echo "<td itemscope itemtype='http://schema.org/Photograph'>\n";
  374. echo "<meta itemprop='datePublished' content='$r_photos[isodate]'/>\n";
  375. echo "<a href='$proto$http_host/galeria/$r_album[permalink]'>\n";
  376. echo "<meta itemprop='image' content='http://$http_host/img/galeria/$r_photos[file]'/>\n";
  377. echo "<img src='$proto$http_host/img/galeria/miniature/$r_photos[file]' alt='$r_photos[title]' /></a></td>\n";
  378. $i ++;
  379. if ($i % 2 == 0)
  380. echo "</tr><tr>";
  381. }
  382. echo "</tr>\n";
  383. echo "</table>\n";
  384. echo "</div>\n";
  385. echo "<a class='go_to_section' href='$proto$http_host/galeria/'>$lng[index_see_all_photos]</a><br/>\n";
  386. }
  387. ?>
  388. </div>
  389. </div>
  390. </div>
  391. </div>
  392. <?php
  393. if ($upcoming_activity_shown == false){
  394. $q_activity = mysqli_query($con, "SELECT id, permalink, date, DATE_FORMAT(date, '%Y-%m-%d') AS isodate, title_$lang AS title, text_$lang AS text, after_$lang AS after, price, inscription, people, max_people, city FROM activity WHERE visible = 1 ORDER BY date DESC LIMIT 2;");
  395. if (mysqli_num_rows($q_activity) > 0){
  396. echo "<div class='section' id='latest_activities'>\n";
  397. echo "<h3 class='section_title'>$lng[index_latest_activities]</h3>\n";
  398. while ($r_activity = mysqli_fetch_array($q_activity)){
  399. echo "<div class='entry' itemscope itemtype='http://schema.org/Event'>\n";
  400. echo "<meta itemprop='inLanguage' content='$lang'/>\n";
  401. echo "<meta itemprop='name' content='$r_activity[title]'/>\n";
  402. echo "<meta itemprop='description' content='$r_activity[text]'/>\n";
  403. echo "<meta itemprop='startDate endDate' content='$r_activity[isodate]'/>\n";
  404. echo("<span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'><meta itemprop='address' itemprop='name' content='$r_activity[city]'/><meta itemprop='name' content='$r_activity[city]'/></span>\n");
  405. echo "<div class='hidden' itemprop='organizer' itemscope itemtype='http://schema.org/Organization'>\n";
  406. echo "<meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>\n";
  407. echo "<meta itemprop='name' content='Gasteizko Margolariak'/>\n";
  408. echo "<meta itemprop='logo' content='$proto$http_host/img/logo/logo.png'/>\n";
  409. echo "<meta itemprop='foundingDate' content='03-02-2013'/>\n";
  410. echo "<meta itemprop='telephone' content='+34637140371'/>\n";
  411. echo "<meta itemprop='url' content='$proto$http_host'/>\n";
  412. echo "</div>\n";
  413. echo "<h3 class='entry_title'><a itemprop='url' href='$proto$http_host/actividades/$r_activity[permalink]'>$r_activity[title]</a></h3>\n";
  414. echo "<table class='latest_activity'><tr>\n";
  415. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  416. if (mysqli_num_rows($q_activity_image) > 0){
  417. $r_activity_image = mysqli_fetch_array($q_activity_image);
  418. echo "<td class='latest_activity_image'><a href='$proto$http_host/actividades/$r_activity[permalink]'>\n";
  419. echo "<meta itemprop='image' content='$proto$http_host/img/actividades/$r_activity_image[image]'/>\n";
  420. echo "<img src='$proto$http_host/img/actividades/miniature/$r_activity_image[image]' alt='$r_activity[title]'/>\n";
  421. echo "</a></td>\n";
  422. }
  423. //echo "<div class='activity_text'>\n";
  424. //echo "<p>". cutText($r_activity['text'], 300, "$lng[index_read_more]", "$proto$http_host/actividades/$r_activity[permalink]") . "</p>\n";
  425. if ($r_activity['after'] == ''){
  426. echo "<td class='latest_activity_text'>" . cutText($r_activity['text'], 300, "$lng[index_read_more]", "$proto$http_host/actividades/$r_activity[permalink]") . "</td>\n";
  427. }
  428. else{
  429. echo "<td class='latest_activity_text'>" . cutText($r_activity['after'], 300, "$lng[index_read_more]", "$proto$http_host/actividades/$r_activity[permalink]") . "</td>\n";
  430. }
  431. echo "</tr></table>\n";
  432. //echo "</div>\n";
  433. //echo "</div>\n";
  434. echo "</div>\n";
  435. }
  436. echo "<a class='go_to_section' href='$proto$http_host/actividades/'>$lng[index_upcoming_activity_see_all]</a><br/>\n";
  437. echo "</div>";
  438. }
  439. }
  440. //Festivals section (if no festivals shown on top)
  441. if ($festivals == 0){
  442. ?>
  443. <div class='section'>
  444. <h3 class='section_title'><?php echo($lng['index_festivals_header']); ?></h3>
  445. <div class='entry'>
  446. <?php echo (cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 300, "$lng[index_read_more]", "$proto$http_host/lablanca/")); ?>
  447. </div>
  448. </div>
  449. <?php
  450. }
  451. ?>
  452. </div>
  453. <?php
  454. //Footer
  455. include("footer.php");
  456. $ad = ad($con, $lang, $lng);
  457. stats($ad, $ad_static, "index", "");
  458. ?>
  459. </body>
  460. </html>