Uh? I thought attachments are pretty simple ...
Basically all you need is in table attachment
attachmentid = Unique identifier for each attachment
userid = The userid of the attachments owner
dateline = UNIX timestamp wehn the attachment was added
filename = The filename
filedata = The file contents (if stored in the database)
visible = 1 = Normal, 0 = In moderation queue
counter = Download-Counter
postid = ID of the post where this attachment is located
filesize = The filesize in Bytes
thumbnail = The thumbnail, if enabled and the attachment is an image and attachments are being stored in the database
filehash = MD5 hash of the file contents
posthash = MD5 hash of the associated post
thumbnail_dateline = UNIX timestamp of the thumbnail
thumbnail_size = Filesize of the thumbnail
If you are storing attachments als files, they are located at /attachpath/u/s/e/r/i/d as attachmentid.attach (the file) and attachmentid.thumb (the thumbnail).
Is that enough info to get you started?
If you want to get information about all attachments in thread 1234
[sql]SELECT attachmentid, userid, dateline, filename, visible, counter, postid, filesize, filehash, posthash, thumbnail_dateline, thumbnail_size FROM attachment WHERE threaid = 1234[/sql]
|