{source}<?php
defined('_JEXEC') or die;
$json_url = 'https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJcTdujh2MsUcRxgSBd-U2GPE&&key=AIzaSyCSBSnHCEExNXdUuFxP8iySEds98mCDh-4&language=de';
$json_content = file_get_contents($json_url);
$json_data = json_decode($json_content, true);
arsort($json_data);
if (isset($json_data)) {$reviews = $json_data['result']['reviews'];
$total_reviews = count($reviews);
echo '<style>
.review {
background-color: #00264c;
width: 80%;
margin-left: auto;
margin-right: auto;
margin-bottom: 20px;
padding: 15px;
box-shadow: 1px 1px 6px 5px rgba(0,17,35,0.75);
border-radius: 10px;
border: #fff solid 1px;
color: #fff;
font-family: Arial, sans-serif;
}
.review p {
margin: 5px 0;
}
.review .author {
font-weight: bold;
color: #ccc;
}
.review .date {
color: #ccc;
font-size: 0.9em;
}
.review .rating {
color: #ccc;
font-size: 1.2em;
}
</style>';
for ($i = 0; $i < $total_reviews; $i++) {
$timestamp = $reviews[$i]['time'];
$date = date("d.m.y", $timestamp);
$author_name = $reviews[$i]['author_name'];
$author_name_sep = explode(" ", $author_name);
$rating = $reviews[$i]['rating'];
$text = $reviews[$i]['text'];
echo '<div class="review">';
echo '<p class="author">' . $author_name_sep[0] . '</p>';
echo '<p class="date">schrieb am: ' . $date . '</p>';
echo '<p class="rating">Bewertung: ' . str_repeat('⭐', $rating) . '</p>';
echo '<p>' . $text . '</p>';
echo '</div>';
}
} else {echo '<p>Hier sollten eigentlich Schülerstimmen zu sehen sein. Wenn du stattdessen diesen Text liest, ist hier etwas schiefgelaufen. Ich wäre ich dir sehr dankbar, wenn du mich kurz per E-Mail informieren könntest: <a href="mailto:
}
?>{/source}
Alle Bewertungen direkt bei Google ansehen