// Bilder aus der Galerie auslesen und Variable definieren
$dbresult = $db->query("
SELECT p.ID_PICTURE, p.commenttotal, p.filesize, p.views, p.thumbfilename, p.filename, p.height, p.width,
p.title, p.ID_MEMBER, m.username, p.date, p.description
FROM ".TABLE_PREFIX."gallery_pic as p
LEFT JOIN ".TABLE_PREFIX."users AS m on ( p.ID_MEMBER = m.uid)
WHERE p.approved = 1 ORDER BY p.ID_PICTURE DESC LIMIT 5");
$gallery = '';
while($row = $db->fetch_array($dbresult))
{
$gallery .= '<div style="text-align: center; padding: 30px; float: left; width: 130px;"><a style="width: 130px;white-space: pre; font-size: 8pt;" href="ezgallery.php?action=view&id=' . $row['ID_PICTURE'] . '" alt="' . $row['title'] . '" title="' . $row['title'] . '">' . substr($row['title'], 0, 20) . '...<br /><img src="gallery/' . $row['thumbfilename'] . '" width="100" /></a><br />Von: <a href="' . get_profile_link($row['ID_MEMBER']) . '">' . $row['username'] . '</a><br />Betrachtungen: ' . $row['views'] . '<br />Kommentare: ' . $row['commenttotal'] . '</div>';
}