Advertisement:

Author Topic: Manually Processing Attachments  (Read 1021 times)

Offline chijon

  • Newbie
  • *
  • Posts: 2
Manually Processing Attachments
« on: February 13, 2018, 11:10:32 AM »
Hi all,

I've been working on a dry run of converting our existing board (hosted on Forums.net) 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 Forums.net.

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.

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 20,549
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Manually Processing Attachments
« Reply #1 on: February 13, 2018, 11:35:28 AM »
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

Offline chijon

  • Newbie
  • *
  • Posts: 2
Re: Manually Processing Attachments
« Reply #2 on: February 15, 2018, 10:57:44 AM »
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!