News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Manually Processing Attachments

Started by chijon, February 13, 2018, 11:10:32 AM

Previous topic - Next topic

chijon

Hi all,

I've been working on a dry run of converting our existing board (hosted on hxxp:forums.net [nonactive]) to SMF. I had issues with the converter that was posted so instead worked on building my own SQL commands to move the database tables from the export received from hxxp:forums.net [nonactive].

What I am stuck on is attachments.

How can I manually populate the attachments table and get the attachments to appear on the posts?
I have a folder containing all of the attachments from my existing board. It looks to me like SMF requires the files be hashed - is there a way for me to do this in bulk? I tried taking a few files and putting them in the attachments folder and inserting rows into smf_attachments related to the files but they do not work. Do the attachments require thumbnails? I'm looking at roughly 450 attachment files.

I have no issues with populating the smf_attachments table, I just don't know how to format the files/filenames so that SMF will pick them up on the front end.

vbgamer45

Use function getAttachmentFilename() in sources/subs.php

And also check out sources/subs-post.php createAttachement as well
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

chijon

Thank you @vbgamer45 - using the first function mentioned I was able to fix a few individually by generating the proper hash. I'll have to work on automating this for the rest.

I took a quick peak at createAttachment but it wasn't immediately clear to me what to do with it. I know enough about PHP to get myself into trouble - I'll have to look more to figure it out.

Thanks!

Advertisement: