media fonctionnel

feature/merging_branch
maxime.point2 1 year ago
parent d936c114d5
commit 577a552a71

@ -35,12 +35,16 @@ class Parser
$guid = $item->getElementsByTagName('guid')[0]->nodeValue;
$link = $item->getElementsByTagName('link')[0]->nodeValue;
$description = $item->getElementsByTagName('description')[0]->nodeValue;
$media = $item->getElementsByTagName('media:content');
$mediaUrl = null;
if ($media->length > 0) {
$mediaUrl = $media->item(0)->getAttribute('url');
$mediaElements = $item->getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'content');
// Vérifier si un élément media:content existe
if ($mediaElements->length > 0) {
$media = $mediaElements->item(0);
$mediaUrl = $media->getAttribute('url');
}
var_dump($mediaUrl);
$dateTime = new DateTime($date);
$tabArticle[] = new Article(

@ -8,6 +8,7 @@
{% for article in dVue.data %}
<p>
{{article.dateStr()}}
<img src="{{ article.getMediaContent }}"/>
<a href="{{ article.getLink() }}" target="_blank">{{ article.getTitle() }}</a>
{{ article.getDescription() }}
</p>
@ -16,7 +17,7 @@
// Actualiser la page toutes les 5 secondes
setTimeout(function(){
location.reload();
}, 5000);
}, 50000);
</script>
{% if not isAdmin %}
<a href="/~mapoint2/SAE/Php_RSS/fluxRSS/admin/connection">Connect</a>

@ -12,6 +12,7 @@
{% for article in dVue.data %}
<p>
{{article.dateStr()}}
<img src="{{ article.getMediaContent }}"/>
<a href="{{ article.getLink() }}" target="_blank">{{ article.getTitle() }}</a>
{{ article.getDescription() }}
</p>
@ -20,7 +21,7 @@
// Actualiser la page toutes les 5 secondes
setTimeout(function(){
location.reload();
}, 5000);
}, 50000);
</script>
<a href="/~mapoint2/SAE/Php_RSS/fluxRSS/admin/listFlux">Vue flux</a>
<a href="/~mapoint2/SAE/Php_RSS/fluxRSS/admin/deconnection">Déconnection</a>

Loading…
Cancel
Save