index.php 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  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 >= date(now()) ORDER BY date LIMIT 2;");
  393. $upcoming_activity_shown = false;
  394. if (mysqli_num_rows($q_activity) > 0){
  395. $upcoming_activity_shown = true;
  396. ?>
  397. <div class='section'>
  398. <h3 class='section_title'><?=$lng['index_upcoming_activity']?></h3>
  399. <?php
  400. while($r_activity = mysqli_fetch_array($q_activity)){
  401. ?>
  402. <div class='entry' itemscope itemtype='http://schema.org/Event'>
  403. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  404. <meta itemprop='name' content='<?=$r_activity['title']?>'/>
  405. <meta itemprop='description' content='<?=$r_activity['text']?>'/>
  406. <meta itemprop='startDate endDate' content='<?=$r_activity['isodate']?>'/>
  407. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  408. <meta itemprop='address' itemprop='name' content='=<?=$r_activity[city]?>'/>
  409. </span>
  410. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
  411. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  412. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  413. <meta itemprop='name' content='Gasteizko Margolariak'/>
  414. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  415. <meta itemprop='foundingDate' content='2013-02-03'/>
  416. <meta itemprop='telephone' content='+34637140371'/>
  417. </div> <!-- .hidden -->
  418. <div id='upcoming_activity' class='table'>
  419. <div class='tr'>
  420. <?php
  421. //If image, show it
  422. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  423. if (mysqli_num_rows($q_activity_image) > 0){
  424. $r_activity_image = mysqli_fetch_array($q_activity_image);
  425. ?>
  426. <div class='td'>
  427. <div id='upcoming_image'>
  428. <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'>
  429. <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image['image']?>'/>
  430. <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image['image']?>' alt='<?=$r_activity['title']?>'/>
  431. </a>
  432. </div> <!-- #upcoming_image -->
  433. </div> <!-- .td-->
  434. <?php
  435. }
  436. ?>
  437. <div class='td'>
  438. <div id='upcoming_text'>
  439. <h3 class='entry_title'>
  440. <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$r_activity['title']?></a>
  441. </h3>
  442. <p class='mobile'><?=cutText($r_activity['text'], 250, $lng['index_read_more'], "$server/actividades/$r_activity[permalink]")?></p>
  443. <p class='desktop'><?=cutText($r_activity['text'], 450, $lng['index_read_more'], "$server/actividades/$r_activity[permalink]")?></p>
  444. </div> <!-- #upcoming_text -->
  445. </div> <!-- .td -->
  446. <div class='td'>
  447. <div id='upcoming_details'>
  448. <table>
  449. <tr>
  450. <td><?=$lng['index_upcoming_activity_date']?></td>
  451. <td><?=formatDate($r_activity['date'], $lang, false)?></td>
  452. </tr>
  453. <tr>
  454. <td><?=$lng['index_upcoming_activity_price']?></td>
  455. <?php
  456. if ($r_activity['price'] == 0){
  457. ?>
  458. <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  459. <?=$lng['index_upcoming_activity_free']?>
  460. <meta itemprop='priceCurrency' content='EUR'/>
  461. <meta itemprop='price' content='0'/>
  462. <meta itemprop='availability' content='Sold Out'/>
  463. <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
  464. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
  465. </td>
  466. </tr>
  467. <tr>
  468. <td><?=$lng['index_upcoming_activity_inscription']?></td>
  469. <?php
  470. if ($r_activity['inscription'] == 1){
  471. ?>
  472. <td><?=$lng['yes']?></td>
  473. <?php
  474. }
  475. else{
  476. ?>
  477. <td><?=$lng['no']?></td>
  478. <?php
  479. }
  480. }
  481. else{
  482. ?>
  483. <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  484. <?=$r_activity['price']?> €
  485. <meta itemprop='priceCurrency' content='EUR'/>
  486. <meta itemprop='availability' content='Sold Out'/>
  487. <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
  488. <meta itemprop='price' content='<?=$r_activity['price']?>'/>
  489. </td>
  490. <?php
  491. }
  492. ?>
  493. </tr>
  494. <?php
  495. if ($r_activity['max_people'] > 0){
  496. ?>
  497. <tr>
  498. <td><?=$lng['index_upcoming_activity_max_people']?></td>
  499. <td><?=$r_activity['max_people']?></td>
  500. </tr>
  501. <?php
  502. }
  503. ?>
  504. </table>
  505. <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$lng['index_upcoming_activity_see']?></a>
  506. <br/><br/>
  507. </div> <!-- #upcoming_details -->
  508. </div> <!-- .td -->
  509. </div> <!-- .tr -->
  510. </div> <!-- .table -->
  511. </div> <!-- .entry -->
  512. <?php
  513. } // while($r_activity = mysqli_fetch_array($q_activity))
  514. ?>
  515. <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng['index_upcoming_activity_see_all']?></a>
  516. <br/>
  517. </div> <!-- .section -->
  518. <?php
  519. }
  520. ?>
  521. <div class='section' itemscope itemtype='http://schema.org/Organization'>
  522. <meta itemprop='url' content='<?=$server?>'/>
  523. <h3 class='section_title' itemprop='name'><?=$lng['index_us']?></h3>
  524. <div class='entry' id='us'>
  525. <p itemprop='description'><?=$lng['index_us_content']?></p>
  526. </div> <!-- .entry -->
  527. <a class='go_to_section' href='<?=$server?>/nosotros/'><?=$lng['index_us_more']?></a>
  528. </br>
  529. </div> <!-- .section -->
  530. <br/>
  531. <div id='content_table'>
  532. <div class='content_row'>
  533. <div class='content_cell' id='cell_posts'>
  534. <div class='section' id='latest_posts'>
  535. <h3 class='section_title'><?=$lng['index_latest_posts']?></h3>
  536. <?php
  537. $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;");
  538. if (mysqli_num_rows($q_post) == 0){
  539. ?>
  540. <div class='entry'>
  541. <h3 class='entry_title'><?=$lng['index_no_post']?></h3>
  542. </div>
  543. <?php
  544. }
  545. else{
  546. while ($r_post = mysqli_fetch_array($q_post)){
  547. ?>
  548. <div class='entry post' itemscope itemtype='http://schema.org/BlogPosting'>
  549. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  550. <meta itemprop='datePublished dateModified' content='<?=$r_post['isodate']?>'/>
  551. <meta itemprop='headline name' content='<?=$r_post['title']?>'/>
  552. <meta itemprop='articleBody text' content='<?=$r_post[text]?>'/>
  553. <meta itemprop='mainEntityOfPage' content='<?=$server?>'/>
  554. <div class='hidden' itemprop='author publisher' itemscope itemtype='http://schema.org/Organization'>
  555. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  556. <meta itemprop='name' content='Gasteizko Margolariak'/>
  557. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  558. <meta itemprop='foundingDate' content='03-02-2013'/>
  559. <meta itemprop='telephone' content='+34637140371'/>
  560. <meta itemprop='url' content='<?=$server?>'/>
  561. </div>
  562. <?php
  563. $q_post_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_post[id] ORDER BY idx LIMIT 1;");
  564. if (mysqli_num_rows($q_post_image) > 0){
  565. $r_post_image = mysqli_fetch_array($q_post_image);
  566. ?>
  567. <a href='<?=$server?>/blog/<?=$r_post['permalink']?>'>
  568. <img itemprop='image' src='<?=$server?>/img/blog/miniature/<?=$r_post_image['image']?>'/>
  569. </a>
  570. <?php
  571. } //if (mysqli_num_rows($q_post_image) > 0)
  572. ?>
  573. <h3 class='entry_title'>
  574. <a itemprop='url' href='<?=$server?>/blog/<?=$r_post['permalink']?>'><?=$r_post['title']?></a>
  575. </h3>
  576. <p class='mobile'><?=cutText($r_post['text'], 100, $lng['index_read_more'], "$server/blog/$r_post[permalink]")?></p>
  577. <p class='desktop'><?=cutText($r_post['text'], 150, $lng['index_read_more'], "$server/blog/$r_post[permalink]")?></p>
  578. <span><?=formatDate($r_post['dtime'], $lang, false)?></span>
  579. </div> <!-- .entry -->
  580. <?php
  581. } //while ($r_post = mysqli_fetch_array($q_post))
  582. ?>
  583. <a class='go_to_section' href='<?=$server?>/blog/'><?$lng['index_see_all_posts']?></a>
  584. <br/>
  585. <?php
  586. } //if (mysqli_num_rows($q_post) == 0) ELSE
  587. ?>
  588. </div> <!-- .section-->
  589. </div> <!-- .cell_posts-->
  590. <div class='content_cell' id='cell_photos'>
  591. <div class='section' id='latest_photos'>
  592. <h3 class='section_title'><?=$lng['index_latest_photos']?></h3>
  593. <?php
  594. $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;");
  595. if (mysqli_num_rows($q_photos) == 0){
  596. ?>
  597. <div class='entry'><?=$lng['index_no_photos']?></div>
  598. <?php
  599. }
  600. else{
  601. ?>
  602. <div class='entry'>
  603. <table id='table_photos'>
  604. <tr>
  605. <?php
  606. $i = 0;
  607. while ($r_photos = mysqli_fetch_array($q_photos)){
  608. $q_album = mysqli_query($con, "select permalink from album, photo_album WHERE photo = $r_photos[id] AND id = album LIMIT 1;");
  609. $r_album = mysqli_fetch_array($q_album);
  610. ?>
  611. <td itemscope itemtype='http://schema.org/Photograph'>
  612. <meta itemprop='datePublished' content='<?=$r_photos['isodate']?>'/>
  613. <a href='$server/galeria/<?=$r_album['permalink']?>'>
  614. <meta itemprop='image' content='<?=$serve?>/img/galeria/<?=$r_photos['file']?>'/>
  615. <img src='<?=$server?>/img/galeria/miniature/<?=$r_photos['file']?>' alt='<?=$r_photos['title']?>' />
  616. </a>
  617. </td>
  618. <?php
  619. $i ++;
  620. if ($i % 2 == 0){
  621. ?>
  622. </tr>
  623. <tr>
  624. <?php
  625. } //if ($i % 2 == 0)
  626. } //while ($r_photos = mysqli_fetch_array($q_photos))
  627. ?>
  628. </tr>
  629. </table>
  630. </div> <!-- .entry -->
  631. <a class='go_to_section' href='<?=$server?>/galeria/'><?=$lng['index_see_all_photos']?></a>
  632. <br/>
  633. <?php
  634. } //if (mysqli_num_rows($q_photos) == 0) ELSE
  635. ?>
  636. </div> <!-- .section -->
  637. </div> <!-- .content_cell -->
  638. </div> <!-- .content_row -->
  639. </div> <!-- .table -->
  640. <?php
  641. if ($upcoming_activity_shown == false){
  642. $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;");
  643. if (mysqli_num_rows($q_activity) > 0){
  644. ?>
  645. <div class='section' id='latest_activities'>
  646. <h3 class='section_title'><?=$lng['index_latest_activities']?></h3>
  647. <?php
  648. while ($r_activity = mysqli_fetch_array($q_activity)){
  649. ?>
  650. <div class='entry' itemscope itemtype='http://schema.org/Event'>
  651. <meta itemprop='inLanguage' content='<?=$lang?>'/>
  652. <meta itemprop='name' content='<?=$r_activity['title']?>'/>
  653. <meta itemprop='description' content='<?=$r_activity['text']?>'/>
  654. <meta itemprop='startDate endDate' content='<?=$r_activity['isodate']?>'/>
  655. <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
  656. <meta itemprop='address' itemprop='name' content='<?=$r_activity['city']?>'/>
  657. <meta itemprop='name' content='<?=$r_activity['city']?>'/>
  658. </span>
  659. <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
  660. <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
  661. <meta itemprop='name' content='Gasteizko Margolariak'/>
  662. <meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
  663. <meta itemprop='foundingDate' content='03-02-2013'/>
  664. <meta itemprop='telephone' content='+34637140371'/>
  665. <meta itemprop='url' content='<?=$server?>'/>
  666. </div> <!-- .hidden -->
  667. <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
  668. <meta itemprop='name' content='<?=$r_activity['title']?>'/>
  669. <meta itemprop='description' content='<?=$r_activity['text']?>'/>
  670. <meta itemprop='price' content='<?=$r_activity['price']?>'/>
  671. <meta itemprop='priceCurrency' content='EUR'/>
  672. <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
  673. <meta itemprop='availability' content='Sold Out'/>
  674. <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
  675. </span>
  676. <h3 class='entry_title'>
  677. <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$r_activity['title']?></a>
  678. </h3>
  679. <table class='latest_activity'>
  680. <tr>
  681. <?php
  682. $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;");
  683. if (mysqli_num_rows($q_activity_image) > 0){
  684. $r_activity_image = mysqli_fetch_array($q_activity_image);
  685. ?>
  686. <td class='latest_activity_image'>
  687. <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'>
  688. <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image['image']?>'/>
  689. <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image['image']?>' alt='<?=$r_activity['title']?>'/>
  690. </a>
  691. </td>
  692. <?php
  693. } // if (mysqli_num_rows($q_activity_image) > 0)
  694. if ($r_activity['after'] == ''){
  695. ?>
  696. <td class='mobile latest_activity_text'>
  697. <?=cutText($r_activity['text'], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  698. </td>
  699. <td class='desktop latest_activity_text'>
  700. <?=cutText($r_activity['text'], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  701. </td>
  702. <?php
  703. } // if ($r_activity['after'] == '')
  704. else{
  705. ?>
  706. <td class='mobile latest_activity_text'>
  707. <?=cutText($r_activity['after'], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  708. </td>
  709. <td class='desktop latest_activity_text'>
  710. <?=cutText($r_activity['after'], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
  711. </td>
  712. <?php
  713. } // if ($r_activity['after'] == '') ELSE
  714. ?>
  715. </tr>
  716. </table>
  717. </div> <!-- .entry -->
  718. <?php
  719. }
  720. ?>
  721. <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng['index_upcoming_activity_see_all']?></a>
  722. <br/>
  723. </div> <!-- .section -->
  724. <?php
  725. } // if (mysqli_num_rows($q_activity) > 0)
  726. } // if ($upcoming_activity_shown == false)
  727. //Festivals section (if no festivals shown on top)
  728. if ($festivals == 0){
  729. ?>
  730. <div class='section'>
  731. <h3 class='section_title'><?=$lng['index_festivals_header']?></h3>
  732. <div class='entry'>
  733. <span class='desktop'>
  734. <?=cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 300, $lng['index_read_more'], "$server/lablanca/")?>
  735. </span>
  736. <span class='desktop'>
  737. <?=cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 200, $lng['index_read_more'], "$server/lablanca/")?>
  738. </span>
  739. </div> <!-- .entry -->
  740. </div> <!-- .section -->
  741. <?php
  742. } // if ($festivals == 0)
  743. ?>
  744. </div> <!-- #content -->
  745. <?php
  746. //Footer
  747. include("footer.php");
  748. $ad = ad($con, $lang, $lng);
  749. stats($ad, $ad_static, "index", "");
  750. ?>
  751. </body>
  752. </html>