Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4067)
IMAGES WITH MARGINS AND BORDERS v1.8
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4067)
IntroductionThis mod adds several parameters to the "img" tag:
Quote
margin - Margin around the image. Expressed in pixels.
margin-left - The image's left margin. Expressed in pixels.
margin-right - The image's right margin. Expressed in pixels.
margin-top - The image's top margin. Expressed in pixels.
margin-bottom - The image's bottom margin. Expressed in pixels.
Except for
border-style, the border parameters are optional if borders around the image is desired:
Quote
border-style - REQUIRED! Border style. Valid answers: dotted, dashed, solid, double, groove, ridge, inset, outset
border-width - Border width. Expressed in pixels.
border-color - Border color. Expressed either as #xxx, #xxxxxx, rbg(x,x,x), or {text}
Admin SettingsThere are no admin settings to this mod. To disable, you must uninstall this mod.
Compatibility NotesThis mod was tested on SMF 2.0.10, but should work on SMF 2.0 and up, as well as SMF 2.1 RC2. SMF 1.x is not and will not be supported.
ChangelogThe changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/images-with-margins-and-borders/?tab=1).
LicenseCopyright (c) 2015 - 2019, 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.
Uploaded v1.1 - July 29th, 2015
o Rewritten to make "border-style" mandatory for use with "border-width" and "border-color".
o Added "img" tag without "border-style", "border-width", or "border-color" parameters.
UPDATE: Yesterday, I was notified of a potentially "fatal flaw" in SMF's bbcode parser function. The parser generates an array with all possible permutations of the parameters, and thus can run out of memory when dealing with a bbcode tag with a large number of parameters. I've solved this problem in my Post and PM Inline Attachments (http://custom.simplemachines.org/mods/index.php?mod=3770) mod, and I'm going to attempt to solve it for this mod as well.... It's a little more complicated because of the "alt" parameter in the mess of things....
Uploaded v1.2 - July 30th, 2015
o Performance increase due to modification of parse_bbc function to deal with memory issue found.
Quote from: dougiefresh on July 30, 2015, 12:31:12 PM
I was notified of a potentially "fatal flaw" in SMF's bbcode parser function.
Hi dougie.
Sorry for the OT here (I'll split it later) but can you elaborate on this? We know that parse_bbc is a tremendous beast but I don't think I ever saw it causing memory issues, not even in the 2.0.7 upgrade with all the subsequent issues...
I started a topic here (http://www.simplemachines.org/community/index.php?topic=538611.0) to describe both the issue and my solution to the problem. My opinion is that this needs to be a part of the core software.....
Thank you :)
Uploaded v1.3 - August 8th, 2015
o Fixed the "fix parameter order" function so that it doesn't mangle the expected output.
NOTICE: In the nightly version found on GitHub, the SMF team has reworked the section of the parse_bbc function that used the permute function so that it no longer needs it, instead relying on a complete different implementation to address the issue brought up in the REPORT: Potentially "Fatal Flaw" in SMF's bbcode parser (http://www.simplemachines.org/community/index.php?topic=538611.0) thread..... In the next few days, I will release an update that will make that particular operation optional....
Uploaded v1.4 - September 4th, 2015
o Operation that calls "fix parameter order" function now skipped for nightly SMF 2.1 Beta 2.
This mod isn't working for me...
below is a list of installed mods...
Quote from: woolly bugger on September 09, 2015, 12:54:14 PM
This mod isn't working for me...
More information would be helpful. In what way does it not work for you?
If you have problems installing the mod, attach your
Sources/Subs.php..... Can't do anything until then....
Hi, can you post an sample about how to include the Tag in the image code please?
Thanks
Quote from: romanos8 on September 10, 2015, 02:59:30 AM
Hi, can you post an sample about how to include the Tag in the image code please?
Sure!
[img width=600 border-style=solid]https://upload.wikimedia.org/wikipedia/commons/3/30/Chrysanthemum-purple-2.jpg[/img]
should produce a post like this:
(https://www.simplemachines.org/community/index.php?action=dlattach;topic=538493.0;attach=244458)
The Mod looks interesting; thanks for all the work! And good luck with the upcoming knee surgery.
FYI - i had to uninstall this to get 2.0.14 to fit ... the whole story is at https://www.simplemachines.org/community/index.php?topic=554557
Uploaded v1.5 - July 5th, 2017
o Added support for SMF 2.0.14.
@aegersz: Thank you for reporting the incompatibility. It has been patched in this version!
Uploaded v1.6 - August 31st, 2017
o Fixed undefined array element error in mod.
Uploaded v1.7 - October 19th, 2018
o No functionality change.
o Updated documentation to point to new website.
Uploaded v1.8 - May 22nd, 2019
o Added support SMF 2.0 RC2.
o Removed support for SMF 2.1 Beta 2.
Just installed this mod how do you get the margin option to work i have the border style working what code do you use for the margin.