annoying

Author Topic: Image Floating to Left or Right BBCode v1.20  (Read 2557 times)

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Image Floating to Left or Right BBCode v1.20
« on: Nov 22, 2014, 02:07:35 PM »

IMAGE FLOATING TO LEFT OR RIGHT BBCODE v1.19
By Dougiefresh -> Link to Mod


Introduction
This modification adds two BBCodes to allow a user to float an image to the left or right of the text.

The two BBCodes takes these forms:
Code: [Select]
[imgleft]{url}[/imgleft]
[imgright]{url}[/imgright]
[imgleft {params}]{url}[/imgleft]
[imgright {params}]{url}[/imgright]
where {url} is the image URL and the optional acceptable parameters are:
Code: [Select]
[b]alt[/b] - Alternate text if the event that the image can't be displayed.
[b]width[/b] - Width of the image.  Expressed in pixels.
[b]height[/b] - Height of the image.  Expressed in pixels.
[b]margin[/b] - Margin around the image.  Expressed in pixels.
[b]margin-left[/b] - The image's left margin.  Expressed in pixels.
[b]margin-right[/b] - The image's right margin.  Expressed in pixels.
[b]margin-top[/b] - The image's top margin.  Expressed in pixels.
[b]margin-bottom[/b] - The image's bottom margin.  Expressed in pixels.
Except for border-style, the border parameters are optional if borders around the image is desired:
Code: [Select]
[b]border-style[/b] - [b]REQUIRED![/b] Border style.  Valid answers: [b]dotted[/b], [b]dashed[/b], [b]solid[/b], [b]double[/b], [b]groove[/b], [b]ridge[/b], [b]inset[/b], [b]outset[/b]
[b]border-width[/b] - Border width.  Expressed in pixels.
[b]border-color[/b] - Border color.  Expressed either as [b]#xxx[/b], [b]#xxxxxx[/b], [b]rbg(x,x,x)[/b], or [b]{text}[/b]

Admin Settings
This BBCode may be disabled by going into the Admin => Forum => Posts and Topics => Bulletin Board Code and unchecking the bbcodes you don't want to use.  You may also be uninstall this mod in order to disable it.

Compatibility Notes
This mod was tested on SMF 2.0.10, 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.

SMF 2.1 Beta 2 Nightly (as of Sept 4th, 2015) has corrected the flaw reported in REPORT: Potentially "Fatal Flaw" in SMF's bbcode parser, thus the operation that calls the "fix parameter order" function is ignored for those nightlies.

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: Jan 09, 2016, 10:18:45 AM by dougiefresh »

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Re: Image Floating to Left or Right BBCode v1.19
« Reply #1 on: Nov 29, 2014, 03:28:45 PM »

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

Download Mod


FileName: Image_Float_BBCode_v1.20.zip
Size: 10 kb (10,265 bytes)
MD5: 4dd569c15f17d2328b7cd7514caad6d1
Built: Aug 31, 2017, 10:44:30 PM
Downloaded 65 times

Changelog

Uploaded v1.20 - August 31st, 2017
o Fixed undefined array element issue in Subs-BBCode-Float.php.

Uploaded v1.19 - September 6th, 2015
o Added Greek UTF8 file to the package-info.xml so that it actually installs!

Uploaded v1.18 - September 4th, 2015
o Added Greek UTF8 language modification file to the mod, courtsey of villasg.  Thanks, villasg!

Uploaded v.17 - September 4th, 2015
o Rewrote the "fix parameter order" function to be called only when necessary.
o Operation that calls "fix parameter order" function now skipped for nightly SMF 2.1 Beta 2.

Uploaded v1.16 - August 8th, 2015
o Fixed the imgleft and imgright so that the images are floated to left/right of DIV area.
o Fixed issue with "fix parameter order" function so that it displays expected output.

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

Uploaded v1.14 - July 27th, 2015
o Removed code that attempted to make the image responsive.
o Rewrote to make "border-style" mandatory for use with "border-width" and "border-color".
o Added tags without "border-style", "border-width", or "border-color" parameters.

Uploaded v1.13 - July 24th, 2015
o Added "border-style", "border-width" and "border-color" parameters.

Uploaded v1.12 - July 12th, 2015
o Added "margin", "margin-left", "margin-right", "margin-top" and "margin-bottom" parameters.

Uploaded v1.11 - May 2nd, 2015
o Fixed package-info.xml so that image is placed in correct folder.

Uploaded v1.10 - May 1st, 2015
o Fixed missing BBCode button in editor for SMF 2.1 Beta 1.

Uploaded v1.9 - April 4th, 2015
o Updated for SMF 2.1 Beta 1
o Fixed image upload location within package-info.xml

Uploaded v1.8 - February 22nd, 2015
o Fixed bug report by Alanar regarding missing validation functions.

Uploaded v1.7 - January 16th, 2015
o License change to Simplified BSD.  No functionality change.

Uploaded v1.6 - December 30th, 2014
o Added alt parameter to the imgleft and imgright bbcodes.

Uploaded v1.5 - December 29th, 2014
o Fixed image install locations within package-info.xml.

Uploaded v1.4 - December 17th, 2014
o Rewrote mod to use one validation function for all bbcodes in this mod.

Uploaded v1.3 - December 10th, 2014
o Added button for the bbcode.

Uploaded v1.2 - December 6th, 2014
o Added code to disable creation of the validation code if BBCode is disabled.

Uploaded v1.1 - December 5th, 2014
o Fixed bbcode code so that requested width and height are honored...

Uploaded v1.0 - November 22th, 2014
o Initial Release of the mod

Translations

Quote
$txt['imgleft'] = "Float Image to the left";
$txt['imgright'] = "Float Image to the right";
« Last Edit: Oct 29, 2016, 08:02:08 PM by dougiefresh »