index.php 27 KB

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