The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vBulletin attachments table structure
I am importing posts from a custom forum to vBulletin 4. I have done most of the work. Now only photos/videos needs to be copied.
For that I will replace [img] tags (old Forum tags) to vBulletin tags such as [ATTACH]ID[/ATTACH]. But I need to know how does vB manages attachments? What is the table structure? Which tables are involved? So far I have found that following tables are involved filedata attachmentcategoryuser attachment |
#2
|
||||
|
||||
It also depends on storing attachments in the database (Bad) or the file system (Good)
I.e. the file system comes into play To import the image has to be local to the vB system - if IMG tags were used then they need to stay that way as the image is likely to not be on your server |
#3
|
|||
|
|||
I don't know all the details, but basically each file has a row in filedata. If you are storing files in the database, then the actual file contents go in there, otherwise they go in the filesystem, and I believe the filename is related to the fileid. Then there's a row in attachment for each place it's attached (the same file can be attached more than one place). contenttype tells what it's attached to (a post or somewhere else, I'm no sure what all the possibilities are), and contentid has the postid or whateevr other id is appropriate. Also, in the post table I believe the attach column is the count of attachments to each post.
I don't know what attachmentcategoryuser is for. Sorry I don't have more details off the top of my head, maybe someone else will have more to say. |
#4
|
|||
|
|||
Thank you both. I have an external PHP external that gets the image from URL and create records in the 3 tables I mentioned. However, I am not creating posthash column. Then I am replacing [img] tags with [ATTACH=CONFIG] tags so that VBulletin can understand that it is an attachment. But attachments are not being shown as photos. THere is only a link shown in the posts.
Attachment are stored in DB in my VB forum. I read it that database is a better option because of performance. |
#5
|
||||
|
||||
On the file system the path to the files is based on the userid then the attachment id as the file.
Eg for me the path would be ./attachments/2/2/8/7/8/1/123.attach and also .thumb depending of where you setup the attachments folder. The attachment renderer handles the file types |
#6
|
|||
|
|||
I am stuck as to how Can i get the photos in the post from custom forums to vB Forums.
--------------- Added [DATE]1423690944[/DATE] at [TIME]1423690944[/TIME] --------------- Need help from vB experts!! |
#7
|
|||
|
|||
Did you include the thumbnail info? If not you might try Maintenance > General Update Tools > Rebuild Attachment Thumbnails.
|
#8
|
||||
|
||||
Best is to download impex (free on GitHUB) and look at the import code and adapt that.
See https://members.vbulletin.com/import.php |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|