vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Listing all attachment from a thread (https://vborg.vbsupport.ru/showthread.php?t=82398)

TitanKing 06-02-2005 01:18 PM

Listing all attachment from a thread
 
Heya all, I found that VB uses a rather complicated method of storing attachments, not that I mind its just complicated to retrieve those attachments from an external script... can anyone perhaps point me in the right direction regarding the retrievel query, its kinda confusing... I would appreciate it very much people.

Thank you in advance...

Andreas 06-02-2005 01:49 PM

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]

TitanKing 06-02-2005 01:53 PM

Thank you very much KirbyDE this will surely set me on the right track, I appreciate your reply so much...


All times are GMT. The time now is 06:29 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00971 seconds
  • Memory Usage 1,707KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete