Advertisement:

Author Topic: Images with Margins and Borders  (Read 5663 times)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Images with Margins and Borders
« on: July 27, 2015, 09:59:28 PM »
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.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #1 on: July 29, 2015, 04:16:33 PM »
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.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #2 on: July 30, 2015, 12:31:12 PM »
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....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #3 on: July 30, 2015, 05:43:19 PM »
Uploaded v1.2 - July 30th, 2015
o Performance increase due to modification of parse_bbc function to deal with memory issue found.

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Images with Margins and Borders
« Reply #4 on: July 30, 2015, 08:34:59 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

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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #5 on: July 31, 2015, 09:23:08 AM »
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.....

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,761
  • Gender: Male
Re: Images with Margins and Borders
« Reply #6 on: July 31, 2015, 09:35:00 AM »
Thank you :)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

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

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #7 on: August 08, 2015, 11:04:00 AM »
Uploaded v1.3 - August 8th, 2015
o Fixed the "fix parameter order" function so that it doesn't mangle the expected output.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #8 on: September 04, 2015, 07:50:47 AM »
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....

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #9 on: September 04, 2015, 09:28:02 AM »
Uploaded v1.4 - September 4th, 2015
o Operation that calls "fix parameter order" function now skipped for nightly SMF 2.1 Beta 2.

Offline woolly bugger

  • Jr. Member
  • **
  • Posts: 159
    • Blue Ridge Fly Fisherman's Forum
Re: Images with Margins and Borders
« Reply #10 on: September 09, 2015, 12:54:14 PM »
This mod isn't working for me... 

below is a list of installed mods...

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #11 on: September 09, 2015, 04:25:24 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....

Offline romanos8

  • Semi-Newbie
  • *
  • Posts: 34
Re: Images with Margins and Borders
« Reply #12 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?

Thanks

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #13 on: September 11, 2015, 09:40:50 AM »
Hi, can you post an sample about how to include the Tag in the image code please?
Sure!
Code: [Select]
[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:

Offline Oceander

  • Semi-Newbie
  • *
  • Posts: 25
Re: Images with Margins and Borders
« Reply #14 on: January 30, 2016, 10:09:36 AM »
The Mod looks interesting; thanks for all the work!  And good luck with the upcoming knee surgery.

Offline aegersz

  • SMF Hero
  • ******
  • Posts: 1,494
  • Gender: Male
  • "mods" junkie
    • dopetalk
Re: Images with Margins and Borders
« Reply #15 on: June 14, 2017, 07:16:57 AM »
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 145 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)

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #16 on: July 05, 2017, 02:39:17 PM »
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!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #17 on: August 31, 2017, 11:39:17 PM »
Uploaded v1.6 - August 31st, 2017
o Fixed undefined array element error in mod.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #18 on: October 19, 2018, 09:57:36 PM »
Uploaded v1.7 - October 19th, 2018
o No functionality change.
o Updated documentation to point to new website.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,859
  • Mod King
    • XPtsp.com Community
Re: Images with Margins and Borders
« Reply #19 on: May 22, 2019, 06:40:10 PM »
Uploaded v1.8 - May 22nd, 2019
o Added support SMF 2.0 RC2.
o Removed support for SMF 2.1 Beta 2.