Advertisement:

Author Topic: Attachment Extensions (SMF 2.0.x Only)  (Read 3578 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,345
    • XPtsp.com Community
Attachment Extensions (SMF 2.0.x Only)
« on: June 19, 2011, 11:43:07 PM »
Link to Mod


ATTACHMENT EXTENSION v2.3
By Dougiefresh -> Link to Mod


Introduction
Evidentally, some FTP clients, which shall rename nameless (*cough*cough* FileZilla), doesn't transfer files without an extension correctly without some work.  After reading at one of these threads on the Simple Machines forum (lost the link), I wondered how hard it would be to add an extension to the filenames that attachments are stored under.  So I did some research and figured out it wasn't hard at all.....

PLEASE NOTE that uploaded avatars are considered attachments within SMF and this mod will rename them as well as regular attachments!

What It Does
This mod makes a small change to Subs.php to add the ".321" extension to all attachment filenames.  It also renames all attachments to have the ".321" extension.  Upon uninstalling, it removes the ".321" extension.  This mod also modified the code for the PM attachments mod, if present, in order to effect the same modification to it.

AEVA MEDIA: This mod adds the proper extension (lowercase) to the media attachment file, thus 1_blah becomes 1_blah.jpg if the original filename has an extension of jpg.

Credits
stucki requested the addition of support for Aeva Media files.  Thanks, Stucki!

Admin Settings
There are no admin settings.  To disable it, you must remove this mod.

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on any version of SMF 2.0.x.  SMF 1.x and SMF 2.1 is not and will not be supported.

If you use the PM Attachments mod, it should be installed before this mod.

If you use the Aeva Media v1.4w mod, it should be installed before this mod.

This mod should be installed AFTER a forum conversion (phpbb -> smf), not before, as files will not be named correctly during the conversion.

Compatibility Notes
This mod was tested on SMF 2.0.8, but should work on earlier versions of SMF 2.0.x.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Copyright (c) 2015, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: June 08, 2014, 08:02:39 PM by dougiefresh »
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,345
    • XPtsp.com Community
Re: Change Attachment Extensions
« Reply #1 on: August 04, 2013, 06:56:01 PM »
Updated to v1.2.  Only change is that the unnecessary ZIP file inside the package was removed, per SMF guidelines.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,345
    • XPtsp.com Community
Re: Change Attachment Extensions
« Reply #2 on: June 08, 2014, 08:02:27 PM »
Uploaded v2.0 - June 6th, 2014
o Added attachment support for Aeva Media v1.4w
o Fixed install.php script to correctly handle pm attachments, as they were skipped over (somehow)

Credits: stucki requested the addition of support for Aeva Media files.  Thanks, Stucki!

NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,345
    • XPtsp.com Community
Re: Change Attachment Extensions
« Reply #3 on: April 25, 2015, 01:50:45 PM »
Uploaded v2.1 - April 25th, 2015
o Fixed package-info.xml so that Sources/Aeva-Subs-Vital.php is skipped if not found.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,345
    • XPtsp.com Community
Re: Attachment Extensions (SMF 2.0.x Only)
« Reply #4 on: September 21, 2016, 11:04:36 PM »
Uploaded v2.2 - September 21st, 2016
o Modified package to be match the attachment extension of SMF 2.1.
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,345
    • XPtsp.com Community
Re: Attachment Extensions (SMF 2.0.x Only)
« Reply #5 on: September 11, 2017, 03:42:30 PM »
Uploaded v2.3 - September 11th, 2017
o Fixed attachment support for Aeva Media v1.4w.



 ::) Surprised nobody caught this one....  Or at least reported it...
NOTICE:  My website is back up!

My Free Simple Machines mods on XPtsp.com and Simple Machines Customization Site!
My mods are being uploaded and are available at GitHub as well!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,701
    • Arantor on GitHub
Re: Attachment Extensions (SMF 2.0.x Only)
« Reply #6 on: September 11, 2017, 05:21:43 PM »
Is Aeva still on the mod site? I thought it was pulled years ago for a 'security vulnerability'.

The fact that Aeva basically hasn't had support in 5 years because Wedge happened probably didn't help this one.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.