-
Notifications
You must be signed in to change notification settings - Fork 4
/
page-land-portal.php
29 lines (24 loc) · 1.12 KB
/
page-land-portal.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
/*
Template Name: More on the land portal
*/
?>
<?php get_header(); ?>
<?php if(have_posts()) : the_post(); ?>
<div class="container">
<li class="widget">
<?php
$current_country = odm_country_manager()->get_current_country();
$country_codes = odm_country_manager()->get_country_codes()[$current_country];
if ($current_country == "mekong"):
$filter = 'VALUES ?country { <http://data.landportal.info/geo/KHM> <http://data.landportal.info/geo/LAO> <http://data.landportal.info/geo/MMR> <http://data.landportal.info/geo/THA> <http://data.landportal.info/geo/VNM> }';
else:
$filter = 'VALUES ?country { <http://data.landportal.info/geo/' . strtoupper($country_codes["iso3"]) . '>}';
endif;
$query = 'SELECT DISTINCT ?llr ?llrLabel WHERE { ?llr a dct:BibliographicResource ; dct:title ?llrLabel ; dct:spatial ?country . ' . $filter .' ?country rdfs:label ?countryLabel OPTIONAL { ?llr dct:issued ?date . } } ORDER BY DESC(?date)';
echo do_shortcode("[wpsparql_query_endpoint query='" . $query . "']");
?>
</li>
<?php endif; ?>
</div>
<?php get_footer(); ?>