Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on May 25, 2013, 08:19:00 PM

Title: phpBB-style Font Size BBCode
Post by: dougiefresh on May 25, 2013, 08:19:00 PM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3714)



PHPBB FONT SIZE BBCODE v2.4
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3714)



Introduction
This modification adds the phpBB-style font size BBcode to the forum, where the parameter in the size bbcode is a percentage from 10% to 999% (without the percentage sign).

This code allows users to use size syntax like this:
[size=150][/size]
[size=150%][/size]


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

Changelog
The changelog can be viewed at XPtsp.com (http://www.xptsp.com/board/free-modifications/phpbb-font-size-bbcode/?tab=1).

License
Copyright (c) 2015 - 2018, 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.
Title: Re: phpBB-style Font Size BBCode
Post by: WasdMan on June 01, 2013, 03:56:57 PM
Can you send a picture about what is it really?
Title: Re: phpBB-style Font Size BBCode
Post by: Shambles on June 01, 2013, 04:07:27 PM
Nice and tidy mod :)

To be honest, though, it would look far better if the BBcode was presented with the % sign, like

[size=50%] This is half-sized text [/size]

rather than

[size=50] This is half-sized text [/size]


All in my own opinion, of course...
Title: Re: phpBB-style Font Size BBCode
Post by: dougiefresh on June 10, 2013, 01:53:10 PM
Quote from: WasdMan on June 01, 2013, 03:56:57 PM
Can you send a picture about what is it really?
I've updated the first post with additional information about the usage of the new size syntax.  I hope this helps you.

Quote from: Shambles on June 01, 2013, 04:07:27 PM
Nice and tidy mod :)

To be honest, though, it would look far better if the BBcode was presented with the % sign, like
[size=50%] This is half-sized text [/size]
rather than
[size=50] This is half-sized text [/size]
All in my own opinion, of course...
I like the idea.  It's been implemented in version 2.0 of this mod, which has been uploaded.  Thanks!

EDIT: Both the phpBB-style and the percentage sign syntax work with this mod now....  Just wanted to clarify!  :P  Enjoy!
Title: Re: phpBB-style Font Size BBCode
Post by: Shambles on June 10, 2013, 05:07:34 PM
Very good Dougiefresh :)

Your mod is now twice 200% the mod it first was ;)
Title: Re: phpBB-style Font Size BBCode
Post by: dougiefresh on December 06, 2014, 04:18:50 PM
Uploaded v2.1 - December 6th, 2014
o Added code to disable creation of the validation code if BBCode is disabled.
Title: Re: phpBB-style Font Size BBCode
Post by: dougiefresh on January 19, 2015, 09:40:22 AM
Uploaded v2.2 - January 19th, 2015
o License change to Simplified BSD.  No functionality change.
Title: Re: phpBB-style Font Size BBCode
Post by: dougiefresh on April 06, 2015, 05:04:31 PM
Uploaded v2.3 - April 4th, 2015
o Updated for SMF 2.1 Beta 1
Title: Re: phpBB-style Font Size BBCode
Post by: dougiefresh on October 23, 2018, 12:05:06 PM
Uploaded v2.4 - October 23rd, 2018
o No functionality change.
o Updated documentation to point to new website.
Title: Re: phpBB-style Font Size BBCode
Post by: Marina3 on December 10, 2022, 07:11:30 AM
Fatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.
How to correct this error?
Title: Re: phpBB-style Font Size BBCode
Post by: Steve on December 10, 2022, 07:32:18 AM
@Marina3 - What version of SMF are you running?
Title: Re: phpBB-style Font Size BBCode
Post by: dodos26 on December 10, 2022, 10:32:06 AM
Quote from: Marina3 on December 10, 2022, 07:11:30 AMFatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.
How to correct this error?

Back to 7.4 php dont use php 8.
Title: Re: phpBB-style Font Size BBCode
Post by: Marina3 on September 12, 2023, 06:06:48 AM
I use SMF 2.1.4 and php 8.2.
Fatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.   

Error in this code:
'validate' => isset($disabled['size']) ? null : create_function('&$tag, &$data, $disabled', '
$data = str_replace(\'%\', \'\', $data);'
            ),
Title: Re: phpBB-style Font Size BBCode
Post by: Sesquipedalian on September 12, 2023, 12:59:01 PM
Quote from: Marina3 on September 12, 2023, 06:06:48 AMI use SMF 2.1.4 and php 8.2.
Fatal error: Uncaught Error: Call to undefined function create_function() in /Sources/Subs.php:2344.   

Error in this code:
'validate' => isset($disabled['size']) ? null : create_function('&$tag, &$data, $disabled', '
$data = str_replace(\'%\', \'\', $data);'
            ),

That means the mod is incompatible with PHP 8. It would need to be updated before it could work on your server.

The author of this modification has not logged in here in quite some time, so it is unlikely that he will update it himself anytime soon. However, the license does allow others to edit and redistribute copies, so you could post in the Help Wanted (https://www.simplemachines.org/community/index.php?board=50.0) board to ask if anyone could update it for you.

Title: Re: phpBB-style Font Size BBCode
Post by: Diego Andrés on September 12, 2023, 03:54:41 PM
@Marina3 You could test if the MOD works correctly after installing this other MOD: https://custom.simplemachines.org/index.php?mod=4300
Title: Re: phpBB-style Font Size BBCode
Post by: GL700Wing on September 12, 2023, 11:17:15 PM
I've just submitted a hooks-only SMF 2.1 version of this mod for approval.
Title: Re: phpBB-style Font Size BBCode
Post by: GL700Wing on September 14, 2023, 04:11:25 PM
Quote from: GL700Wing on September 12, 2023, 11:17:15 PMI've just submitted a hooks-only SMF 2.1 version of this mod for approval.
@Marina3 : The SMF 2.1 mod is now available - see phpBB Font Size BBCode for SMF 2.1 (https://custom.simplemachines.org/index.php?mod=4376).