Well, I finally managed it
Right now Iam using:
Code:
// Thumbnails
if($foruminfo['forumid'] == '22') {
$getpostids = $DB_site->query("SELECT postid from post WHERE threadid = $thread[threadid] LIMIT 1");
while ($getpostid = $DB_site->fetch_array($getpostids))
{
$attachments = $DB_site->query("
SELECT filename, attachmentid, IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail
FROM " . TABLE_PREFIX . "attachment
WHERE postid = $getpostid[postid]
ORDER BY rand() LIMIT 1
");
$attachment = $DB_site->fetch_array($attachments);
$attachmentid = $attachment['attachmentid'];
$hasthumbnail = $attachment['hasthumbnail'];
}
}
// Thumbnails
for forumdisplay.php
but there's one little problem:
http://www.pagodentreff.de/diskussio...splay.php?f=22 displays must of the thumbnails correct but some of them only have this HTML code:
<img src="attachment.php?attachmentid=&&stc=1&thumb =1" />
instead of
<img src="attachment.php?attachmentid=83&stc=1&thumb=1" />
How can that be!?
$attachmentid should be a number and not & !?
Edit:
Some more information:
$hasthumbnail seems to be false for some reason.. But why? Those are normal thumbnails and the showthread.php displays them correct.