PDA

View Full Version : How to convert DB vbb3 to vbb4


Easy5s.net
09-27-2012, 11:44 AM
Here is code for VB3, how it can be work with VB4 damaged because the database of completely different vbb4 and it does not have postid.

$postid = $newpost['postid'];
$attachs = $vbulletin->db->query_read("
SELECT dateline, filename, attachmentid
FROM " . TABLE_PREFIX . "attachment
WHERE postid = $postid
ORDER BY attachmentid
");


sorry my bad english.

kh99
09-27-2012, 01:04 PM
I think you want something like this:

$contenttypeid = vB_Types::instance()->getContentTypeID('vBForum_Post');
$postid = $newpost['postid'];
$attachs = $vbulletin->db->query_read("
SELECT dateline, filename, attachmentid
FROM " . TABLE_PREFIX . "attachment
WHERE contenttypeid = $contenttypeid AND contentid = $postid
ORDER BY attachmentid
");