index.php 49 KB

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