index.php 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. <?php
  2. session_start();
  3. $http_host = $_SERVER['HTTP_HOST'];
  4. include("functions.php");
  5. $proto = getProtocol();
  6. $con = startdb();
  7. $server = "$proto$http_host";
  8. //Language
  9. $lang = selectLanguage();
  10. include("lang/lang_" . $lang . ".php");
  11. $cur_section = $lng['section_home'];
  12. ?>
  13. <!DOCTYPE html>
  14. <html>
  15. <head>
  16. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  17. <meta charset="utf-8"/>
  18. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"/>
  19. <title><?=$lng['index_title']?></title>
  20. <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico"/>
  21. <!-- CSS files -->
  22. <style>
  23. <?php
  24. include("css/ui.css");
  25. include("css/index.css");
  26. ?>
  27. </style>
  28. <!-- CSS for mobile version -->
  29. <style media="(max-width : 990px)">
  30. <?php
  31. include("css/m/ui.css");
  32. include("css/m/index.css");
  33. ?>
  34. </style>
  35. <!-- Script files -->
  36. <script type="text/javascript">
  37. <?php include("script/ui.js"); ?>
  38. </script>
  39. <!-- Meta tags -->
  40. <link rel="canonical" href="<?=$server?>"/>
  41. <link rel="author" href="<?=$server?>"/>
  42. <link rel="publisher" href="<?=$server?>"/>
  43. <meta name="description" content="<?php echo $lng['index_us_content'];?>"/>
  44. <meta property="og:title" content="<?php echo $lng['index_title'];?>"/>
  45. <meta property="og:url" content="<?=$server?>"/>
  46. <meta property="og:description" content="<?=$lng['index_us_content']?>"/>
  47. <meta property="og:image" content="<?=$server?>/img/logo/logo.png"/>
  48. <meta property="og:site_name" content="<?=$lng['index_title']?>"/>
  49. <meta property="og:type" content="website"/>
  50. <meta property="og:locale" content="<?php echo $lang; ?>"/>
  51. <meta name="twitter:card" content="summary"/>
  52. <meta name="twitter:title" content="<?=$lng['index_title']?>"/>
  53. <meta name="twitter:description" content="<?=$lng['index_us_content']?>"/>
  54. <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
  55. <meta name="twitter:url" content="<?=$server?>"/>
  56. <meta name="robots" content="index follow"/>
  57. </head>
  58. <body>
  59. <?php include("header.php"); ?>
  60. <div id="content">
  61. <?php
  62. //Location section
  63. $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;");
  64. if (mysqli_num_rows($q_location) > 0){
  65. $r_location = mysqli_fetch_array($q_location);
  66. ?>
  67. <div class='section' id='location'>
  68. <h3 class='section_title'><?=$lng[index_festivals_location]?></h3>
  69. <div class='entry' id='map'>
  70. <iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=<?=$r_location[lat]?>,<?=$r_location[lon]?>' allowfullscreen></iframe>
  71. </div>
  72. </div>
  73. <?php
  74. }
  75. //Festivals section
  76. $year = date("Y");
  77. $q_settings = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
  78. $r_settings = mysqli_fetch_array($q_settings);
  79. $festivals = $r_settings['value'];
  80. if ($festivals == 1){
  81. ?>
  82. <div class='section' id='festivals' itemscope itemtype='http://schema.org/Event'>
  83. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  84. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  85. <meta itemprop='name' content='Gasteizko Margolariak'/>
  86. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  87. <meta itemprop='foundingDate' content='2013-02-03'/>
  88. <meta itemprop='telephone' content='+34637140371'/>
  89. </div> <!-- .hidden -->
  90. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  91. <meta itemprop='name' content='<?=$lng['index_festivals_header']?> <?=$year?>'/>
  92. <meta itemprop='description' content='<?=$lng['index_festivals_header']?> <?=$year?>'/>
  93. <meta itemprop='startDate' content='<?=$year?>-08-04'/>
  94. <meta itemprop='endDate' content='<?=$year?>-08-09'/>
  95. <meta itemprop='url' content='<?=$server?>/lablanca/'/>
  96. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  97. <meta itemprop='name' content='Vitoria-Gasteiz'/>
  98. <meta itemprop='address' content='Vitoria-Gasteiz'/>
  99. </span>
  100. <h3 class='section_title'><?=$lng['index_festivals_header']?> <?=$year?></h3>
  101. <div class='entry' id='festivals_summary'>
  102. <?php
  103. // Offers (for metadata)
  104. $q_offer = mysqli_query($con, "SELECT name_$lang AS name, description_$lang AS description, price FROM festival_offer WHERE year = $year");
  105. while($r_offer = mysqli_fetch_array($q_offer)){
  106. ?>
  107. <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  108. <meta itemprop='name' content='<?=$r_offer['name']?>'/>
  109. <meta itemprop='description' content='<?=$r_offer['description']?>'/>
  110. <meta itemprop='price' content='<?=$r_offer['price']?>'/>
  111. <meta itemprop='priceCurrency' content='EUR'/>
  112. <meta itemprop='url' content='<?=$server?>/lablanca/'/>
  113. <meta itemprop='availability' content='Sold Out'/>
  114. <meta itemprop='validfrom' content='<?=$year?>-07-25'/>
  115. </span>
  116. <?php
  117. }
  118. // Summary
  119. $q_festivals = mysqli_query($con, "SELECT text_$lang AS text, summary_$lang AS summary, img FROM festival WHERE year = $year;");
  120. if(mysqli_num_rows($q_festivals)){
  121. $r_festivals = mysqli_fetch_array($q_festivals);
  122. if ($r_festivals['img'] != ''){
  123. ?>
  124. <meta itemprop='image' content='<?=$server?>/img/fiestas/view/<?=$r_festivals['img']?>'/>
  125. <img id='festivals_image' alt='<?=$lng['index_festivals_header'] . ' ' . $year?>' src='<?=$server?>/img/fiestas/preview/<?=$r_festivals['img']?>'/>
  126. <?php
  127. }
  128. if ($r_festivals['summary'] != ''){
  129. ?>
  130. <br/><span class='entry_title' id='festivals_summary_text'><?=$r_festivals['summary']?></span>
  131. <br/><br/><br/>
  132. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='<?=$server?>/lablanca/'><?=$lng['index_festivals_link']?></a>
  133. <?php
  134. }
  135. else{
  136. ?>
  137. <span id='festivals_summary_text'>
  138. <br/>
  139. <span class='mobile'><?=cutText($r_festivals['text'], 300, "$lng[index_read_more]", "$server/lablanca/")?></span>
  140. <span class='desktop'><?=cutText($r_festivals['text'], 500, "$lng[index_read_more]", "$server/lablanca/")?></span>
  141. </span>
  142. <?php
  143. }
  144. }
  145. ?>
  146. </div> <!--festivals_summary - entry-->
  147. <div id='festivals_schedule_table'>
  148. <div id='festivals_schedule_row'>
  149. <div class='festivals_schedule_cell'>
  150. <?php
  151. //GM schedule
  152. $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;");
  153. $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;");
  154. if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
  155. ?>
  156. <div class='entry festival_schedule' id='festivals_gm'>
  157. <h3 class='entry_title'><?=$lng['index_festivals_gm_schedule']?></h3>
  158. <?php
  159. if (mysqli_num_rows($q_sch_curr) > 0){
  160. $r_sch_curr = mysqli_fetch_array($q_sch_curr);
  161. ?>
  162. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  163. <h4><?=$lng[index_festivals_schedule_now]?></h4>
  164. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  165. <meta itemprop='name' content='<?=$r_sch_curr['title']?>'/>
  166. <meta itemprop='startDate' content='<?=$r_sch_curr['isostart']?>'/>
  167. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  168. <meta itemprop='address' content='Vitoria-Gasteiz'/>
  169. </span>
  170. <?php
  171. if (strlen($r_sch_curr['isoend']) > 0){
  172. ?>
  173. <meta itemprop='endDate' content='<?=$r_sch_curr['isoend']?>'/>
  174. <?php
  175. }
  176. ?>
  177. <div class='schedule_content'>
  178. <span class='title'><?=$r_sch_curr['title']?></span>
  179. <?php
  180. if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
  181. ?>
  182. <br/><p class='description'><?=$r_sch_curr['description']?></p>
  183. <meta itemprop='description' content='<?=$r_sch_curr['description']?>'/>
  184. <?php
  185. }
  186. ?>
  187. <table class='location'>
  188. <tr>
  189. <td>
  190. <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr[lat]?>,<?=$r_sch_curr[lon]?>+Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_curr[lat]?>,<?=$r_sch_curr[lon]?>'>
  191. <img alt='<?=$r_sch_curr['title']?>'' src='<?server?>/img/misc/pinpoint.png'/>
  192. </a>
  193. </td>
  194. <td>
  195. <?php
  196. //If name and address are the same, show only name
  197. if ($r_sch_curr['place'] == $r_sch_curr['address']){
  198. ?>
  199. <?=$r_sch_curr['place']?>
  200. <?php
  201. }
  202. else{
  203. ?>
  204. <?=$r_sch_curr['place']?><br/>
  205. <span class='address'><?=$r_sch_curr['address']?></span>
  206. <?php
  207. }
  208. ?>
  209. </td>
  210. </tr>
  211. </table>
  212. </div> <!--.schedule_content -->
  213. </div> <!-- festival-event -->
  214. <?php
  215. } // if (mysqli_num_rows($q_sch_curr) > 0)
  216. if (mysqli_num_rows($q_sch_next) > 0){
  217. $r_sch_next = mysqli_fetch_array($q_sch_next);
  218. ?>
  219. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  220. <h4><?=$lng['index_festivals_schedule_next']?></h4>
  221. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  222. <meta itemprop='name' content='<?=$r_sch_next['title']?>'/>
  223. <meta itemprop='startDate' content='<?=$r_sch_next['isostart']?>'/>
  224. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  225. <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
  226. </span>
  227. <?php
  228. if (strlen($r_sch_curr['isoend']) > 0){
  229. ?>
  230. <meta itemprop='endDate' content='<?=$r_sch_next['isoend']?>'/>
  231. <?php
  232. }
  233. ?>
  234. <div class='schedule_content'>
  235. <span class='title'><?=$r_sch_next['title']?> - <?=$r_sch_next['st']?></span>
  236. <?php
  237. if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
  238. ?>
  239. <br/><p class='description'><?=$r_sch_next['description']?></p>
  240. <meta itemprclass='entry'op='description' content='<?=$r_sch_next['description']?>'/>
  241. <?php
  242. }
  243. ?>
  244. <table class='location'>
  245. <tr>
  246. <td>
  247. <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]?>'>
  248. <img alt=' ' src='<?=server?>/img/misc/pinpoint.png'/>
  249. </a>
  250. </td>
  251. <td>
  252. <?php
  253. //If name and address are the same, show only name
  254. if ($r_sch_next['place'] == $r_sch_next['address']){
  255. echo("$r_sch_next[place]\n");
  256. }
  257. else{
  258. echo("$r_sch_next[place] </br><span class='address'> $r_sch_next[address]</span>\n");
  259. }
  260. ?>
  261. </td>
  262. </tr>
  263. </table>
  264. </div> <!--.schedule_content -->
  265. </div> <!-- festival-event -->
  266. <?php
  267. }
  268. ?>
  269. </div> <!--festivals_gm-->
  270. <?php
  271. } // if (mysqli_num_rows($q_sch_curr) > 0 || ysqli_num_rows($q_sch_next) > 0)
  272. ?>
  273. </div> <!-- festivals_schedule_cell -->
  274. <div class='festivals_schedule_cell'>
  275. <?php
  276. //City schedule
  277. $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;");
  278. $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;");
  279. if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
  280. echo "<div class='entry festival_schedule' id='festivals_city'>\n";
  281. echo "<h3 class='entry_title'>$lng[index_festivals_city_schedule]</h3>\n";
  282. if (mysqli_num_rows($q_sch_curr) > 0){
  283. $r_sch_curr = mysqli_fetch_array($q_sch_curr);
  284. ?>
  285. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  286. <h4><?=$lng['index_festivals_schedule_now']?></h4>
  287. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  288. <meta itemprop='name' content='<?=$r_sch_curr['title']?>'/>
  289. <meta itemprop='startDate' content='<?=$r_sch_curr['isostart']?>'/>
  290. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  291. <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
  292. </span>
  293. <?php
  294. if (strlen($r_sch_curr['isoend']) > 0){
  295. echo("<meta itemprop='endDate' content='$r_sch_curr[isoend]'/>\n");
  296. }
  297. ?>
  298. <div class='schedule_content'>
  299. <span class='title'><?=$r_sch_curr['title']?></span>
  300. <?php
  301. if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
  302. echo("<br/><p class='description'>$r_sch_curr[description]</p>\n");
  303. echo("<meta itemprop='description' content='$r_sch_curr[description]'/>\n");
  304. }
  305. ?>
  306. <table class='location'>
  307. <tr>
  308. <td>
  309. <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]?>'>
  310. <img alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
  311. </a>
  312. </td>
  313. <td>
  314. <?php
  315. //If name and address are the same, show only name
  316. if ($r_sch_curr['place'] == $r_sch_curr['address']){
  317. echo("$r_sch_curr[place]\n");
  318. }
  319. else{
  320. echo("$r_sch_curr[place] <br/><span class='address'> $r_sch_curr[address]</span>\n");
  321. }
  322. ?>
  323. </td>
  324. </tr>
  325. </table>
  326. </div> <!--.schedule_content -->
  327. </div> <!-- festival-event -->
  328. <?php
  329. }
  330. if (mysqli_num_rows($q_sch_next) > 0){
  331. $r_sch_next = mysqli_fetch_array($q_sch_next);
  332. ?>
  333. <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
  334. <h4><?=$lng['index_festivals_schedule_next']?></h4>
  335. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  336. <meta itemprop='name' content='<?=$r_sch_next['title']?>'/>
  337. <meta itemprop='startDate' content='<?=$r_sch_next['isostart']?>'/>
  338. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  339. <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
  340. </span>
  341. <?php
  342. if (strlen($r_sch_curr['isoend']) > 0){
  343. echo "<meta itemprop='endDate' content='$r_sch_next[isoend]'/>\n";
  344. }
  345. ?>
  346. <div class='schedule_content'>
  347. <span class='title'><?=$r_sch_next['title']?> - <?=$r_sch_next['st']?></span>
  348. <?php
  349. if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
  350. echo "<br/><p class='description'>$r_sch_next[description]</p>\n";
  351. echo "<meta itemprop='description' content='$r_sch_next[description]'/>\n";
  352. }
  353. ?>
  354. <table class='location'>
  355. <tr>
  356. <td>
  357. <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]?>'>
  358. <img alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
  359. </a>
  360. </td>
  361. <td>
  362. <?php
  363. //If name and address are the same, show only name
  364. if ($r_sch_next['place'] == $r_sch_next['address']){
  365. echo("$r_sch_next[place]\n");
  366. }
  367. else{
  368. echo("$r_sch_next[place] <br/><span class='address'> $r_sch_next[address]</span>\n");
  369. }
  370. ?>
  371. </td>
  372. </tr>
  373. </table>
  374. </div> <!--.schedule_content -->
  375. </div> <!-- festival-event -->
  376. <?php
  377. }
  378. ?>
  379. </div> <!--festivals_schedule-->
  380. <?php
  381. }
  382. ?>
  383. </div> <!-- festivals_schedule_cell -->
  384. </div> <!-- festivals_schedule_row -->
  385. </div> <!-- festivals_schedule_table -->
  386. <a class='go_to_section' href='<?=server?>/lablanca/'><?=$lng['index_festivals_link']?></a>
  387. <br/>
  388. </div> <!-- festivals - section-->
  389. <?php
  390. }
  391. //Upcaming activity section
  392. $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;");
  393. $upcoming_activity_shown = false;
  394. if (mysqli_num_rows($q_activity) > 0){
  395. $upcoming_activity_shown = true;
  396. $r_activity = mysqli_fetch_array($q_activity);
  397. ?>
  398. <div class='section'>
  399. <h3 class='section_title'><?=$lng['index_upcoming_activity']?></h3>
  400. <div class='entry' itemscope itemtype='http://schema.org/Event'>
  401. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  402. <meta itemprop='name' content='<?=$r_activity['title']?>'/>
  403. <meta itemprop='description' content='<?=$r_activity['text']?>'/>
  404. <meta itemprop='startDate endDate' content='<?=$r_activity['isodate']?>'/>
  405. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  406. <meta itemprop='address' itemprop='name' content='=<?=$r_activity[city]?>'/>
  407. </span>
  408. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
  409. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  410. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  411. <meta itemprop='name' content='Gasteizko Margolariak'/>
  412. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  413. <meta itemprop='foundingDate' content='2013-02-03'/>
  414. <meta itemprop='telephone' content='+34637140371'/>
  415. </div> <!-- .hidden -->
  416. <div id='upcoming_activity' class='table'>
  417. <div class='tr'>
  418. <?php
  419. //If image, show it
  420. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  421. if (mysqli_num_rows($q_activity_image) > 0){
  422. $r_activity_image = mysqli_fetch_array($q_activity_image);
  423. ?>
  424. <div class='td'>
  425. <div id='upcoming_image'>
  426. <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'>
  427. <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image['image']?>'/>
  428. <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image['image']?>' alt='<?=$r_activity['title']?>'/>
  429. </a>
  430. </div> <!-- #upcoming_image -->
  431. </div> <!-- .td-->
  432. <?php
  433. }
  434. ?>
  435. <div class='td'>
  436. <div id='upcoming_text'>
  437. <h3 class='entry_title'>
  438. <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$r_activity['title']?></a>
  439. </h3>
  440. <p class='mobile'><?=cutText($r_activity['text'], 250, $lng['index_read_more'], "$server/actividades/$r_activity[permalink]")?></p>
  441. <p class='desktop'><?=cutText($r_activity['text'], 450, $lng['index_read_more'], "$server/actividades/$r_activity[permalink]")?></p>
  442. </div> <!-- #upcoming_text -->
  443. </div> <!-- .td -->
  444. <div class='td'>
  445. <div id='upcoming_details'>
  446. <table>
  447. <tr>
  448. <td><?=$lng['index_upcoming_activity_date']?></td>
  449. <td><?=formatDate($r_activity['date'], $lang, false)?></td>
  450. </tr>
  451. <tr>
  452. <td><?=$lng['index_upcoming_activity_price']?></td>
  453. <?php
  454. if ($r_activity['price'] == 0){
  455. ?>
  456. <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  457. <?=$lng['index_upcoming_activity_free']?>
  458. <meta itemprop='priceCurrency' content='EUR'/>
  459. <meta itemprop='price' content='0'/>
  460. <meta itemprop='availability' content='Sold Out'/>
  461. <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
  462. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
  463. </td>
  464. </tr>
  465. <tr>
  466. <td><?=$lng['index_upcoming_activity_inscription']?>s</td>
  467. <?php
  468. if ($r_activity['inscription'] == 1){
  469. ?>
  470. <td><?=$lng['yes']?></td>
  471. <?php
  472. }
  473. else{
  474. ?>
  475. <td><?=$lng['no']?></td>
  476. <?php
  477. }
  478. }
  479. else{
  480. ?>
  481. <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  482. <?=$r_activity['price']?> €
  483. <meta itemprop='priceCurrency' content='EUR'/>
  484. <meta itemprop='availability' content='Sold Out'/>
  485. <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
  486. <meta itemprop='price' content='<?=$r_activity['price']?>'/>
  487. </td>
  488. <?php
  489. }
  490. ?>
  491. </tr>
  492. <?php
  493. if ($r_activity['max_people'] > 0){
  494. ?>
  495. <tr>
  496. <td><?=$lng['index_upcoming_activity_max_people']?></td>
  497. <td><?=$r_activity['max_people']?></td>
  498. </tr>
  499. <?php
  500. }
  501. ?>
  502. </table>
  503. <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$lng['index_upcoming_activity_see']?></a>
  504. <br/><br/>
  505. </div> <!-- #upcoming_details -->
  506. </div> <!-- .td -->
  507. </div> <!-- .tr -->
  508. </div> <!-- .table -->
  509. </div> <!-- .entry -->
  510. <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng['index_upcoming_activity_see_all']?></a>
  511. <br/>
  512. </div> <!-- .section -->
  513. <?php
  514. }
  515. ?>
  516. <div class='section' itemscope itemtype='http://schema.org/Organization'>
  517. <meta itemprop='url' content='<?=$server?>'/>
  518. <h3 class='section_title' itemprop='name'><?=$lng['index_us']?></h3>
  519. <div class='entry' id='us'>
  520. <p itemprop='description'><?=$lng['index_us_content']?></p>
  521. </div> <!-- .entry -->
  522. <a class='go_to_section' href='<?=$server?>/nosotros/'><?=$lng['index_us_more']?></a>
  523. </br>
  524. </div> <!-- .section -->
  525. <br/>
  526. <div id='content_table'>
  527. <div class='content_row'>
  528. <div class='content_cell' id='cell_posts'>
  529. <div class='section' id='latest_posts'>
  530. <h3 class='section_title'><?=$lng['index_latest_posts']?></h3>
  531. <?php
  532. $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;");
  533. if (mysqli_num_rows($q_post) == 0){
  534. ?>
  535. <div class='entry'>
  536. <h3 class='entry_title'><?=$lng['index_no_post']?></h3>
  537. </div>
  538. <?php
  539. }
  540. else{
  541. while ($r_post = mysqli_fetch_array($q_post)){
  542. ?>
  543. <div class='entry post' itemscope itemtype='http://schema.org/BlogPosting'>
  544. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  545. <meta itemprop='datePublished dateModified' content='<?=$r_post['isodate']?>'/>
  546. <meta itemprop='headline name' content='<?=$r_post['title']?>'/>
  547. <meta itemprop='articleBody text' content='<?=$r_post[text]?>'/>
  548. <meta itemprop='mainEntityOfPage' content='<?=$server?>'/>
  549. <div class='hidden' itemprop='author publisher' itemscope itemtype='http://schema.org/Organization'>
  550. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  551. <meta itemprop='name' content='Gasteizko Margolariak'/>
  552. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  553. <meta itemprop='foundingDate' content='03-02-2013'/>
  554. <meta itemprop='telephone' content='+34637140371'/>
  555. <meta itemprop='url' content='<?=$server?>'/>
  556. </div>
  557. <?php
  558. $q_post_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_post[id] ORDER BY idx LIMIT 1;");
  559. if (mysqli_num_rows($q_post_image) > 0){
  560. $r_post_image = mysqli_fetch_array($q_post_image);
  561. ?>
  562. <a href='<?=$server?>/blog/<?=$r_post['permalink']?>'>
  563. <img itemprop='image' src='<?=$server?>/img/blog/miniature/<?=$r_post_image['image']?>'/>
  564. </a>
  565. <?php
  566. } //if (mysqli_num_rows($q_post_image) > 0)
  567. ?>
  568. <h3 class='entry_title'>
  569. <a itemprop='url' href='<?=$server?>/blog/<?=$r_post['permalink']?>'><?=$r_post['title']?></a>
  570. </h3>
  571. <p class='mobile'><?=cutText($r_post['text'], 100, $lng['index_read_more'], "$server/blog/$r_post[permalink]")?></p>
  572. <p class='desktop'><?=cutText($r_post['text'], 150, $lng['index_read_more'], "$server/blog/$r_post[permalink]")?></p>
  573. <span><?=formatDate($r_post['dtime'], $lang, false)?></span>
  574. </div> <!-- .entry -->
  575. <?php
  576. } //while ($r_post = mysqli_fetch_array($q_post))
  577. ?>
  578. <a class='go_to_section' href='<?=$server?>/blog/'><?$lng['index_see_all_posts']?></a>
  579. <br/>
  580. <?php
  581. } //if (mysqli_num_rows($q_post) == 0) ELSE
  582. ?>
  583. </div> <!-- .section-->
  584. </div> <!-- .cell_posts-->
  585. <div class='content_cell' id='cell_photos'>
  586. <div class='section' id='latest_photos'>
  587. <h3 class='section_title'><?=$lng['index_latest_photos']?></h3>
  588. <?php
  589. $q_photos = mysqli_query($con, "SELECT id, file, title_$lang AS title, DATE_FORMAT(uploaded, '%Y-%m-%d') AS isodate FROM photo WHERE approved = 1 ORDER BY uploaded DESC LIMIT 6;");
  590. if (mysqli_num_rows($q_photos) == 0){
  591. ?>
  592. <div class='entry'><?=$lng['index_no_photos']?></div>
  593. <?php
  594. }
  595. else{
  596. ?>
  597. <div class='entry'>
  598. <table id='table_photos'>
  599. <tr>
  600. <?php
  601. $i = 0;
  602. while ($r_photos = mysqli_fetch_array($q_photos)){
  603. $q_album = mysqli_query($con, "select permalink from album, photo_album WHERE photo = $r_photos[id] AND id = album LIMIT 1;");
  604. $r_album = mysqli_fetch_array($q_album);
  605. ?>
  606. <td itemscope itemtype='http://schema.org/Photograph'>
  607. <meta itemprop='datePublished' content='<?=$r_photos['isodate']?>'/>
  608. <a href='$server/galeria/<?=$r_album['permalink']?>'>
  609. <meta itemprop='image' content='<?=$serve?>/img/galeria/<?=$r_photos['file']?>'/>
  610. <img src='<?=$server?>/img/galeria/miniature/<?=$r_photos['file']?>' alt='<?=$r_photos['title']?>' />
  611. </a>
  612. </td>
  613. <?php
  614. $i ++;
  615. if ($i % 2 == 0){
  616. ?>
  617. </tr>
  618. <tr>
  619. <?php
  620. } //if ($i % 2 == 0)
  621. } //while ($r_photos = mysqli_fetch_array($q_photos))
  622. ?>
  623. </tr>
  624. </table>
  625. </div> <!-- .entry -->
  626. <a class='go_to_section' href='<?=$server?>/galeria/'><?=$lng['index_see_all_photos']?></a>
  627. <br/>
  628. <?php
  629. } //if (mysqli_num_rows($q_photos) == 0) ELSE
  630. ?>
  631. </div> <!-- .section -->
  632. </div> <!-- .content_cell -->
  633. </div> <!-- .content_row -->
  634. </div> <!-- .table -->
  635. <?php
  636. if ($upcoming_activity_shown == false){
  637. $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;");
  638. if (mysqli_num_rows($q_activity) > 0){
  639. ?>
  640. <div class='section' id='latest_activities'>
  641. <h3 class='section_title'><?=$lng['index_latest_activities']?></h3>
  642. <?php
  643. while ($r_activity = mysqli_fetch_array($q_activity)){
  644. ?>
  645. <div class='entry' itemscope itemtype='http://schema.org/Event'>
  646. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  647. <meta itemprop='name' content='<?=$r_activity['title']?>'/>
  648. <meta itemprop='description' content='<?=$r_activity['text']?>'/>
  649. <meta itemprop='startDate endDate' content='<?=$r_activity['isodate']?>'/>
  650. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  651. <meta itemprop='address' itemprop='name' content='<?=$r_activity['city']?>'/>
  652. <meta itemprop='name' content='<?=$r_activity['city']?>'/>
  653. </span>
  654. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  655. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  656. <meta itemprop='name' content='Gasteizko Margolariak'/>
  657. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  658. <meta itemprop='foundingDate' content='03-02-2013'/>
  659. <meta itemprop='telephone' content='+34637140371'/>
  660. <meta itemprop='url' content='<?=$server?>'/>
  661. </div> <!-- .hidden -->
  662. <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  663. <meta itemprop='name' content='<?=$r_activity['title']?>'/>
  664. <meta itemprop='description' content='<?=$r_activity['text']?>'/>
  665. <meta itemprop='price' content='<?=$r_activity['price']?>'/>
  666. <meta itemprop='priceCurrency' content='EUR'/>
  667. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
  668. <meta itemprop='availability' content='Sold Out'/>
  669. <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
  670. </span>
  671. <h3 class='entry_title'>
  672. <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$r_activity['title']?></a>
  673. </h3>
  674. <table class='latest_activity'>
  675. <tr>
  676. <?php
  677. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  678. if (mysqli_num_rows($q_activity_image) > 0){
  679. $r_activity_image = mysqli_fetch_array($q_activity_image);
  680. ?>
  681. <td class='latest_activity_image'>
  682. <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'>
  683. <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image['image']?>'/>
  684. <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image['image']?>' alt='<?=$r_activity['title']?>'/>
  685. </a>
  686. </td>
  687. <?php
  688. } // if (mysqli_num_rows($q_activity_image) > 0)
  689. if ($r_activity['after'] == ''){
  690. ?>
  691. <td class='mobile latest_activity_text'>
  692. <?=cutText($r_activity['text'], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  693. </td>
  694. <td class='desktop latest_activity_text'>
  695. <?=cutText($r_activity['text'], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  696. </td>
  697. <?php
  698. } // if ($r_activity['after'] == '')
  699. else{
  700. ?>
  701. <td class='mobile latest_activity_text'>
  702. <?=cutText($r_activity['after'], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  703. </td>
  704. <td class='desktop latest_activity_text'>
  705. <?=cutText($r_activity['after'], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  706. </td>
  707. <?php
  708. } // if ($r_activity['after'] == '') ELSE
  709. ?>
  710. </tr>
  711. </table>
  712. </div> <!-- .entry -->
  713. <?php
  714. }
  715. ?>
  716. <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng['index_upcoming_activity_see_all']?></a>
  717. <br/>
  718. </div> <!-- .section -->
  719. <?php
  720. } // if (mysqli_num_rows($q_activity) > 0)
  721. } // if ($upcoming_activity_shown == false)
  722. //Festivals section (if no festivals shown on top)
  723. if ($festivals == 0){
  724. ?>
  725. <div class='section'>
  726. <h3 class='section_title'><?=$lng['index_festivals_header']?></h3>
  727. <div class='entry'>
  728. <span class='desktop'>
  729. <?=cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 300, $lng['index_read_more'], "$server/lablanca/")?>
  730. </span>
  731. <span class='desktop'>
  732. <?=cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 200, $lng['index_read_more'], "$server/lablanca/")?>
  733. </span>
  734. </div> <!-- .entry -->
  735. </div> <!-- .section -->
  736. <?php
  737. } // if ($festivals == 0)
  738. ?>
  739. </div> <!-- #content -->
  740. <?php
  741. //Footer
  742. include("footer.php");
  743. $ad = ad($con, $lang, $lng);
  744. stats($ad, $ad_static, "index", "");
  745. ?>
  746. </body>
  747. </html>