Advertisement:
Advertise With Us!

Navigation

SMF Mod Site

Mod Name:
Post and PM Inline Attachments
Created By:
dougiefresh
Type:
Posting
First Created:
August 02, 2013, 05:05:55 PM
Last Modified:
April 15, 2016, 12:57:55 PM
Latest Version:
4.15
Compatible With:
2.0.4, 2.0.5, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.10, 2.0.11
Total Downloads:
1659

Download this mod

Post_and_PM_Inline_Attachments_v4.15.zip (52kB) [165]
Manual Install Instructions for SMF


Below are some preview images of what the mod looks like when being used

Description:


POST & PM INLINE ATTACHMENTS v4.15
By Dougiefresh -> Link to Mod


Introduction
This mod adds the ability to position your attachments in either your forum post or your personal message post using [attachment=n][/attachment] bbcode (where n is the number of the attachment in the post, eg first = 0, second = 1).

BBcode Usage Forms
Version 1.0 introduced the following forms:
Quote
[attachment={id}][/attachment]
[attachment={id},{width}][/attachment]
[attachment={id},{width},{height}][/attachment]
Version 2.0 keeps the version 1.0 forms, plus introduces more natural forms:
Quote
[attachment {parameter}={value}{id}][/attachment]
where the following parameters are accepted:
Quote
id={attachment id} => ID number of the attachment to show inline (NOT attachment number!)
width={width} => Desired width of image to show.  Valid: positive integers.
height={height} => Desired height of image to show.  Valid: positive integers.
float={float} => Floats image to relation to everything else.  Valid: left, right, center
margin={pixels} => Margin around inline attachment.  Valid: positive integers
margin-left={pixels} => Left margin around inline attachment.  Valid: positive integers
margin-right={pixels} => Right margin around inline attachment.  Valid: positive integers
margin-top={pixels} => Top margin around inline attachment.  Valid: positive integers
margin-bottom={pixels} => Bottom margin around inline attachment.  Valid: positive integers
border-style={style} => Border style.  Valid: none, dotted, dashed, solid, double, groove, ridge, inset, outset
border-width={pixels} => Border width around inline attachment.  Valid: positive integers
border-color={color} => Border color.  Valid formats: plain text, #xxx, #xxxxxx, rbg(d,d,d)
scale={answer} => Override scaling of image.  Valid: true, false, yes, no
msg={msg ID} => Message ID number.  Valid: positive integers.
Version 2.1 keeps the version 1.0 and 2.0 forms, plus introduces more BBCodes:
Quote
attach => Shows the attachment as a thumbnail, expandable to full size.
attachthumb => Shows NON-EXPANDABLE thumbnail of the attachment.
attachmini => Shows the attachment as a thumbnail, expandable to full size.  Download count and filename omitted beneath (regardless of ILA settings).
Version 2.2 introduces one more BBCode:
Quote
attachurl => Shows the attachment like you used an url tag instead of this tag.
Each of these new BBCodes uses the same format as the [attachment] BBCodes.

Version 3.0 makes further changes and allows the use of the inline attachments bbcodes WITHOUT closing brackets, as well as using attachments from another post!

Version 3.11 makes further changes and allows the use of closed tags, like [attach].  This new form is autonumbered!  Note that the [attach] tag is processed first, then [attachment], then [attachmini], then [attachthumb], then [attachurl].

In each case, {id} is the attachment number relative to the topic, {width} is the max desired width, {height} is the max desired height, {pixels} is the number of pixels surrounding the image, and {float} can be either left, right, or center.  All text between the opening and closing attachment tags is discarded.

If width and height are not specified, max image width and height settings set by admin are respected.  Attachment image will be scaled proportionally to meet desired width/height settings.

Other Mod Features
o Error Text strings are shown for invalid/missing/deleted attachments.
o Inline attachment processes takes place in the parse_bbc function, which means any parsing requests can benefit from this mod!
o Text string is shown as alternative in code
o Adds [Insert Attachment x] next to each attachment/upload box to insert the bbcode.
o Attachments used by the inline attachments mod can be omitted from the attachment display at the bottom of the post
o Reloads the attachments for Ajax Editing.
o Removing an attachment removes the attachment bbcode for that attachment & changes remaining attachment tags to ensure proper post appearance.
o Text between inline attachment brackets are removed (as of version 3.0).
o Automatic modification of boilerplates that use the ILA tags within them when changing "1-based" numbering option.

Admin Settings
The bbcode may be disabled by going to Admin -> Forums -> Posts and Topics -> Bulletin Board Code and unchecking the attachment bbcode.

On the Admin -> Layout -> Attachments and Avatars -> Inline Attachments page, there are several new options:
o Remove attachment image under post after in-post use.
o Use "One based numbering" for attachment IDs (first attachment is 1 instead of 0).
o Allow quoted attachment images from another post.
o Show download link and counter under inline attachment, like non-inline attachments.
o Turn off "nosniff" option for IE and Chrome browsers.
o Whether "attach" tag is the same as the "attachment" tag.
o Allow playing inline attachments that are videos.
o Use Highslide effects for inline attachments. (only if supported Highslide mod is installed)
o Show EXIF information (only if EXIF mod is installed)

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 Beta 1, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

For SMF 2.1 Beta 1, this mod contains no functionality for PM attachments, and posting regular attachments has been changed slightly to allow only 1 file per input box.

These mods can be installed at any time (not required):
o Highslide Image Viewer
o JQLightBox
o SCEditor4Smf
o EXIF
o Boilerplates for Posts

These mods should be installed before this mod (not required):
o HS4SMF v0.8.1
o PM Attachments
o Custom View of Attachments

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.