index.php 43 KB

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