Quote:
Originally Posted by MarcoH64
Previous reply updated.
|
I'm using the normal settings of vBulletin I guess that's with the database. I've got a few table's with attachement information...
This query works, but the part to display the image that's attached (that's what I want) won't. What do I wrong??? :ermm:
PHP Code:
$news = $DB_site->query_first("
SELECT post.pagetext, post.postid
FROM " . TABLE_PREFIX . "post AS post
WHERE post.threadid=884
ORDER BY post.dateline DESC
LIMIT 1");
$attach = $DB_site->query_first("
SELECT attachment.filename, attachment.filesize, attachment.visible, attachmentid, counter
FROM " . TABLE_PREFIX . "attachment AS attachment
WHERE attachment.postid = {$news['postid']}");
//$attachment['attachmentextension'] = file_extension($attach['filename']);
//$attachment['filename'] = $attach['filename'];
//$attachment['attachmentid'] = $attach['attachmentid'];
//$attachment['filesize'] = vb_number_format($attach['filesize'], 1, true);
//$attachment['counter'] = $attach['counter'];
//eval('$attachment = "' . fetch_template('postbit_attachment') . '";');
//$attachment = str_replace('"attachment.php', '"' . $vboptions['bburl'] . '/attachment.php', $attachment);
$attachment = '<a href="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $attach['attachmentid'] . '" target="_blank"><img border="0" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $attach['attachmentid'] . '&stc=1&thumb=1" /></a>';
Fixed it



Thanks everybody for your help! :up:
PHP Code:
$news = $DB_site->query_first("
SELECT post.pagetext, post.postid
FROM " . TABLE_PREFIX . "post AS post
WHERE post.threadid=884
ORDER BY post.dateline DESC
LIMIT 1");
$attach = $DB_site->query_first("
SELECT attachment.filename, attachment.filesize, attachment.visible, attachmentid, counter
FROM " . TABLE_PREFIX . "attachment AS attachment
WHERE attachment.postid = {$news['postid']}");
$attachment['attachmentextension'] = file_extension($attach['filename']);
$attachment['filename'] = $attach['filename'];
$attachment['attachmentid'] = $attach['attachmentid'];
$attachment['filesize'] = vb_number_format($attach['filesize'], 1, true);
$attachment['counter'] = $attach['counter'];
eval('$attachment = "' . fetch_template('postbit_attachmentimage') . '";');
$attachment = str_replace('"attachment.php', '"' . $vboptions['bburl'] . '/attachment.php', $attachment);