if (!$config['moduler']['albuminfo']['aktiv']) { exit; } include_once '../include/functions.php'; if (!empty($_GET['album']) && !empty($_GET['artist'])) { $url = $config['lastfm']['api_root']; $url .= "?method=album.getinfo"; $url .= "&api_key=" . $config['lastfm']['api_key']; $url .= "&artist=" . urlencode(avinverter($_GET['artist'])); $url .= "&album=" . urlencode($_GET['album']); $url .= "&format=json"; if ($album = json_decode(file_get_contents($url), true)) { // Sjekk om det er noe feil if ($album['error']) { echo "<p>Beklager, det oppstod en feil!<br />({$album['message']})</p>"; exit; } // Tittel echo '<p class="overskrift">' . $album['album']['name'] . '</p>'; // Bilde if ($album['album']['image'][2]['#text']) { echo '<p class="albumbilde"><img src="' . $album['album']['image'][2]['#text'] . '" alt="' . $album['album']['name'] . '" title="' . $album['album']['name'] . '" /></p>'; } // Beskrivelse if ($album['album']['wiki']['summary']) { echo '<p>' . lastfm_lenker($album['album']['wiki']['summary']) . '</p>'; } // Mer info echo '<p class="les-mer"><a href="' . $album['album']['url'] . '">Les mer hos Last.fm</a></p>'; } }
if ($art = $artist->getinfo($methodVars)) { // Sjekk om det oppstod feil if ($artist->error['code']) { // Error: show which error and go no further. echo '<b>Error ' . $artist->error['code'] . ' - </b><i>' . $artist->error['desc'] . '</i>'; exit; } if ($art['name']) { echo '<p class="overskrift">' . $art['name'] . '</p>'; // Bilde if ($art['image']['large']) { echo '<p class="artistbilde"><img src="' . $art['image']['large'] . '" alt="' . $art['name'] . '" title="' . $art['name'] . '" /></p>'; } // Biografi if ($art['bio']['summary']) { echo '<p>' . lastfm_lenker($art['bio']['summary']) . '</p>'; } } // Lignende artister if ($art['similar']) { echo '<p class="lignende-artister">Lignende artister:</p><ul>'; foreach ($art['similar'] as $sim) { $antall_treff = antall_treff($sim['name']); if ($antall_treff > 0) { echo '<li><a href="?q=' . urlencode($sim['name']) . '&bib=' . $_GET['bib'] . '" class="artist-navn">' . $sim['name'] . '</a>'; echo ' (' . $antall_treff . ')</li>'; } elseif ($config['moduler']['artist']['vis_med_null_treff']) { echo '<li>' . $sim['name'] . ' (' . $antall_treff . ')</li>'; } } }