-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from netwerk-digitaal-erfgoed/feat-newest-data…
…sets Feature recently added datasetdescriptions
- Loading branch information
Showing
7 changed files
with
155 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
include("includes/search.php"); | ||
include("includes/language.php"); | ||
|
||
header('Content-Type: application/rss+xml; charset=utf-8'); | ||
echo "<"."?xml version=\"1.0\" encoding='UTF-8'?".">\n"; | ||
|
||
echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">'; | ||
echo '<channel>'; | ||
echo '<title>'.t('Datasetregister').'</title>'; | ||
echo '<link>https://'.$_SERVER['HTTP_HOST'].'/</link>'; | ||
echo '<language>'; | ||
if(isset($_GET["lang"]) && $_GET["lang"]=="en") { echo "en"; } else { echo "nl"; } | ||
echo '</language>'; | ||
echo '<description>'.t('De meest recent toegevoegde datasets aan het NDE Datasetregister').'</description>'; | ||
echo '<pubDate>'.date("r").'</pubDate>'."\n"; | ||
echo '<image>'."\n"; | ||
echo '<url>https://'.$_SERVER['HTTP_HOST'].'/assets/beeldmerk-social-small.jpg</url>'."\n"; | ||
echo '<title>'.t('Datasetregister').'</title>'."\n"; | ||
echo '<link>https://'.$_SERVER['HTTP_HOST'].'/</link>'."\n"; | ||
echo '</image>'."\n"; | ||
echo '<atom:link href="https://'.$_SERVER['HTTP_HOST'].'/dataset-newest-rss.php" rel="self" type="application/rss+xml" />'."\n"; | ||
|
||
$newests=getNewest(); | ||
|
||
foreach($newests as $newest) { | ||
print '<item>'; | ||
print '<title>'.$newest["title"].' ('.$newest["publisherName"].')</title>'; | ||
$url='https://'.$_SERVER['HTTP_HOST'].'/show.php?'; | ||
if(isset($_GET["lang"]) && $_GET["lang"]=="en") { $url.='lang=en&'; } | ||
$url.='uri='.urlencode($newest["dataset"]); | ||
print '<link>'.$url.'</link>'; | ||
print '<guid>'.$url.'</guid>'; | ||
print '<pubDate>'.date('r', strtotime($newest["postedDate"])).'</pubDate>'; | ||
print '</item>'; | ||
} | ||
|
||
echo '</channel>'; | ||
echo '</rss>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
include("includes/search.php"); | ||
include("includes/header.php"); | ||
|
||
?> | ||
|
||
<main> | ||
<section class="text m-t-space m-b-space m-theme--blue"> | ||
<div class="o-container o-container__small m-t-space"> | ||
<h1 class="title--l"><?= t('Recent aangemelde databeschrijvingen') ?></h1> | ||
<p><?= t('Onderstaande lijst toont de').' '.SHOW_NEWEST.t('meest recent aangemelde datasetbeschrijvingen via de <a href="viaurl.php">Meld aan</a> pagina of de <a href="https://datasetregister.netwerkdigitaalerfgoed.nl/api/static/index.html">Dataset Register API</a>.') ?> <?= t('Deze lijst is ook beschikbaar als <a href="dataset-newest-rss.php">RSS feed</a>.') ?></p> | ||
<p><br></p> | ||
<ul id="newest_list"></ul> | ||
</div> | ||
</section> | ||
|
||
<section class="text m-t-space m-b-space"> | ||
<div class="o-container o-container__small m-t-space"> | ||
<a href="search.php<?= l() ?>"><span class="btn btn--arrow m-t-half-space"><?= t('Doorzoek het Dataset Register') ?> <svg class="rect"> <rect class="svgrect" width="100%" height="100%" style="stroke-width: 3; fill: transparent; stroke-dasharray: 578; stroke-dashoffset: 578;"></rect> </svg> <svg class="icon icon-arrow-right"> <use xlink:href="#icon-arrow-right"></use> </svg> </span></a> | ||
</div> | ||
</section> | ||
</main> | ||
<script> | ||
|
||
async function fetchData(url) { | ||
try { | ||
const response = await fetch(url); | ||
const jsonData = await response.json(); | ||
return jsonData; | ||
} catch (error) { | ||
console.error('Error fetching data:', error); | ||
} | ||
} | ||
|
||
fetchData('get-list.php?list=newest').then(data => { | ||
const ul = document.getElementById("newest_list"); | ||
ul.innerHTML = ""; | ||
|
||
for (const key in data) { | ||
const li = document.createElement('li'); | ||
li.setAttribute("class", "linkprop"); | ||
var link = document.createElement("a"); | ||
var linkText = document.createTextNode(data[key].title); | ||
link.setAttribute("href", "show.php?<?php if(isset($_GET["lang"]) && $_GET["lang"]=="en") { echo "lang=en&"; } ?>uri="+encodeURIComponent(data[key].dataset)); | ||
link.setAttribute("title", "<?= t('Aangemeld op') ?> "+data[key].postedDate.substr(8,2)+"-"+data[key].postedDate.substr(5,2)+"-"+data[key].postedDate.substr(0,4)+" ("+data[key].postedDate.substr(11,5)+")"); | ||
link.appendChild(linkText); | ||
li.appendChild(link); | ||
li.appendChild(document.createTextNode(" ("+data[key].publisherName+")")); | ||
ul.appendChild(li); | ||
} | ||
}); | ||
|
||
</script> | ||
<?php include("includes/footer.php") ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters