Exemple #1
0
function digga_view($artist_id)
{
    $artist_info = digga_fetch_info($artist_id);
    echo '<h1>Digga ger dig info om ' . $artist_info['name'] . '</h1>' . "\n";
    echo '<h3>' . cute_number($artist_info['popularity']) . ' Hamsterpajare diggar ' . $artist_info['name'] . '!</h3>' . "\n";
    if (strlen($artist_info['description']) > 0) {
        echo '<p class="digga_description">' . "\n";
        echo nl2br($artist_info['description']);
        echo '</p>' . "\n";
    } else {
        echo '<p class="digga_no_description">' . "\n";
        echo 'Vi har tyvärr ingen beskrivning om ' . $artist_info['name'] . ' än. Om du känner att du kan mycket om det ';
        echo 'här bandet eller den här artisten så får du hemskt gärna skriva en egen beskrivning och skicka den som ett ';
        echo 'privat meddelande till <a href="/traffa/profile.php?id=774586">Joar</a>. Glöm inte att tala om vilken artist ';
        echo 'det gäller!' . "\n";
        echo '</p>' . "\n";
    }
    if (is_privilegied('digga_admin')) {
        echo 'Du kan <a href="?action=edit&artist_id=' . $artist_id . '">';
        echo 'ändra beskrivningen och namnet</a>';
    }
    $diggers = digga_fetch_diggers($artist_id);
    if (count($diggers) > 0) {
        echo '<div id="digga_diggers">' . "\n";
        echo '<h2>Hamsterpajare som diggar ' . $artist_info['name'] . '</h2>' . "\n";
        echo '<table>' . "\n";
        foreach ($diggers as $digger) {
            echo '<tr>' . "\n";
            echo '<td><a href="/traffa/profile.php?id=' . $digger['id'] . '">' . $digger['username'] . '</a></td>' . "\n";
            echo '<td>' . $digger['gender'] . date_get_age($digger['birthday']) . '</td>' . "\n";
            echo '<td>';
            echo $digger['lastaction'] > time() - 900 ? 'online' : 'offline';
            echo '</td>' . "\n";
            echo '</tr>' . "\n";
        }
        echo '</table>' . "\n";
        echo '</div>' . "\n";
    }
    echo '<div id="digga_songs">' . "\n";
    echo '<h2>Låtar av ' . $artist_info['name'] . '</h2>' . "\n";
    $query = 'SELECT title FROM songs WHERE artist = "' . $artist_id . '" ORDER BY popularity DESC';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    echo '<ul style="list-style-type: none;">' . "\n";
    while ($data = mysql_fetch_assoc($result)) {
        echo '<li>' . $data['title'] . '</li>' . "\n";
    }
    echo '</ul>' . "\n";
    echo '</div>' . "\n";
}
Exemple #2
0
 $artist_info = digga_fetch_info($_GET['artist_id']);
 echo '<h1>Digga ger dig info om ' . $artist_info['name'] . '</h1>' . "\n";
 echo '<h3>' . cute_number($artist_info['popularity']) . ' Hamsterpajare diggar ' . $artist_info['name'] . '!</h3>' . "\n";
 if (strlen($artist_info['description']) > 0) {
     echo '<p class="digga_description">' . "\n";
     echo nl2br($artist_info['description']);
     echo '</p>' . "\n";
 } else {
     echo '<p class="digga_no_description">' . "\n";
     echo 'Vi har tyvärr ingen beskrivning om ' . $artist_info['name'] . ' än. Om du känner att du kan mycket om det ';
     echo 'här bandet eller den här artisten så får du hemskt gärna skriva en egen beskrivning och skicka den som ett ';
     echo 'privat meddelande till <a href="/traffa/profile.php?id=65654">Rojk</a>. Glöm inte att tala om vilken artist ';
     echo 'det gäller!' . "\n";
     echo '</p>' . "\n";
 }
 $diggers = digga_fetch_diggers($_GET['artist_id']);
 if (count($diggers) > 0) {
     echo '<div id="digga_diggers">' . "\n";
     echo '<h2>Hamsterpajare som diggar ' . $artist_info['name'] . '</h2>' . "\n";
     echo '<table>' . "\n";
     foreach ($diggers as $digger) {
         echo '<tr>' . "\n";
         echo '<td><a href="/traffa/profile.php?id=' . $digger['id'] . '">' . $digger['username'] . '</a></td>' . "\n";
         echo '<td>' . $digger['gender'] . date_get_age($digger['birthday']) . '</td>' . "\n";
         echo '<td>';
         echo $digger['lastaction'] > time() - 900 ? 'online' : 'offline';
         echo '</td>' . "\n";
         echo '</tr>' . "\n";
     }
     echo '</table>' . "\n";
     echo '</div>' . "\n";