Images with Margins and Borders

Started by dougiefresh, July 27, 2015, 09:59:28 PM

Previous topic - Next topic

dougiefresh

Link to Mod



IMAGES WITH MARGINS AND BORDERS v1.8
By Dougiefresh -> Link to Mod



Introduction
This 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 Settings
There are no admin settings to this mod.  To disable, you must uninstall this mod.

Compatibility Notes
This 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.

Changelog
The changelog can be viewed at XPtsp.com.

License
Copyright (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.

dougiefresh

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.

dougiefresh

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 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....

dougiefresh

Uploaded v1.2 - July 30th, 2015
o Performance increase due to modification of parse_bbc function to deal with memory issue found.

margarett

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...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

dougiefresh

I started a topic here 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.....

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

dougiefresh

Uploaded v1.3 - August 8th, 2015
o Fixed the "fix parameter order" function so that it doesn't mangle the expected output.

dougiefresh

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 thread.....  In the next few days, I will release an update that will make that particular operation optional....

dougiefresh

Uploaded v1.4 - September 4th, 2015
o Operation that calls "fix parameter order" function now skipped for nightly SMF 2.1 Beta 2.

woolly bugger

This mod isn't working for me... 

below is a list of installed mods...

dougiefresh

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....

romanos8

Hi, can you post an sample about how to include the Tag in the image code please?

Thanks

dougiefresh

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:

Oceander

The Mod looks interesting; thanks for all the work!  And good luck with the upcoming knee surgery.

aegersz

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

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

dougiefresh

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!

dougiefresh

Uploaded v1.6 - August 31st, 2017
o Fixed undefined array element error in mod.

dougiefresh

Uploaded v1.7 - October 19th, 2018
o No functionality change.
o Updated documentation to point to new website.

dougiefresh

Uploaded v1.8 - May 22nd, 2019
o Added support SMF 2.0 RC2.
o Removed support for SMF 2.1 Beta 2.

KittyGalore

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.
SMF Curve 2.0x

Advertisement: