"> "/> "/> "/> "/> "/> "/> "/>
\n"; echo "

$lng[index_festivals_header] $year

\n"; echo "\n"; //Summary $q_festivals = mysqli_query($con, "SELECT text_$lang AS text, summary_$lang AS summary, img FROM festival WHERE year = $year;"); if(mysqli_num_rows($q_festivals)){ echo "\n"; } //Location $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;"); if (mysqli_num_rows($q_location) > 0){ $r_location = mysqli_fetch_array($q_location); echo "
\n"; $r_festivals = mysqli_fetch_array($q_festivals); if ($r_festivals['img'] != ''){ echo " \n"; } if ($r_festivals['summary'] != ''){ echo "
$r_festivals[summary]
\n"; echo "


      $lng[index_festivals_link]\n"; } else{ echo "
" . cutText($r_festivals['text'], 300, "$lng[index_read_more]", "http://$http_host/lablanca/") . "
\n"; echo "


      $lng[index_festivals_link]\n"; } echo "
\n"; echo "

$lng[index_festivals_location]

\n"; echo "\n"; echo "
\n"; } echo "
\n"; echo "\n"; //GM schedule $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, 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;"); $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, 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;"); if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){ echo "
\n"; echo "

$lng[index_festivals_gm_schedule]

\n"; if (mysqli_num_rows($q_sch_curr) > 0){ $r_sch_curr = mysqli_fetch_array($q_sch_curr); echo "

$lng[index_festivals_schedule_now]

\n"; echo "$r_sch_curr[title]\n"; if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){ echo "
$r_sch_curr[description]\n"; } echo "\n"; echo "\n"; //If name and address are the same, show only name if ($r_sch_curr['place'] == $r_sch_curr['address']){ echo "
 $r_sch_curr[place]
\n"; } else{ echo "
$r_sch_curr[place] - $r_sch_curr[address]
\n"; } echo ""; } if (mysqli_num_rows($q_sch_next) > 0){ $r_sch_next = mysqli_fetch_array($q_sch_next); echo "

$lng[index_festivals_schedule_next]

\n"; echo "$r_sch_next[title] - $r_sch_next[st]\n"; if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){ echo "
$r_sch_next[description]\n"; } echo "\n"; echo "\n"; //If name and address are the same, show only name if ($r_sch_next['place'] == $r_sch_next['address']){ echo "
 $r_sch_next[place]
\n"; } else{ echo "$r_sch_next[place] - $r_sch_next[address]\n"; } echo ""; } echo "
\n"; //close gm schedule entry; } //city schedule $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, 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;"); $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, 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;"); //echo "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, 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 30 MINUTE AND start < NOW() + INTERVAL 120000 MINUTE ORDER BY start LIMIT 2;"; if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){ echo "
\n"; echo "

$lng[index_festivals_city_schedule]

\n"; if (mysqli_num_rows($q_sch_curr) > 0){ $r_sch_curr = mysqli_fetch_array($q_sch_curr); echo "

$lng[index_festivals_schedule_now]

\n"; echo "$r_sch_curr[title]\n"; if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){ echo "
$r_sch_curr[description]\n"; } echo "\n"; echo "\n"; //If name and address are the same, show only name if ($r_sch_curr['place'] == $r_sch_curr['address']){ echo "
 $r_sch_curr[place]
\n"; } else{ echo "$r_sch_curr[place] - $r_sch_curr[address]\n"; } echo ""; } if (mysqli_num_rows($q_sch_next) > 0){ $r_sch_next = mysqli_fetch_array($q_sch_next); echo "

$lng[index_festivals_schedule_next]

\n"; echo "$r_sch_next[title] - ($r_sch_next[st])\n"; if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){ echo "
$r_sch_next[description]\n"; } echo "\n"; echo "\n"; //If name and address are the same, show only name if ($r_sch_next['place'] == $r_sch_next['address']){ echo "
 $r_sch_next[place]
\n"; } else{ echo "$r_sch_next[place] - $r_sch_next[address]\n"; } echo ""; } echo "
\n"; //close city schedule entry; } echo "\n"; echo "
\n"; } //Upcaming activity section $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;"); $upcoming_activity_shown = false; if (mysqli_num_rows($q_activity) > 0){ $upcoming_activity_shown = true; $r_activity = mysqli_fetch_array($q_activity); echo "
\n"; echo "

$lng[index_upcoming_activity]

\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; //If image, show it $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;"); if (mysqli_num_rows($q_activity_image) > 0){ $r_activity_image = mysqli_fetch_array($q_activity_image); echo "
\n"; echo "\n"; echo "\n"; echo "$r_activity[title]\n"; echo "\n"; echo "
\n"; } echo "
\n"; echo "

\n"; echo "

". cutText($r_activity['text'], 250, "$lng[index_read_more]", "http://$http_host/actividades/$r_activity[permalink]") . "

\n"; echo "
\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; if ($r_activity['price'] == 0){ echo "\n"; echo "\n"; echo ""; if ($r_activity['inscription'] == 1) echo "\n"; else echo "\n"; } else{ echo "\n"; } echo "\n"; if ($r_activity['max_people'] > 0){ echo "\n"; } echo "
\n"; echo "$lng[index_upcoming_activity_date]" . formatDate($r_activity['date'], $lang, false) . "\n"; echo "
$lng[index_upcoming_activity_price]$lng[index_upcoming_activity_free]\n"; echo "
$lng[index_upcoming_activity_inscription]$lng[yes]$lng[no]$r_activity[price] €\n"; echo "
$lng[index_upcoming_activity_max_people]$r_activity[max_people]
\n"; echo "$lng[index_upcoming_activity_see]
\n"; echo "$lng[index_upcoming_activity_see_all]\n"; echo "
\n"; echo "
\n";//Entry echo "
\n";//Section } ?>
$lng[index_latest_posts]\n"; $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;"); if (mysqli_num_rows($q_post) == 0){ echo "
$lng[index_no_post]
\n"; } else{ while ($r_post = mysqli_fetch_array($q_post)){ echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $q_post_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_post[id] ORDER BY idx LIMIT 1;"); if (mysqli_num_rows($q_post_image) > 0){ $r_post_image = mysqli_fetch_array($q_post_image); echo "\n"; echo "\n"; } echo "

\n"; echo "

". cutText($r_post['text'], 100, "$lng[index_read_more]", "http://$http_host/blog/$r_post[permalink]") . "

\n"; echo "" . formatDate($r_post['dtime'], $lang, false) . "\n"; echo "
\n"; } echo "$lng[index_see_all_posts]
\n"; } ?>
$lng[index_latest_photos]\n"; $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;"); //TODO WHERE approved = 1 if (mysqli_num_rows($q_photos) == 0){ echo "
$lng[index_no_photos]
\n"; } else{ echo "
\n"; echo "\n"; echo "\n"; $i = 0; while ($r_photos = mysqli_fetch_array($q_photos)){ $q_album = mysqli_query($con, "select permalink from album, photo_album WHERE photo = $r_photos[id] AND id = album LIMIT 1;"); $r_album = mysqli_fetch_array($q_album); echo "\n"; $i ++; if ($i % 2 == 0) echo ""; } echo "\n"; echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "$r_photos[title]
\n"; echo "
\n"; echo "$lng[index_see_all_photos]
\n"; } ?>
0){ echo "
\n"; echo "

$lng[index_latest_activities]

\n"; while ($r_activity = mysqli_fetch_array($q_activity)){ echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "

\n"; echo "\n"; $q_activity_image = mysqli_query($con, "SELECT image FROM activity_image WHERE activity = $r_activity[id] ORDER BY idx LIMIT 1;"); if (mysqli_num_rows($q_activity_image) > 0){ $r_activity_image = mysqli_fetch_array($q_activity_image); echo "\n"; } //echo "
\n"; //echo "

". cutText($r_activity['text'], 300, "$lng[index_read_more]", "http://$http_host/actividades/$r_activity[permalink]") . "

\n"; if ($r_activity['after'] == ''){ echo "
\n"; } else{ echo "\n"; } echo "
\n"; echo "\n"; echo "$r_activity[title]\n"; echo "" . cutText($r_activity['text'], 300, "$lng[index_read_more]", "http://$http_host/actividades/$r_activity[permalink]") . "" . cutText($r_activity['after'], 300, "$lng[index_read_more]", "http://$http_host/actividades/$r_activity[permalink]") . "
\n"; //echo "
\n"; //echo "
\n"; echo "
\n"; } echo "$lng[index_upcoming_activity_see_all]
\n"; echo "
"; } } ?>